locked
API Programming and functions. - Part IV RRS feed

  • Question

  • The third thread also had become too long.. So continue the posts here guys...
    Friday, June 15, 2007 4:34 PM

All replies

  • RegSetValueEx

    The RegSetValueEx function stores data in the value field of an open registry key. It can also set additional value and type information for the specified key.

    VB4-32,5,6
    Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value.

    VB.NET
    Microsoft.Win32.RegistryKey.SetValue

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Advapi32

    Parameter Information
    · hKey
    Identifies a currently open key or any of the following predefined reserved handle values:
    HKEY_CLASSES_ROOT
    HKEY_CURRENT_USER
    HKEY_LOCAL_MACHINE
    HKEY_USERS

    · lpValueName
    Points to a string containing the name of the value to set. If a value with this name is not already present in the key, the function adds it to the key.
    If this parameter is NULL or points to an empty string and the dwType parameter is the REG_SZ type, this function sets the same value the RegSetValue function would set.

    · Reserved
    Reserved; must be zero.

    · dwType
    Specifies the type of information to be stored as the value’s data. This parameter can be one of the following values:
    REG_BINARY
    Binary data in any form.
    REG_DWORD
    A 32-bit number.
    REG_DWORD_LITTLE_ENDIAN
    A 32-bit number in little-endian format (same as REG_DWORD). In little-endian format, the most significant byte of a word is the high-order byte. This is the most common format for computers running Windows NT and Windows 95.
    REG_DWORD_BIG_ENDIAN
    A 32-bit number in big-endian format. In big-endian format, the most significant byte of a word is the low-order byte.
    REG_EXPAND_SZ
    A null-terminated string that contains unexpanded references to environment variables (for example, “%PATH%”). It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions.
    REG_LINK
    A Unicode symbolic link.
    REG_MULTI_SZ
    An array of null-terminated strings, terminated by two null characters.
    REG_NONE
    No defined value type.
    REG_RESOURCE_LIST
    A device-driver resource list.
    REG_SZ
    A null-terminated string. It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions.

    · lpData
    Points to a buffer containing the data to be stored with the specified value name.

    · cbData
    Specifies the size, in bytes, of the information pointed to by the lpData parameter. If the data is of type REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ, cbData must include the size of the terminating null character.

    Return Values
    If the function succeeds, the return value is ERROR_SUCCESS.

    If the function fails, the return value is a nonzero error code defined in WINERROR.H. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.

    Friday, June 15, 2007 4:39 PM
  • ReleaseMutex

    This function releases ownership of the specified mutex object.

    VB4-32,5,6
    Declare Function ReleaseMutex Lib "kernel32" (ByVal hMutex As Long) As Long

    VB.NET
    System.Threading.Mutex.ReleaseMutex

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hMutex
    [in] Handle to the mutex object. The CreateMutex function returns this handle.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 4:39 PM
  • RemoveDirectory

    The RemoveDirectory function deletes an existing empty directory.

    VB4-32,5,6
    Declare Function RemoveDirectory Lib "kernel32" Alias "RemoveDirectoryA" (ByVal lpPathName As String) As Long

    VB.NET
    System.IO.Directory.Delete

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpPathName
    Points to a null-terminated string that specifies the path of the directory to be removed. The path must specify an empty directory, and the calling process must have delete access to the directory.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 4:40 PM
  • ResetEvent

    The ResetEvent function sets the state of the specified event object to nonsignaled.

    VB4-32,5,6
    Declare Function FindNextChangeNotification Lib "kernel32" (ByVal hChangeHandle As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hEvent
    Identifies the event object. The CreateEvent or OpenEvent function returns this handle.
    Windows NT: The handle must have EVENT_MODIFY_STATE access. For more information, see Interprocess Synchronization Objects.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 4:48 PM
  • etClipCursor

    The GetClipCursor function retrieves the screen coordinates of the rectangular area to which the cursor is confined.

    VB4-32,5,6
    Declare Function GetClipCursor Lib "user32" (lprc As RECT) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · lpRect
    [out] Pointer to a RECT structure that receives the screen coordinates of the confining rectangle. The structure receives the dimensions of the screen if the cursor is not confined to a rectangle.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 4:54 PM
  • GetClipRgn

    The GetClipRgn function retrieves a handle identifying the current application-defined clipping region for the specified device context.

    VB4-32,5,6
    Declare Function GetClipRgn Lib "gdi32" Alias "GetClipRgn" (ByVal hdc As Long, ByVal hRgn As Long) As Long

    VB.NET
    System.Drawing.Graphics.Clip

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · hrgn
    Identifies an existing region before the function is called. After the function returns, this parameter identifies a copy of the current clipping region.

    Return Values
    An application-defined clipping region is a clipping region identified by the SelectClipRgn function. It is not a clipping region created when the application calls the BeginPaint function.

    If the function succeeds, the hrgn parameter identifies a copy of the current clipping region. Subsequent changes to this copy will not affect the current clipping region.
    Friday, June 15, 2007 4:54 PM
  • RpcStringFree

    The RpcStringFree function frees a character string allocated by the RPC run-time library.

    VB4-32,5,6
    Declare Function RpcStringFree Lib "rpcrt4" Alias "RpcStringFreeA" (lpUUIDString As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Rpcrt4

    Parameter Information
    · String
    Pointer to a pointer to the character string to free.

    Return Values
    RPC_S_OK
    Success

    Friday, June 15, 2007 4:55 PM
  • GetColorAdjustment

    The GetColorAdjustment function retrieves the color adjustment values for the specified device context (DC).

    VB4-32,5,6
    Declare Function GetColorAdjustment Lib "gdi32" Alias "GetColorAdjustment" (ByVal hdc As Long, lpca As COLORADJUSTMENT) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Win9x/ME: Not supported

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · lpca
    Points to a COLORADJUSTMENT structure that receives the color adjustment values.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 4:55 PM
  • RoundRect

    The RoundRect function draws a rectangle with rounded corners. The rectangle is outlined by using the current pen and filled by using the current brush.

    VB4-32,5,6
    Declare Function RoundRect Lib "gdi32" Alias "RoundRect" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · nLeftRect
    Specifies the x-coordinate of the upper-left corner of the rectangle.

    · nTopRect
    Specifies the y-coordinate of the upper-left corner of the rectangle.

    · nRightRect
    Specifies the x-coordinate of the lower-right corner of the rectangle.

    · nBottomRect
    Specifies the y-coordinate of the lower-right corner of the rectangle.

    · nWidth
    Specifies the width of the ellipse used to draw the rounded corners.

    · nHeight
    Specifies the height of the ellipse used to draw the rounded corners.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 4:56 PM
  • GetCommandLine

    The GetCommandLine function returns a pointer to the command-line string for the current process.

    VB4-32,5,6
    Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As Long

    VB.NET
    System.Environment.CommandLine

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Return Values
    The return value is a pointer to the command-line string for the current process.
    Friday, June 15, 2007 4:56 PM
  • GetCompressedFileSize

    The GetCompressedFileSize function obtains the actual number of bytes of disk storage used to store a specified file. If the file is located on a volume that supports compression, and the file is compressed, the value obtained is the compressed size of the specified file. If the file is not located on a volume that supports compression, or if the file is not compressed, the value obtained is the actual file size, the same as the value returned by a call to GetFileSize.

    VB4-32,5,6
    Declare Function GetCompressedFileSize Lib "kernel32" Alias "GetCompressedFileSizeA" (ByVal lpFileName As String, lpFileSizeHigh As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 98 or later

    Library
    Kernel32

    Parameter Information
    · lpFileName
    Pointer to a null-terminated string that specifies the name of the file.

    · lpFileSizeHigh
    Pointer to a DWORD variable that the function sets to the high-order doubleword of the compressed file size. The function’s return value is the low-order doubleword of the compressed file size.
    This parameter can be NULL if the high-order doubleword of the compressed file size is not needed. Files less than 4 gigabytes in size do not need the high-order doubleword.

    Return Values
    If the function succeeds, the return value is the low-order doubleword of the actual number of bytes of disk storage used to store the specified file, and if lpFileSizeHigh is non-NULL, the function puts the high-order doubleword of that actual value into the DWORD pointed to by that parameter. This is the compressed file size for compressed files, the actual file size for noncompressed files.

    If the function fails, and lpFileSizeHigh is NULL, the return value is 0xFFFFFFFF. To get extended error information, call GetLastError.

    If the function fails, and lpFileSizeHigh is non-NULL, the return value is 0xFFFFFFFF, and GetLastError returns a value other than NO_ERROR.
    Friday, June 15, 2007 4:56 PM
  • GetComputerName

    The GetComputerName function retrieves the computer name of the current system. This name is established at system startup, when it is initialized from the registry.

    VB4-32,5,6
    Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

    VB.NET
    System.Windows.Forms.SystemInformation.ComputerName

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpBuffer
    Points to a buffer to receive the null-terminated character string containing the computer name.

    · nSize
    Points to a variable that specifies the maximum size, in characters, of the buffer. This value should be large enough to contain MAX_COMPUTERNAME_LENGTH + 1 characters.

    Return Values
    If the function succeeds, the return value is nonzero and the variable represented by the nSize parameter contains the number of characters copied to the destination buffer, not including the terminating null character.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 4:56 PM
  • ReportFault

    The ReportFault function allows an application that performs its own exception handling to report faults to Microsoft.

    VB4-32,5,6
    Declare Function ReportFault Lib "Faultrep" (pep As EXCEPTION_POINTERS, ByVal dwMode As Long) As EFaultRepRetVal

    Operating Systems Supported
    Requires Windows XP or later; Win9x/ME: Not supported

    Library
    Faultrep

    Parameter Information
    · pep
    [in] Pointer to an EXCEPTION_POINTERS structure.

    · dwMode
    This value is reserved for system use and should be set to zero.

    Return Values
    This function returns one of the following values.

    frrvOk
    The function succeeded.
    frrvOkManifest
    The function succeeded and the client was launched in manifest reporting mode.
    frrvErr
    The function failed but the client was launched.
    frrvErrNoDW
    The client was unable to launch. The system will perform its default actions, such as displaying the standard exception dialog box and launching the debugger.
    frrvErrTimeout
    The function timed out.
    frrvLaunchDebugger
    The function succeeded and the user launched the debugger.
    frrvOkHeadless
    The function succeeded and the client was launched in silent reporting mode.

    These return values indicate whether the reporting application was successfully launched. A successful return value does not indicate that the fault was successfully reported.

    Friday, June 15, 2007 4:57 PM
  • GetComputerNameEx

    The GetComputerNameEx function retrieves a NetBIOS or DNS name associated with the local computer. The names are established at system startup, when the system reads them from the registry.

    VB4-32,5,6
    Declare Function GetComputerNameEx Lib "kernel32.dll" Alias "GetComputerNameExA" (ByVal NameType As COMPUTER_NAME_FORMAT, ByVal lpBuffer As String, ByRef nSize As Long) As Long

    VB.NET
    System.Windows.Forms.SystemInformation.ComputerName

    Operating Systems Supported
    Requires Windows 2000 or later; Win9x/ME: Not supported

    Library
    Kernel32

    Parameter Information
    · NameType
    [in] A value from the COMPUTER_NAME_FORMAT enumeration type that specifies the type of name to retrieve.

    This parameter can be one of the following values from the COMPUTER_NAME_FORMAT enumeration type that specifies the type of name to retrieve.
    ComputerNameNetBIOS
    The NetBIOS name of the local computer. If the local computer is a node in a cluster, lpBuffer receives the NetBIOS name of the cluster.
    ComputerNameDnsHostname
    The DNS host name of the local computer. If the local computer is a node in a cluster, lpBuffer receives the DNS host name of the cluster.
    ComputerNameDnsDomain
    The name of the DNS domain assigned to the local computer. If the local computer is a node in a cluster, lpBuffer receives the DNS domain name of the cluster.
    ComputerNameDnsFullyQualified
    The fully qualified DNS name that uniquely identifies the local computer. This name is a combination of the DNS host name and the DNS domain name, using the form HostName.DomainName. If the local computer is a node in a cluster, lpBuffer receives the fully qualified DNS name of the cluster.
    ComputerNamePhysicalNetBIOS
    The NetBIOS name of the local computer. If the local computer is a node in a cluster, lpBuffer receives the NetBIOS name of the local computer, not the name of the cluster.
    ComputerNamePhysicalDnsHostname
    The DNS host name of the local computer. If the local computer is a node in a cluster, lpBuffer receives the DNS host name of the local computer, not the name of the cluster.
    ComputerNamePhysicalDnsDomain
    The name of the DNS domain assigned to the local computer. If the local computer is a node in a cluster, lpBuffer receives the DNS domain name of the local computer, not the name of the cluster.
    ComputerNamePhysicalDnsFullyQualified
    The fully qualified DNS name that uniquely identifies the computer. If the local computer is a node in a cluster, lpBuffer receives the fully qualified DNS name of the local computer, not the name of the cluster.
    The fully qualified DNS name is a combination of the DNS host name and the DNS domain name, using the form HostName.DomainName.

    · lpBuffer
    [out] Pointer to a buffer that receives a null-terminated string containing the computer name.
    The length of the name may be greater than MAX_COMPUTERNAME_LENGTH characters because DNS allows longer names.

    · lpnSize
    [in/out] On input, specifies the size, in TCHARs, of the buffer. On output, receives the number of TCHARs copied to the destination buffer, not including the terminating null character.
    If the buffer is too small, the function fails and GetLastError returns ERROR_MORE_DATA. The lpnSize parameter specifies the size of the buffer required, including the terminating null character.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 4:57 PM
  • RemoveProp

    The RemoveProp function removes an entry from the property list of the specified window. The specified character string identifies the entry to be removed.

    VB4-32,5,6
    Declare Function RemoveProp Lib "user32" Alias "RemovePropA" (ByVal hwnd As Long, ByVal lpString As String) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hWnd
    Identifies the window whose property list is to be changed.

    · lpString
    Points to a null-terminated character string or contains an atom that identifies a string. If this parameter is an atom, it must have been created using the AddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpString; the high-order word must be zero.

    Return Values
    If the function succeeds, the return value identifies the specified string. If the string cannot be found in the specified property list, the return value is NULL.

    Friday, June 15, 2007 4:57 PM
  • RemoveMenu

    The RemoveMenu function deletes a menu item from the specified menu. If the menu item opens a drop-down menu or submenu, RemoveMenu does not destroy the menu or its handle, allowing the menu to be reused.

    VB4-32,5,6
    Declare Function RemoveMenu Lib "user32" Alias "RemoveMenu" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long

    VB.NET
    System.Windows.Forms.Menu.Remove

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hMenu
    Identifies the menu to be changed.

    · uPosition
    Specifies the menu item to be deleted, as determined by the uFlags parameter.

    · uFlags
    Specifies how the uPosition parameter is interpreted. This parameter must be one of the following values:
    MF_BYCOMMAND
    Indicates that uPosition gives the identifier of the menu item. If neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified, the MF_BYCOMMAND flag is the default flag.
    MF_BYPOSITION
    Indicates that uPosition gives the zero-based relative position of the menu item.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 4:57 PM
  • RemoveFontResource

    The RemoveFontResource function removes the fonts in the specified file from the Windows font table.

    VB4-32,5,6
    Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · lpFileName
    Points to a null-terminated string that names a font resource file.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 4:57 PM
  • GetConsoleDisplayMode

    The GetConsoleDisplayMode function retrieves the display mode of the current console.

    VB4-32,5,6
    Declare Function GetConsoleDisplayMode Lib "kernel32" (lpModeFlags As Long) As Long

    Operating Systems Supported
    Requires Windows XP or later; Win9x/ME: Not supported

    Library
    Kernel32

    Parameter Information
    · lpModeFlags
    [out] Display mode of the console. This parameter can be one or more of the following values.
    CONSOLE_FULLSCREEN
    Full-screen console. The console is in this mode as soon as the window is maximized. At this point, the transition to full-screen mode can still fail.
    CONSOLE_FULLSCREEN_HARDWARE
    Full-screen console communicating directly with the video hardware. This mode is set after the console is in CONSOLE_FULLSCREEN mode to indicate that the transition to full-screen mode has completed.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 4:58 PM
  • GetConsoleFontSize

    The GetConsoleFontSize function retrieves the size of the font used by the specified console screen buffer.

    VB4-32,5,6
    Declare Function GetConsoleFontSize Lib "kernel32" (ByVal hConsoleOutput As Long, ByVal nFont As Long) As COORD

    Operating Systems Supported
    Requires Windows XP or later; Win9x/ME: Not supported

    Library
    Kernel32

    Parameter Information
    · hConsoleOutput
    [in] Handle to a console screen buffer. The handle must have GENERIC_READ access.

    · nFont
    [in] Index of the font whose size is to be retrieved. This index is obtained by calling the GetCurrentConsoleFont function.

    Return Values
    If the function succeeds, the return value is a COORD structure that contains the width and height of each character in the font. The X member contains the width, while the Y member contains the height.

    If the function fails, the width and the height are zero. To get extended error information, call GetLastError.

    Examples
    Friday, June 15, 2007 4:58 PM
  • GetConsoleProcessList

    The GetConsoleProcessList function retrieves a list of the processes attached to the current console.

    VB4-32,5,6
    Declare Function GetConsoleProcessList Lib "kernel32" (lpdwProcessList As Long, ByVal dwProcessCount As Long) As Long

    Operating Systems Supported
    Requires Windows XP or later; Win9x/ME: Not supported

    Library
    Kernel32

    Parameter Information
    · lpdwProcessList
    [out] Pointer to a buffer that receives an array of process identifiers.

    · dwProcessCount
    [in] Maximum number of process identifiers that can be stored in the lpdwProcessList buffer.

    Return Values
    The return value is the number of processes that are attached to the current console.

    If the return value is less than or equal to dwProcessCount, it is also the number of process identifiers stored in the lpdwProcessList buffer.

    If the return value is greater than dwProcessCount, the lpdwProcessList buffer is too small to hold all the valid process identifiers. The function will have stored no identifiers in the buffer. In this situation, use the return value to allocate a buffer that is large enough to store the entire list, and call the function again.

    If the return value is zero, the function has failed, because every console has at least one process associated with it. To get extended error information, call GetLastError.
    Friday, June 15, 2007 4:58 PM
  • GetCurrentConsoleFont

    The GetCurrentConsoleFont function retrieves information about the current console font.

    VB4-32,5,6
    Declare Function GetCurrentConsoleFont Lib "kernel32" (ByVal hConsoleOutput As Long, ByVal bMaximumWindow As Long, lpConsoleCurrentFont As CONSOLE_FONT_INFO) As Long

    Operating Systems Supported
    Requires Windows XP or later; Win9x/ME: Not supported

    Library
    Kernel32

    Parameter Information
    · hConsoleOutput
    [in] Handle to a console screen buffer. The handle must have GENERIC_READ access.

    · bMaximumWindow
    [in] If this parameter is TRUE, font information is retrieved for the maximum window size. If this parameter is FALSE, font information is retrieved for the current window size.

    · lpConsoleCurrentFont
    [out] Pointer to a CONSOLE_FONT_INFO structure that receives the requested font information.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 4:59 PM
  • GetCurrentDirectory

    The GetCurrentDirectory function retrieves the current directory for the current process.

    VB4-32,5,6
    Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectory" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

    VB.NET
    System.Environment.CurrentDirectory

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · nBufferLength
    Specifies the length, in characters, of the buffer for the current directory string. The buffer length must include room for a terminating null character.

    · lpBuffer
    Points to the buffer for the current directory string. This null-terminated string specifies the absolute path to the current directory.

    Return Values
    If the function succeeds, the return value specifies the number of characters written to the buffer, not including the terminating null character.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    If the buffer pointed to by lpBuffer is not large enough, the return value specifies the required size of the buffer, including the number of bytes necessary for a terminating null character.
    Friday, June 15, 2007 4:59 PM
  • GetCurrentProcess

    The GetCurrentProcess function returns a pseudohandle for the current process.

    VB4-32,5,6
    Declare Function GetCurrentProcess Lib "kernel32" Alias "GetCurrentProcess" () As Long

    VB.NET
    System.Diagnostics.Process.GetCurrentProcess

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Return Values
    The return value is a pseudohandle to the current process.
    Friday, June 15, 2007 5:00 PM
  • GetCurrentProcessId

    The GetCurrentProcessId function returns the process identifier of the calling process.

    VB4-32,5,6
    Declare Function GetCurrentProcessId Lib "kernel32" Alias "GetCurrentProcessId" () As Long

    VB.NET
    System.Diagnostics.Process.GetCurrentProcess.Id

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Return Values
    The return value is the process identifier of the calling process.
    Friday, June 15, 2007 5:00 PM
  • SelectClipRgn

    The SelectClipRgn function selects a region as the current clipping region for the specified device context.

    VB4-32,5,6
    Declare Function SelectClipRgn Lib "gdi32" Alias "SelectClipRgn" (ByVal hdc As Long, ByVal hRgn As Long) As Long

    VB.NET
    System.Drawing.Graphics.SetClip

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · hrgn
    Identifies the region to be selected.

    Return Values
    If the function succeeds, the return value specifies the region’s complexity and can be any one of the following values:
    NULLREGION
    Region is empty.

    SIMPLEREGION
    Region is a single rectangle.

    COMPLEXREGION
    Region is more than one rectangle.

    ERROR
    An error occurred. (The previous clipping region is unaffected.)

    Friday, June 15, 2007 5:01 PM
  • GetCurrentThreadId

    This function returns the thread identifier, which is used as a handle of the calling thread.

    VB4-32,5,6
    Declare Function GetCurrentThreadId Lib "kernel32" () As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Return Values
    The thread identifier of the calling thread indicates success.
    Friday, June 15, 2007 5:01 PM
  • SetArcDirection

    The SetArcDirection sets the drawing direction to be used for arc and rectangle functions.

    VB4-32,5,6
    Declare Function SetArcDirection Lib "gdi32" Alias "SetArcDirection" (ByVal hdc As Long, ByVal ArcDirection As Long) As Long

    VB.NET
    System.Drawing.Graphics.DrawArc

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 98 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · ArcDirection
    Specifies the new arc direction. This parameter can be one of the following values:
    AD_COUNTERCLOCKWISE
    Figures drawn counterclockwise.
    AD_CLOCKWISE
    Figures drawn clockwise.

    Return Values
    If the function succeeds, the return value specifies the old arc direction.

    If the function fails, the return value is zero.

    Friday, June 15, 2007 5:01 PM
  • GetCursor

    The GetCursor function retrieves the handle of the current cursor.

    VB4-32,5,6
    Declare Function GetCursor Lib "user32" Alias "GetCursor" () As Long

    VB.NET
    System.Windows.Forms.Cursor.Current

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Return Values
    If the function succeeds, the return value is the handle of the current cursor.

    If there is no cursor, the return value is NULL.
    Friday, June 15, 2007 5:01 PM
  • Send

    The Windows Sockets send function sends data on a connected socket.

    VB4-32,5,6
    Declare Function Send Lib "wsock32.dll" Alias "send" (ByVal s As Long, buf As Any, ByVal buflen As Long, ByVal flags As Long) As Long

    VB.NET
    System.Net.Sockets.Socket.Send

    Operating Systems Supported
    Requires Windows Sockets 1.1

    Library
    Wsock32.dll

    Parameter Information
    · s
    [in] A descriptor identifying a connected socket.

    · buf
    [in] A buffer containing the data to be transmitted.

    · len
    [in] The length of the data in buf.

    · flags
    [in] An indicator specifying the way in which the call is made.

    Return Values
    If no error occurs, send returns the total number of bytes sent, which can be less than the number indicated by len. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.

    Friday, June 15, 2007 5:01 PM
  • GetCursorPos

    The GetCursorPos function retrieves the cursor’s position, in screen coordinates.

    VB4-32,5,6
    Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long

    VB.NET
    System.Windows.Forms.Cursor.Current.Position

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · lpPoint
    Points to a POINT structure that receives the screen coordinates of the cursor.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:01 PM
  • GetDateFormat

    The GetDateFormat function formats a date as a date string for a specified locale. The function formats either a specified date or the local system date.

    VB4-32,5,6
    Declare Function GetDateFormat Lib "kernel32" Alias "GetDateFormatA" (ByVal Locale As Long, ByVal dwFlags As Long, lpDate As SYSTEMTIME, ByVal lpFormat As String, ByVal lpDateStr As String, ByVal cchDate As Long) As Long

    VB.NET
    System.Globalization.CultureInfo.DateTimeFormat

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · Locale
    Specifies the locale for which the date string is to be formatted. If lpFormat is NULL, the function formats the string according to the date format for this locale. If lpFormat is not NULL, the function uses the locale only for information not specified in the format picture string (for example, the locale’s day and month names).
    This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values:
    LOCALE_SYSTEM_DEFAULT
    Default system locale.
    LOCALE_USER_DEFAULT
    Default user locale.

    · dwFlags
    A set of bit flags that specify various function options. If lpFormat is non-NULL, this parameter must be zero.
    If lpFormat is NULL, you can specify a combination of the following flags:
    LOCALE_NOUSEROVERRIDE
    If set, the function formats the string using the system default date format for the specified locale. If not set, the function formats the string using any user overrides to the locale’s default date format.
    DATE_SHORTDATE
    Use the short date format. This is the default. Cannot be used with DATE_LONGDATE or DATE_YEARMONTH.
    DATE_LONGDATE
    Use the long date format. Cannot be used with DATE_SHORTDATE or DATE_YEARMONTH.
    DATE_YEARMONTH
    Use the year/month format. Cannot be used with DATE_SHORTDATE or DATE_LONGDATE.
    DATE_USE_ALT_CALENDAR
    Use the alternate calendar, if one exists, to format the date string. If this flag is set, the function uses the default format for that alternate calendar, rather than using any user overrides. The user overrides will be used only in the event that there is no default format for the specified alternate calendar.

    · lpDate
    Pointer to a SYSTEMTIME structure that contains the date information to be formatted. If this pointer is NULL, the function uses the current local system date.

    · lpFormat
    Pointer to a format picture string to use to form the date string. If lpFormat is NULL, the function uses the date format of the specified locale.
    Use the following elements to construct a format picture string. If you use spaces to separate the elements in the format string, these spaces will appear in the same location in the output string. The letters must be in uppercase or lowercase as shown in the table (for example, “MM” not “mm”). Characters in the format string that are enclosed in single quotation marks will appear in the same location and unchanged in the output string.
    d
    Day of month as digits with no leading zero for single-digit days.
    dd
    Day of month as digits with leading zero for single-digit days.
    ddd
    Day of week as a three-letter abbreviation. The function uses the LOCALE_SABBREVDAYNAME value associated with the specified locale.
    dddd
    Day of week as its full name. The function uses the LOCALE_SDAYNAME value associated with the specified locale.
    M
    Month as digits with no leading zero for single-digit months.
    MM
    Month as digits with leading zero for single-digit months.
    MMM
    Month as a three-letter abbreviation. The function uses the LOCALE_SABBREVMONTHNAME value associated with the specified locale.
    MMMM
    Month as its full name. The function uses the LOCALE_SMONTHNAME value associated with the specified locale.
    y
    Year as last two digits, but with no leading zero for years less than 10.
    yy
    Year as last two digits, but with leading zero for years less than 10.
    yyyy
    Year represented by full four digits.
    gg
    Period/era string. The function uses the CAL_SERASTRING value associated with the specified locale. This element is ignored if the date to be formatted does not have an associated era or period string.

    For example, to get the date string
    “Wed, Aug 31 94”
    use the following picture string:
    “ddd',' MMM dd yy”

    · lpDateStr
    Pointer to a buffer that receives the formatted date string.

    · cchDate
    Specifies the size, in bytes (ANSI version) or characters (Unicode version), of the lpDateStr buffer. If cchDate is zero, the function returns the number of bytes or characters required to hold the formatted date string, and the buffer pointed to by lpDateStr is not used.

    Return Values
    If the function succeeds, the return value is the number of bytes (ANSI version) or characters (Unicode version) written to the lpDateStr buffer, or if the cchDate parameter is zero, the number of bytes or characters required to hold the formatted date string.

    If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes: ERROR_INSUFFICIENT_BUFFER, ERROR_INVALID_FLAGS, ERROR_INVALID_PARAMETER
    Friday, June 15, 2007 5:02 PM
  • SelectObject

    The SelectObject function selects an object into the specified device context. The new object replaces the previous object of the same type.

    VB4-32,5,6
    Declare Function SelectObject Lib "gdi32" Alias "SelectObject" (ByVal hdc As Long, ByVal hObject As Long) As Long

    VB.NET
    N/A

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · hgdiobj
    Identifies the object to be selected. The specified object must have been created by using one of the following functions:
    CreateBitmap, CreateBitmapIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBSection, CreateBrushIndirect, CreateDIBPatternBrush, CreateDIBPatternBrushPt, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, CreateFont, CreateFontIndirect, CreatePen, CreatePenIndirect, CombineRgn, CreateEllipticRgn, CreateEllipticRgnIndirect, CreatePolygonRgn, CreateRectRgn, CreateRectRgnIndirect

    Return Values
    If the selected object is not a region and the function succeeds, the return value is the handle of the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the following values:
    SIMPLEREGION
    Region consists of a single rectangle.

    COMPLEXREGION
    Region consists of more than one rectangle.

    NULLREGION
    Region is empty.



    If an error occurs and the selected object is not a region, the return value is NULL. Otherwise, it is GDI_ERROR.

    Friday, June 15, 2007 5:02 PM
  • GetDateFormat

    The GetDateFormat function formats a date as a date string for a specified locale. The function formats either a specified date or the local system date.

    VB4-32,5,6
    Declare Function GetDateFormat Lib "kernel32" Alias "GetDateFormatA" (ByVal Locale As Long, ByVal dwFlags As Long, lpDate As SYSTEMTIME, ByVal lpFormat As String, ByVal lpDateStr As String, ByVal cchDate As Long) As Long

    VB.NET
    System.Globalization.CultureInfo.DateTimeFormat

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · Locale
    Specifies the locale for which the date string is to be formatted. If lpFormat is NULL, the function formats the string according to the date format for this locale. If lpFormat is not NULL, the function uses the locale only for information not specified in the format picture string (for example, the locale’s day and month names).
    This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values:
    LOCALE_SYSTEM_DEFAULT
    Default system locale.
    LOCALE_USER_DEFAULT
    Default user locale.

    · dwFlags
    A set of bit flags that specify various function options. If lpFormat is non-NULL, this parameter must be zero.
    If lpFormat is NULL, you can specify a combination of the following flags:
    LOCALE_NOUSEROVERRIDE
    If set, the function formats the string using the system default date format for the specified locale. If not set, the function formats the string using any user overrides to the locale’s default date format.
    DATE_SHORTDATE
    Use the short date format. This is the default. Cannot be used with DATE_LONGDATE or DATE_YEARMONTH.
    DATE_LONGDATE
    Use the long date format. Cannot be used with DATE_SHORTDATE or DATE_YEARMONTH.
    DATE_YEARMONTH
    Use the year/month format. Cannot be used with DATE_SHORTDATE or DATE_LONGDATE.
    DATE_USE_ALT_CALENDAR
    Use the alternate calendar, if one exists, to format the date string. If this flag is set, the function uses the default format for that alternate calendar, rather than using any user overrides. The user overrides will be used only in the event that there is no default format for the specified alternate calendar.

    · lpDate
    Pointer to a SYSTEMTIME structure that contains the date information to be formatted. If this pointer is NULL, the function uses the current local system date.

    · lpFormat
    Pointer to a format picture string to use to form the date string. If lpFormat is NULL, the function uses the date format of the specified locale.
    Use the following elements to construct a format picture string. If you use spaces to separate the elements in the format string, these spaces will appear in the same location in the output string. The letters must be in uppercase or lowercase as shown in the table (for example, “MM” not “mm”). Characters in the format string that are enclosed in single quotation marks will appear in the same location and unchanged in the output string.
    d
    Day of month as digits with no leading zero for single-digit days.
    dd
    Day of month as digits with leading zero for single-digit days.
    ddd
    Day of week as a three-letter abbreviation. The function uses the LOCALE_SABBREVDAYNAME value associated with the specified locale.
    dddd
    Day of week as its full name. The function uses the LOCALE_SDAYNAME value associated with the specified locale.
    M
    Month as digits with no leading zero for single-digit months.
    MM
    Month as digits with leading zero for single-digit months.
    MMM
    Month as a three-letter abbreviation. The function uses the LOCALE_SABBREVMONTHNAME value associated with the specified locale.
    MMMM
    Month as its full name. The function uses the LOCALE_SMONTHNAME value associated with the specified locale.
    y
    Year as last two digits, but with no leading zero for years less than 10.
    yy
    Year as last two digits, but with leading zero for years less than 10.
    yyyy
    Year represented by full four digits.
    gg
    Period/era string. The function uses the CAL_SERASTRING value associated with the specified locale. This element is ignored if the date to be formatted does not have an associated era or period string.

    For example, to get the date string
    “Wed, Aug 31 94”
    use the following picture string:
    “ddd',' MMM dd yy”

    · lpDateStr
    Pointer to a buffer that receives the formatted date string.

    · cchDate
    Specifies the size, in bytes (ANSI version) or characters (Unicode version), of the lpDateStr buffer. If cchDate is zero, the function returns the number of bytes or characters required to hold the formatted date string, and the buffer pointed to by lpDateStr is not used.

    Return Values
    If the function succeeds, the return value is the number of bytes (ANSI version) or characters (Unicode version) written to the lpDateStr buffer, or if the cchDate parameter is zero, the number of bytes or characters required to hold the formatted date string.

    If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes: ERROR_INSUFFICIENT_BUFFER, ERROR_INVALID_FLAGS, ERROR_INVALID_PARAMETER
    Friday, June 15, 2007 5:02 PM
  • GetDC

    The GetDC function retrieves a handle of a display device context (DC) for the client area of the specified window. The display device context can be used in subsequent GDI functions to draw in the client area of the window.

    VB4-32,5,6
    Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Long) As Long

    VB.NET
    System.Windows.Forms.Form.CreateGraphics.GetHdc

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hWnd
    Identifies the window whose device context is to be retrieved.

    Return Values
    If the function succeeds, the return value identifies the device context for the given window’s client area.

    If the function fails, the return value is NULL.
    Friday, June 15, 2007 5:02 PM
  • GetDefaultUserProfileDirectory

    The GetDefaultUserProfileDirectory function retrieves the path to the root of the Default User profile.

    VB4-32,5,6
    Declare Function GetDefaultUserProfileDirectory Lib "userenv.dll" Alias "GetDefaultUserProfileDirectoryA" (ByVal lpProfileDir As String, lpcchSize As Long) As Boolean

    Operating Systems Supported
    Requires Windows 2000 or later; Win9x/ME: Not supported

    Library
    Userenv

    Parameter Information
    · lpProfileDir
    [out] Pointer to a buffer that receives the path to the Default User profile directory.

    · lpcchSize
    [in/out] Specifies the size of the lpProfileDir buffer, in TCHARs.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:02 PM
  • SetLayeredWindowAttributes

    The SetLayeredWindowAttributes function sets the opacity and transparency color key of a layered window.

    VB4-32,5,6
    Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

    VB.NET
    System.Windows.Forms.Opacity

    Operating Systems Supported
    Requires Windows 2000 or later; Win9x/ME: Not supported

    Library
    User32

    Parameter Information
    · hwnd
    [in] Handle to the layered window. A layered window is created by specifying WS_EX_LAYERED when creating the window with the CreateWindowEx function or by setting WS_EX_LAYERED via SetWindowLong after the window has been created.

    · crKey
    [in] Pointer to a COLORREF value that specifies the transparency color key to be used when composing the layered window. All pixels painted by the window in this color will be transparent. To generate a COLORREF, use the RGB macro.

    · bAlpha
    [in] Alpha value used to describe the opacity of the layered window. Similar to the SourceConstantAlpha member of the BLENDFUNCTION structure. When bAlpha is 0, the window is completely transparent. When bAlpha is 255, the window is opaque.

    · dwFlags
    [in] Specifies an action to take. This parameter can be one or more of the following values.
    LWA_COLORKEY
    Use crKey as the transparency color.
    LWA_ALPHA
    Use bAlpha to determine the opacity of the layered window..

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:02 PM
  • GetDefaultUserProfileDirectory

    The GetDefaultUserProfileDirectory function retrieves the path to the root of the Default User profile.

    VB4-32,5,6
    Declare Function GetDefaultUserProfileDirectory Lib "userenv.dll" Alias "GetDefaultUserProfileDirectoryA" (ByVal lpProfileDir As String, lpcchSize As Long) As Boolean

    Operating Systems Supported
    Requires Windows 2000 or later; Win9x/ME: Not supported

    Library
    Userenv

    Parameter Information
    · lpProfileDir
    [out] Pointer to a buffer that receives the path to the Default User profile directory.

    · lpcchSize
    [in/out] Specifies the size of the lpProfileDir buffer, in TCHARs.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:02 PM
  • GetDesktopWindow

    The GetDesktopWindow function returns the handle of the Windows desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which all icons and other windows are painted.

    VB4-32,5,6
    Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Return Values
    The return value is the handle of the desktop window.
    Friday, June 15, 2007 5:03 PM
  • SetFileTime

    The SetFileTime function sets the date and time that a file was created, last accessed, or last modified.

    VB4-32,5,6
    Declare Function SetFileTime Lib "kernel32" Alias "SetFileTime" (ByVal hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime As FILETIME) As Long

    VB.NET
    System.IO.File.SetCreationTime;System.IO.File.SetLastAccessTime;System.IO.File.SetLastWriteTime

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hFile
    Identifies the file for which to set the dates and times. The file handle must have been created with GENERIC_WRITE access to the file.

    · lpCreationTime
    Points to a FILETIME structure that contains the date and time the file was created. This parameter can be NULL if the application does not need to set this information.

    · lpLastAccessTime
    Points to a FILETIME structure that contains the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or (in the case of executable files) run. This parameter can be NULL if the application does not need to set this information.

    · lpLastWriteTime
    Points to a FILETIME structure that contains the date and time the file was last written to. This parameter can be NULL if the application does not want to set this information.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:03 PM
  • GetDeviceCaps

    The GetDeviceCaps function retrieves device-specific information about a specified device.

    VB4-32,5,6
    Declare Function GetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps" (ByVal hdc As Long, ByVal nIndex As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · nIndex
    Specifies the item to return. This parameter can be one of the following values:
    DRIVERVERSION
    The device driver version.

    TECHNOLOGY
    Device technology. It can be any one of the following values:
    DT_PLOTTER
    Vector plotter
    DT_RASDISPLAY
    Raster display
    DT_RASPRINTER
    Raster printer
    DT_RASCAMERA
    Raster camera
    DT_CHARSTREAM
    Character stream
    DT_METAFILE
    Metafile
    DT_DISPFILE
    Display file
    If the hdc parameter identifies the device context of an enhanced metafile, the device technology is that of the referenced device as given to the CreateEnhMetaFile function. To determine whether it is an enhanced metafile device context, use the GetObjectType function.
    HORZSIZE
    Width, in millimeters, of the physical screen.
    VERTSIZE
    Height, in millimeters, of the physical screen.
    HORZRES
    Width, in pixels, of the screen.
    VERTRES
    Height, in raster lines, of the screen.
    LOGPIXELSX
    Number of pixels per logical inch along the screen width.
    LOGPIXELSY
    Number of pixels per logical inch along the screen height.
    BITSPIXEL
    Number of adjacent color bits for each pixel.
    PLANES
    Number of color planes.
    NUMBRUSHES
    Number of device-specific brushes.
    NUMPENS
    Number of device-specific pens.
    NUMFONTS
    Number of device-specific fonts.
    NUMCOLORS
    Number of entries in the device’s color table, if the device has a color depth of no more than 8 bits per pixel. For devices with greater color depths, -1 is returned.
    ASPECTX
    Relative width of a device pixel used for line drawing.
    ASPECTY
    Relative height of a device pixel used for line drawing.
    ASPECTXY
    Diagonal width of the device pixel used for line drawing.
    PDEVICESIZE
    Reserved.
    CLIPCAPS
    Flag that indicates the clipping capabilities of the device. If the device can clip to a rectangle, it is 1. Otherwise, it is 0.
    SIZEPALETTE
    Number of entries in the system palette. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index and is available only if the driver is compatible with Windows version 3.0 or later.
    NUMRESERVED
    Number of reserved entries in the system palette. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index and is available only if the driver is compatible with Windows version 3.0 or later.
    COLORRES
    Actual color resolution of the device, in bits per pixel. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index and is available only if the driver is compatible with Windows version 3.0 or later.
    PHYSICALWIDTH
    For printing devices: the width of the physical page, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical width value of 5100 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.
    PHYSICALHEIGHT
    For printing devices: the height of the physical page, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical height value of 6600 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.
    PHYSICALOFFSETX
    For printing devices: the distance from the left edge of the physical page to the left edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the leftmost 0.25" of paper, has a horizontal physical offset of 150 device units.
    PHYSICALOFFSETY
    For printing devices: the distance from the top edge of the physical page to the top edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the topmost 0.5" of paper, has a vertical physical offset of 300 device units.
    VREFRESH
    Windows NT only: For display devices: the current vertical refresh rate of the device, in cycles per second (Hz).
    A vertical refresh rate value of 0 or 1 represents the display hardware’s default refresh rate. This default rate is typically set by switches on a display card or computer motherboard, or by a configuration program that does not use Win32 display functions such as ChangeDisplaySettings.
    DESKTOPHORZRES
    Windows NT only: Width, in pixels, of the virtual desktop. This value may be larger than HORZRES if the device supports a virtual desktop or multiple displays.
    DESKTOPVERTRES
    Windows NT only: Height, in pixels, of the virtual desktop. This value may be larger than VERTRES if the device supports a virtual desktop or multiple displays.
    BLTALIGNMENT
    Windows NT only: Preferred horizontal drawing alignment, expressed as a multiple of pixels. For best drawing performance, windows should be horizontally aligned to a multiple of this value. A value of zero indicates that the device is accelerated, and any alignment may be used.

    RASTERCAPS
    Value that indicates the raster capabilities of the device, as shown in the following table:
    RC_BANDING
    Requires banding support.
    RC_BITBLT
    Capable of transferring bitmaps.
    RC_BITMAP64
    Capable of supporting bitmaps larger than 64K.
    RC_DI_BITMAP
    Capable of supporting the SetDIBits and GetDIBits functions.
    RC_DIBTODEV
    Capable of supporting the SetDIBitsToDevice function.
    RC_FLOODFILL
    Capable of performing flood fills.
    RC_GDI20_OUTPUT
    Capable of supporting features of Windows 2.0.
    RC_PALETTE
    Specifies a palette-based device.
    RC_SCALING
    Capable of scaling.
    RC_STRETCHBLT
    Capable of performing the StretchBlt function.
    RC_STRETCHDIB
    Capable of performing the StretchDIBits function.

    CURVECAPS
    Value that indicates the curve capabilities of the device, as shown in the following table:
    CC_NONE
    Device does not support curves.
    CC_CIRCLES
    Device can draw circles.
    CC_PIE
    Device can draw pie wedges.
    CC_CHORD
    Device can draw chord arcs.
    CC_ELLIPSES
    Device can draw ellipses.
    CC_WIDE
    Device can draw wide borders.
    CC_STYLED
    Device can draw styled borders.
    CC_WIDESTYLED
    Device can draw borders that are wide and styled.
    CC_INTERIORS
    Device can draw interiors.
    CC_ROUNDRECT
    Device can draw rounded rectangles.

    LINECAPS
    Value that indicates the line capabilities of the device, as shown in the following table:
    LC_NONE
    Device does not support lines.
    LC_POLYLINE
    Device can draw a polyline.
    LC_MARKER
    Device can draw a marker.
    LC_POLYMARKER
    Device can draw multiple markers.
    LC_WIDE
    Device can draw wide lines.
    LC_STYLED
    Device can draw styled lines.
    LC_WIDESTYLED
    Device can draw lines that are wide and styled.
    LC_INTERIORS
    Device can draw interiors.

    POLYGONALCAPS
    Value that indicates the polygon capabilities of the device, as shown in the following table:
    PC_NONE
    Device does not support polygons.
    PC_POLYGON
    Device can draw alternate-fill polygons.
    PC_RECTANGLE
    Device can draw rectangles.
    PC_WINDPOLYGON
    Device can draw winding-fill polygons.
    PC_SCANLINE
    Device can draw a single scanline.
    PC_WIDE
    Device can draw wide borders.
    PC_STYLED
    Device can draw styled borders.
    PC_WIDESTYLED
    Device can draw borders that are wide and styled.
    PC_INTERIORS
    Device can draw interiors.

    TEXTCAPS
    Value that indicates the text capabilities of the device, as shown in the following table:
    TC_OP_CHARACTER
    Device is capable of character output precision.
    TC_OP_STROKE
    Device is capable of stroke output precision.
    TC_CP_STROKE
    Device is capable of stroke clip precision.
    TC_CR_90
    Device is capable of 90-degree character rotation.
    TC_CR_ANY
    Device is capable of any character rotation.
    TC_SF_X_YINDEP
    Device can scale independently in the x- and y-directions.
    TC_SA_DOUBLE
    Device is capable of doubled character for scaling.
    TC_SA_INTEGER
    Device uses integer multiples only for character scaling.
    TC_SA_CONTIN
    Device uses any multiples for exact character scaling.
    TC_EA_DOUBLE
    Device can draw double-weight characters.
    TC_IA_ABLE
    Device can italicize.
    TC_UA_ABLE
    Device can underline.
    TC_SO_ABLE
    Device can draw strikeouts.
    TC_RA_ABLE
    Device can draw raster fonts.
    TC_VA_ABLE
    Device can draw vector fonts.
    TC_RESERVED
    Reserved; must be zero.
    TC_SCROLLBLT
    Device cannot scroll using a bit-block transfer. Note that this meaning may be the opposite of what you expect.

    Return Values
    The return value specifies the value of the desired item.
    Friday, June 15, 2007 5:03 PM
  • SetFilePointer

    The SetFilePointer function moves the file pointer of an open file.

    VB4-32,5,6
    Declare Function SetFilePointer Lib "kernel32" Alias "SetFilePointer" (ByVal hFile As Long, ByVal lDistanceToMove As Long, lpDistanceToMoveHigh As Long, ByVal dwMoveMethod As Long) As Long

    VB.NET
    System.IO.FileStream.Seek

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hFile
    Identifies the file whose file pointer is to be moved. The file handle must have been created with GENERIC_READ or GENERIC_WRITE access to the file.

    · lDistanceToMove
    Specifies the number of bytes to move the file pointer. A positive value moves the pointer forward in the file and a negative value moves it backward.

    · lpDistanceToMoveHigh
    Points to the high-order word of the 64-bit distance to move. If the value of this parameter is NULL, SetFilePointer can operate only on files whose maximum size is 2^32 - 2. If this parameter is specified, the maximum file size is 2^64 - 2. This parameter also receives the high-order word of the new value of the file pointer.

    · dwMoveMethod
    Specifies the starting point for the file pointer move. This parameter can be one of the following values:
    FILE_BEGIN
    The starting point is zero or the beginning of the file. If FILE_BEGIN is specified, DistanceToMove is interpreted as an unsigned location for the new file pointer.
    FILE_CURRENT
    The current value of the file pointer is the starting point.
    FILE_END
    The current end-of-file position is the starting point.

    Return Values
    If the SetFilePointer function succeeds, the return value is the low-order doubleword of the new file pointer, and if lpDistanceToMoveHigh is not NULL, the function puts the high-order doubleword of the new file pointer into the LONG pointed to by that parameter.

    If the function fails and lpDistanceToMoveHigh is NULL, the return value is 0xFFFFFFFF. To get extended error information, call GetLastError.

    If the function fails, and lpDistanceToMoveHigh is non-NULL, the return value is 0xFFFFFFFF and GetLastError will return a value other than NO_ERROR.
    Friday, June 15, 2007 5:03 PM
  • GetDeviceGammaRamp

    The GetDeviceGammaRamp function gets the gamma ramp on direct color display boards whose drivers support downloadable gamma ramps in hardware.

    VB4-32,5,6
    Declare Function GetDeviceGammaRamp Lib "gdi32" (ByVal hdc As Long, lpv As Any) As Long

    Operating Systems Supported
    Requires Windows 2000 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hDC
    Specifies the device context of the direct color display board in question.

    · lpRamp
    Points to a buffer where the function can place the current gamma ramp of the color display board. The gamma ramp is specified in three arrays of 256 WORD elements each, which contain the mapping between RGB values in the frame buffer and digital-analog-converter (DAC) values. The sequence of the arrays is red, green, blue.

    Return Values
    GetDeviceGammaRamp returns TRUE if it succeeds, and FALSE otherwise.
    Friday, June 15, 2007 5:03 PM
  • SetFileAttributes

    The SetFileAttributes function sets a file’s attributes.

    VB4-32,5,6
    Declare Function SetFileAttributes Lib "kernel32" Alias "SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As Long) As Long

    VB.NET
    System.IO.File.SetAttributes

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpFileName
    Points to a string that specifies the name of the file whose attributes are to be set.
    Windows 95: This string must not exceed MAX_PATH characters.
    Windows NT: There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the SetFileAttributes function parses paths. An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of SetFileAttributes and prepending “\\?\” to the path. The “\\?\” tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with SetFileAttributesW. This also works with UNC names. The “\\?\” is ignored as part of the path. For example, “\\?\C:\myworld\private” is seen as “C:\myworld\private”, and “\\?\UNC\wow\hotstuff\coolapps” is seen as “\\wow\hotstuff\coolapps”.

    · dwFileAttributes
    Specifies the file attributes to set for the file. This parameter can be a combination of the following values. However, all other values override FILE_ATTRIBUTE_NORMAL.
    FILE_ATTRIBUTE_ARCHIVE
    The file is an archive file. Applications use this value to mark files for backup or removal.
    FILE_ATTRIBUTE_HIDDEN
    The file is hidden. It is not included in an ordinary directory listing.
    FILE_ATTRIBUTE_NORMAL
    The file has no other attributes set. This value is valid only if used alone.
    FILE_ATTRIBUTE_OFFLINE
    The data of the file is not immediately available. Indicates that the file data has been physically moved to offline storage.
    FILE_ATTRIBUTE_READONLY
    The file is read-only. Applications can read the file but cannot write to it or delete it.
    FILE_ATTRIBUTE_SYSTEM
    The file is part of the operating system or is used exclusively by it.
    FILE_ATTRIBUTE_TEMPORARY
    The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:04 PM
  • SetFileAttributes

    The SetFileAttributes function sets a file’s attributes.

    VB4-32,5,6
    Declare Function SetFileAttributes Lib "kernel32" Alias "SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As Long) As Long

    VB.NET
    System.IO.File.SetAttributes

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpFileName
    Points to a string that specifies the name of the file whose attributes are to be set.
    Windows 95: This string must not exceed MAX_PATH characters.
    Windows NT: There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the SetFileAttributes function parses paths. An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of SetFileAttributes and prepending “\\?\” to the path. The “\\?\” tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with SetFileAttributesW. This also works with UNC names. The “\\?\” is ignored as part of the path. For example, “\\?\C:\myworld\private” is seen as “C:\myworld\private”, and “\\?\UNC\wow\hotstuff\coolapps” is seen as “\\wow\hotstuff\coolapps”.

    · dwFileAttributes
    Specifies the file attributes to set for the file. This parameter can be a combination of the following values. However, all other values override FILE_ATTRIBUTE_NORMAL.
    FILE_ATTRIBUTE_ARCHIVE
    The file is an archive file. Applications use this value to mark files for backup or removal.
    FILE_ATTRIBUTE_HIDDEN
    The file is hidden. It is not included in an ordinary directory listing.
    FILE_ATTRIBUTE_NORMAL
    The file has no other attributes set. This value is valid only if used alone.
    FILE_ATTRIBUTE_OFFLINE
    The data of the file is not immediately available. Indicates that the file data has been physically moved to offline storage.
    FILE_ATTRIBUTE_READONLY
    The file is read-only. Applications can read the file but cannot write to it or delete it.
    FILE_ATTRIBUTE_SYSTEM
    The file is part of the operating system or is used exclusively by it.
    FILE_ATTRIBUTE_TEMPORARY
    The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:04 PM
  • SetDIBitsToDevice

    The SetDIBitsToDevice function sets the pixels in the specified rectangle on the device that is associated with the destination device context using color data from a device-independent bitmap (DIB).

    VB4-32,5,6
    Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BITMAPINFO, ByVal wUsage As Long) As Long

    VB.NET
    System.Drawing.Graphics.DrawImage

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · XDest
    Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.

    · YDest
    Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.

    · dwWidth
    Specifies the width, in logical units, of the DIB.

    · dwHeight
    Specifies the height, in logical units, of the DIB.

    · XSrc
    Specifies the x-coordinate, in logical units, of the lower-left corner of the DIB.

    · YSrc
    Specifies the y-coordinate, in logical units, of the lower-left corner of the DIB.

    · uStartScan
    Specifies the starting scan line in the DIB.

    · cScanLines
    Specifies the number of DIB scan lines contained in the array pointed to by the lpvBits parameter.

    · lpvBits
    Points to DIB color data stored as an array of bytes.

    · lpbmi
    Points to a BITMAPINFO structure that contains information about the DIB.

    · fuColorUse
    Specifies whether the bmiColors member of the BITMAPINFO structure contains explicit red, green, blue (RGB) values or indices into a palette. The fuColorUse parameter must be one of the following values:
    DIB_PAL_COLORS
    The color table consists of an array of 16-bit indices into the currently selected logical palette.
    DIB_RGB_COLORS
    The color table contains literal RGB values.

    Return Values
    If the function succeeds, the return value is the number of scan lines set.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:04 PM
  • GetDIBits

    The GetDIBits function retrieves the bits of the specified bitmap and copies them into a buffer using the specified format.

    VB4-32,5,6
    Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long

    VB.NET
    System.Drawing.Bitmap.LockBits

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · hbmp
    Identifies the bitmap.

    · uStartScan
    Specifies the first scan line to retrieve.

    · cScanLines
    Specifies the number of scan lines to retrieve.

    · lpvBits
    Points to a buffer to receive the bitmap data. If this parameter is NULL, the function passes the dimensions and format of the bitmap to the BITMAPINFO structure pointed to by the lpbi parameter.

    · lpbi
    Points to a BITMAPINFO structure that specifies the desired format for the device-independent bitmap (DIB) data.

    · uUsage
    Specifies the format of the bmiColors member of the BITMAPINFO structure. It must be one of the following values:
    DIB_PAL_COLORS
    The color table should consist of an array of 16-bit indices into the current logical palette.
    DIB_RGB_COLORS
    The color table should consist of literal red, green, blue (RGB) values.

    Return Values
    If the lpvBits parameter is non-NULL and the function succeeds, the return value is the number of scan lines copied from the bitmap.

    Windows 95:

    If the lpvBits parameter is NULL and GetDIBits successfully fills the BITMAPINFO structure, the return value is the total number of scan lines in the bitmap.

    Windows NT:

    If the lpvBits parameter is NULL and GetDIBits successfully fills the BITMAPINFO structure, the return value is non-zero.

    If the function fails, the return value is zero.
    Friday, June 15, 2007 5:04 PM
  • SetCursorPos

    The SetCursorPos function moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen rectangle set by the most recent ClipCursor function, Windows automatically adjusts the coordinates so that the cursor stays within the rectangle.

    VB4-32,5,6
    Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

    VB.NET
    System.Windows.Forms.Cursor.Current.Position

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · X
    Specifies the new x-coordinate, in screen coordinates, of the cursor.

    · Y
    Specifies the new y-coordinate, in screen coordinates, of the cursor.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:05 PM
  • GetDiskFreeSpace

    The GetDiskFreeSpace function retrieves information about the specified disk, including the amount of free space on the disk.

    VB4-32,5,6
    Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpRootPathName
    Points to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory.

    · lpSectorsPerCluster
    Points to a variable for the number of sectors per cluster.

    · lpBytesPerSector
    Points to a variable for the number of bytes per sector.

    · lpNumberOfFreeClusters
    Points to a variable for the total number of free clusters on the disk.

    · lpTotalNumberOfClusters
    Points to a variable for the total number of clusters on the disk.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:05 PM
  • SetEndOfFile

    The SetEndOfFile function moves the end-of-file (EOF) position for the specified file to the current position of the file pointer.

    VB4-32,5,6
    Declare Function SetEndOfFile Lib "kernel32" (ByVal hFile As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hFile
    [in] Handle to the file to have its EOF position moved. The file handle must have been created with GENERIC_WRITE access to the file.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:05 PM
  • GetDiskFreeSpaceEx

    The GetDiskFreeSpaceEx function obtains information about the amount of space available on a disk volume: the total amount of space, the total amount of free space, and the total amount of free space available to the user associated with the calling thread.

    VB4-32,5,6
    Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias "GetDiskFreeSpaceExA" (ByVal lpRootPathName As String, lpFreeBytesAvailableToCaller As Currency, lpTotalNumberOfBytes As Currency, lpTotalNumberOfFreeBytes As Currency) As Long

    Operating Systems Supported
    Windows NT 4.0 or later; Windows 95 OSR2 or later

    Library
    Kernel32

    Parameter Information
    · lpDirectoryName
    Pointer to a null-terminated string that specifies a directory on the disk of interest. This string can be a UNC name.
    If lpDirectoryName is NULL, the GetDiskFreeSpaceEx function obtains information about the disk that contains the currect directory.
    Note that lpDirectoryName does not have to specify the root directory on a disk. The function accepts any directory on the disk.

    · lpFreeBytesAvailableToCaller
    Pointer to a variable to receive the total number of free bytes on the disk that are available to the user associated with the calling thread.
    If the operating system implements per-user quotas, this value may be less than the total number of free bytes on the disk.

    · lpTotalNumberOfBytes
    Pointer to a variable to receive the total number of bytes on the disk.

    · lpTotalNumberOfFreeBytes
    Pointer to a variable to receive the total number of free bytes on the disk.
    This parameter can be NULL.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:05 PM
  • GetDoubleClickTime

    The GetDoubleClickTime function retrieves the current double-click time for the mouse. A double-click is a series of two clicks of the mouse button, the second occurring within a specified time after the first. The double-click time is the maximum number of milliseconds that may occur between the first and second click of a double-click.

    VB4-32,5,6
    Declare Function GetDoubleClickTime Lib "user32" Alias "GetDoubleClickTime" () As Long

    VB.NET
    System.Windows.Forms.SystemInformation.DoubleClickTime

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Return Values
    If the function succeeds, the return value specifies the current double-click time, in milliseconds.
    Friday, June 15, 2007 5:05 PM
  • GetDriveType

    The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.

    VB4-32,5,6
    Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpRootPathName
    Points to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory.

    Return Values
    The return value specifies the type of drive. It can be one of the following values:
    DRIVE_UNKNOWN
    The drive type cannot be determined.

    DRIVE_NO_ROOT_DIR
    The root directory does not exist.

    DRIVE_REMOVABLE
    The disk can be removed from the drive.

    DRIVE_FIXED
    The disk cannot be removed from the drive.

    DRIVE_REMOTE
    The drive is a remote (network) drive.

    DRIVE_CDROM
    The drive is a CD-ROM drive.

    DRIVE_RAMDISK
    The drive is a RAM disk.
    Friday, June 15, 2007 5:05 PM
  • SetCursor

    The SetCursor function establishes the cursor shape.

    VB4-32,5,6
    Declare Function SetCursor Lib "user32" Alias "SetCursor" (ByVal hCursor As Long) As Long

    VB.NET
    System.Windows.Forms.Cursor.Current

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hCursor
    Identifies the cursor. The cursor must have been created by the CreateCursor or loaded by the LoadCursor or LoadImage function. If this parameter is NULL, the cursor is removed from the screen.
    Windows 95: The width and height of the cursor must be the values returned by the GetSystemMetrics function for SM_CXCURSOR and SM_CYCURSOR. In addition, the cursor bit depth must match the bit depth of the display or the cursor must be monochrome.

    Return Values
    The return value is the handle of the previous cursor, if there was one.

    If there was no previous cursor, the return value is NULL.

    Friday, June 15, 2007 5:05 PM
  • GetEnvironmentStrings

    The GetEnvironmentStrings function returns the address of the environment block for the current process. This function replaces the GetDOSEnvironment function.

    VB4-32,5,6
    Declare Function GetEnvironmentStrings Lib "kernel32" Alias "GetEnvironmentStringsA" () As Long

    VB.NET
    System.Environment.GetEnvironmentVariables

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Return Values
    The return value is a pointer to an environment block for the current process.
    Friday, June 15, 2007 5:05 PM
  • GetEnvironmentVariable

    The GetEnvironmentVariable function retrieves the value of the specified variable from the environment block of the calling process. The value is in the form of a null-terminated string of characters.

    VB4-32,5,6
    Declare Function GetEnvironmentVariable Lib "kernel32" Alias "GetEnvironmentVariableA" (ByVal lpName As String, ByVal lpBuffer As String, ByVal nSize As Long) As Long

    VB.NET
    System.Environment.GetEnvironmentVariable

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpName
    [in] Pointer to a null-terminated string that specifies the environment variable.

    · lpBuffer
    [out] Pointer to a buffer to receive the value of the specified environment variable.

    · nSize
    [in] Specifies the size, in TCHARs, of the buffer pointed to by the lpBuffer parameter.

    Return Values
    If the function succeeds, the return value is the number of characters stored into the buffer pointed to by lpBuffer, not including the terminating null character.

    If the specified environment variable name was not found in the environment block for the current process, the return value is zero.

    If the buffer pointed to by lpBuffer is not large enough, the return value is the buffer size, in characters, required to hold the value string and its terminating null character.
    Friday, June 15, 2007 5:06 PM
  • SetCurrentDirectory

    The SetCurrentDirectory function changes the current directory for the current process.

    VB4-32,5,6
    Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long

    VB.NET
    System.Environment.CurrentDirectory

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpPathName
    Points to a null-terminated string that specifies the path to the new current directory. This parameter may be a relative path or a fully qualified path. In either case, the fully qualified path of the specified directory is calculated and stored as the current directory.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:06 PM
  • GetExitCodeProcess

    The GetExitCodeProcess function retrieves the termination status of the specified process.

    VB4-32,5,6
    Declare Function GetExitCodeProcess Lib "kernel32" Alias "GetExitCodeProcess" (ByVal hProcess As Long, lpExitCode As Long) As Long

    VB.NET
    System.Environment.ExitCode

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hProcess
    Identifies the process.
    Windows NT: The handle must have PROCESS_QUERY_INFORMATION access. For more information, see Process Objects.

    · lpExitCode
    Points to a 32-bit variable to receive the process termination status.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:06 PM
  • GetExitCodeThread

    The GetExitCodeThread function retrieves the termination status of the specified thread.

    VB4-32,5,6
    Declare Function GetExitCodeThread Lib "kernel32" Alias "GetExitCodeThread" (ByVal hThread As Long, lpExitCode As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hThread
    Identifies the thread.
    Windows NT: The handle must have THREAD_QUERY_INFORMATION access. For more information, see Thread Objects.

    · lpExitCode
    Points to a 32-bit variable to receive the thread termination status.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:06 PM
  • SetClipboardData

    The SetClipboardData function places data on the clipboard in a specified clipboard format.

    VB4-32,5,6
    Declare Function SetClipboardData Lib "user32" Alias "SetClipboardDataA" (ByVal wFormat As Long, ByVal hMem As Long) As Long

    VB.NET
    System.Windows.Forms.Clipboard

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · uFormat
    Specifies a clipboard format. This parameter can be a registered format or any of the standard clipboard formats listed in the following Remarks section. For information about registered clipboard formats, see the RegisterClipboardFormat function.

    · hMem
    Identifies the data in the specified format. This parameter can be NULL, indicating that the window provides data in the specified clipboard format (renders the format) upon request. If a window delays rendering, it must process the WM_RENDERFORMAT and WM_RENDERALLFORMATS messages.
    Once SetClipboardData is called, the system owns the object identified by the hMem parameter. The application can read the data, but must not free the handle or leave it locked. If the hMem parameter identifies a memory object, the object must have been allocated using the GlobalAlloc function with the GMEM_MOVEABLE and GMEM_DDESHARE flags.

    Return Values
    If the function succeeds, the return value is the handle of the data.

    If the function fails, the return value is NULL. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:06 PM
  • GetExpandedName

    The GetExpandedName function retrieves the original name of a compressed file, if the file was compressed by using the Microsoft File Compression Utility (COMPRESS.EXE) and the /r option was specified.

    VB4-32,5,6
    Declare Function GetExpandedName Lib "lz32.dll" Alias "GetExpandedNameA" (ByVal lpszSource As String, ByVal lpszBuffer As String) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Lz32

    Parameter Information
    · lpszSource
    Points to a string that specifies the name of a compressed file.

    · lpszBuffer
    Points to a buffer that receives the name of the compressed file.

    Return Values
    If the function succeeds, the return value is 1.

    If the function fails, the return value is LZERROR_BADVALUE.

    Note that GetExpandedName calls neither SetLastError nor SetLastErrorEx; thus, its failure does not affect a thread’s last-error code.
    Friday, June 15, 2007 5:06 PM
  • SetPixelV

    The SetPixelV function sets the pixel at the specified coordinates to the closest approximation of the specified color. The point must be in the clipping region and the visible part of the device surface.

    VB4-32,5,6
    Declare Function SetPixelV Lib "gdi32" Alias "SetPixelV" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long

    VB.NET
    System.Drawing.Bitmap.SetPixel

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · X
    Specifies the x-coordinate, in logical units, of the point to be set.

    · Y
    Specifies the y-coordinate, in logical units, of the point to be set.

    · crColor
    Specifies the color to be used to paint the point.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:07 PM
  • SetPixel

    The SetPixel function sets the pixel at the specified coordinates to the specified color.

    VB4-32,5,6
    Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long

    VB.NET
    System.Drawing.Bitmap.SetPixel

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · X
    Specifies the x-coordinate, in logical units, of the point to be set.

    · Y
    Specifies the y-coordinate, in logical units, of the point to be set.

    · crColor
    Specifies the color to be used to paint the point.

    Return Values
    If the function succeeds, the return value is the RGB value that the function sets the pixel to. This value may differ from the color specified by crColor; that happens when an exact match for the specified color cannot be found.

    If the function fails, the return value is -1. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:07 PM
  • SetMenuItemInfo

    The SetMenuItemInfo function changes information about a menu item.

    VB4-32,5,6
    Declare Function SetMenuItemInfo Lib "user32" Alias "SetMenuItemInfoA" (ByVal hMenu As Long, ByVal uItem As Long, ByVal fByPosition As Long, lpmii As MENUITEMINFO) As Long

    VB.NET
    System.Windows.Forms.MenuItem

    Operating Systems Supported
    Requires Windows NT 3.5(1) or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hMenu
    Handle to the menu that contains the menu item.

    · uItem
    Identifier or position of the menu item to change. The meaning of this parameter depends on the value of fByPosition.

    · fByPosition
    Value specifying the meaning of uItem. If this parameter is FALSE, uItem is a menu item identifier. Otherwise, it is a menu item position.

    · lpmii
    Pointer to a MENUITEMINFO structure that contains information about the menu item and specifies which menu item attributes to change.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:07 PM
  • SetRectEmpty

    The SetRectEmpty function creates an empty rectangle in which all coordinates are set to zero.

    VB4-32,5,6
    Declare Function SetRectEmpty Lib "user32" Alias "SetRectEmpty" (lpRect As RECT) As Long

    VB.NET
    System.Drawing.Rectangle.Empty

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · lprc
    Points to the RECT structure that contains the coordinates of the rectangle.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:08 PM
  • SetRect

    The SetRect function sets the coordinates of the specified rectangle. This is equivalent to assigning the left, top, right, and bottom arguments to the appropriate members of the RECT structure.

    VB4-32,5,6
    Declare Function SetRect Lib "user32" Alias "SetRect" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

    VB.NET
    System.Drawing.Rectangle

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · lprc
    Points to the RECT structure that contains the rectangle to be set.

    · xLeft
    Specifies the x-coordinate of the rectangle’s upper-left corner.

    · yTop
    Specifies the y-coordinate of the rectangle’s upper-left corner.

    · xRight
    Specifies the x-coordinate of the rectangle’s lower-right corner.

    · yBottom
    Specifies the y-coordinate of the rectangle’s lower-right corner.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:08 PM
  • GetFileAttributes

    The GetFileAttributes function returns attributes for a specified file or directory.

    VB4-32,5,6
    Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long

    VB.NET
    System.IO.File.GetAttributes

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpFileName
    Points to a null-terminated string that specifies the name of a file or directory.
    Windows NT:
    There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the GetFileAttributes function parses paths. An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of GetFileAttributes and prepending “\\?\” to the path. The “\\?\” tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with GetFileAttributesW. This also works with UNC names. The “\\?\” is ignored as part of the path. For example, “\\?\C:\myworld\private” is seen as “C:\myworld\private”, and “\\?\UNC\bill_g_1\hotstuff\coolapps” is seen as “\\bill_g_1\hotstuff\coolapps”.
    Windows 95:
    The lpFileName string must not exceed MAX_PATH characters. Windows 95 does not support the “\\?\” prefix.

    Return Values
    If the function succeeds, the return value contains the attributes of the specified file or directory.

    If the function fails, the return value is 0xFFFFFFFF. To get extended error information, call GetLastError.

    The attributes can be one or more of the following values:
    FILE_ATTRIBUTE_ARCHIVE
    The file or directory is an archive file or directory. Applications use this flag to mark files for backup or removal.

    FILE_ATTRIBUTE_COMPRESSED
    The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories.

    FILE_ATTRIBUTE_DIRECTORY
    The “file or directory” is a directory.

    FILE_ATTRIBUTE_HIDDEN
    The file or directory is hidden. It is not included in an ordinary directory listing.

    FILE_ATTRIBUTE_NORMAL
    The file or directory has no other attributes set. This attribute is valid only if used alone.

    FILE_ATTRIBUTE_OFFLINE
    The data of the file is not immediately available. Indicates that the file data has been physically moved to offline storage.

    FILE_ATTRIBUTE_READONLY
    The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it.

    FILE_ATTRIBUTE_SYSTEM
    The file or directory is part of, or is used exclusively by, the operating system.

    FILE_ATTRIBUTE_TEMPORARY
    The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.
    Friday, June 15, 2007 5:08 PM
  • GetFileInformationByHandle

    The GetFileInformationByHandle function retrieves information about a specified file.

    VB4-32,5,6
    Declare Function GetFileInformationByHandle Lib "kernel32" (ByVal hFile As Long, lpFileInformation As BY_HANDLE_FILE_INFORMATION) As Long

    VB.NET
    System.IO.FileInfo

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hFile
    Handle to the file that you want to obtain information about.
    This handle should not be a pipe handle. The GetFileInformationByHandle function does not work with pipe handles.

    · lpFileInformation
    Points to a BY_HANDLE_FILE_INFORMATION structure that receives the file information. The structure can be used in subsequent calls to GetFileInformationByHandle to refer to the information about the file.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:09 PM
  • SetPriorityClass

    The SetPriorityClass function sets the priority class for the specified process. This value together with the priority value of each thread of the process determines each thread’s base priority level.

    VB4-32,5,6
    Declare Function SetPriorityClass Lib "kernel32" Alias "SetPriorityClass" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long

    VB.NET
    System.Diagnostics.Process.PriorityClass

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hProcess
    Identifies the process.
    Windows NT: The handle must have the PROCESS_SET_INFORMATION access right. For more information, see Process Objects.

    · dwPriorityClass
    Specifies the priority class for the process. Specify one of the following values:
    HIGH_PRIORITY_CLASS
    Specify this class for a process that performs time-critical tasks that must be executed immediately. The threads of the process preempt the threads of normal or idle priority class processes. An example is Windows Task List, which must respond quickly when called by the user, regardless of the load on the operating system. Use extreme care when using the high-priority class, because a high-priority class application can use nearly all available CPU time.
    IDLE_PRIORITY_CLASS
    Specify this class for a process whose threads run only when the system is idle. The threads of the process are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle-priority class is inherited by child processes.
    NORMAL_PRIORITY_CLASS
    Specify this class for a process with no special scheduling needs.
    REALTIME_PRIORITY_CLASS
    Specify this class for a process that has the highest possible priority. The threads of the process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:09 PM
  • GetFileNameFromBrowse

    GetFileNameFromBrowse is nothing more than a simplified wrapper around the GetOpenFile-Name function.

    VB4-32,5,6
    Declare Function GetFileNameFromBrowse Lib "shell32" Alias "#63" (ByVal hwndOwner As Long, ByVal lpstrFile As String, ByVal nMaxFile As Long, ByVal lpstrInitialDir As String, ByVal lpstrDefExt As String, ByVal lpstrFilter As String, ByVal lpstrTitle As String) As Long

    Operating Systems Supported
    Undocumented

    Library
    Shell32

    Parameter Information
    · hwndOwner
    identifies the window that owns the dialog box.

    · lpstrFile
    points to a buffer that contains a filename used to initialize the edit control. When the function returns, this buffer contains the full path of the selected file.

    · nMaxFile
    specifies the size, in characters, of the buffer pointed to by lpstrFile.

    · lpstrInitialDir
    points to a string that specifies the initial file directory. If lpstrFile contains an initial filename, the lpstrInitialDir is ignored and the path from the filename is used instead.

    · lpstrDefExt
    points to a buffer that contains the default extension.

    · lpstrFilter points to a buffer containing pairs of null-terminated filter strings.

    · lpstrTitle
    points to a string to be placed in the title bar of the dialog box.
    Friday, June 15, 2007 5:09 PM
  • GetFileSecurity

    The GetFileSecurity function obtains specified information about the security of a file or directory. The information obtained is constrained by the caller's access rights and privileges.

    VB4-32,5,6
    Declare Function GetFileSecurity Lib "advapi32.dll" Alias "GetFileSecurityA" (ByVal lpFileName As String, ByVal RequestedInformation As Long, pSecurityDescriptor As Byte, ByVal nLength As Long, lpnLengthNeeded As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Win9x/ME: Not supported

    Library
    Advapi32

    Parameter Information
    · lpFileName
    [in] Pointer to a null-terminated string specifying the file or directory for which security information is retrieved.

    · RequestedInformation
    [in] Specifies a SECURITY_INFORMATION value that identifies the security information being requested.

    · pSecurityDescriptor
    [out] Pointer to a buffer that receives a copy of the security descriptor of the object specified by the lpFileName parameter. The calling process must have the right to view the specified aspects of the object's security status. The SECURITY_DESCRIPTOR structure is returned in self-relative format.

    · nLength
    [in] Specifies the size, in bytes, of the buffer pointed to by the pSecurityDescriptor parameter.

    · lpnLengthNeeded
    [out] Pointer to a variable the function sets to zero if the file descriptor is copied successfully. If the buffer is too small for the security descriptor, this variable receives the number of bytes required. If this variable's value is greater than that of the nLength parameter when the function returns, none of the security descriptor is copied to the buffer.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:09 PM
  • setsockopt

    The Windows Sockets setsockopt function sets a socket option.

    VB4-32,5,6
    Declare Function setsockopt Lib "wsock32.dll" (ByVal s As Long, ByVal Level As Long, ByVal optname As Long, optval As Any, ByVal optlen As Long) As Long

    VB.NET
    System.Net.Sockets.Socket.SetSocketOption

    Operating Systems Supported
    Requires Windows Sockets 2.0

    Library
    Wsock32.dll

    Parameter Information
    · s
    [in] A descriptor identifying a socket.

    · level
    [in] The level at which the option is defined; the supported levels include SOL_SOCKET and IPPROTO_TCP. See Protocol-specific Annex (a separate document included with the Win32 SDK) for more information on protocol-specific levels.

    · optname
    [in] The socket option for which the value is to be set.

    · optval
    [in] A pointer to the buffer in which the value for the requested option is supplied.

    · optlen
    [in] The size of the optval buffer.

    Return Values
    If no error occurs, setsockopt returns zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.

    Friday, June 15, 2007 5:09 PM
  • GetFileSize

    The GetFileSize function retrieves the size, in bytes, of the specified file.

    VB4-32,5,6
    Declare Function GetFileSize Lib "kernel32" Alias "GetFileSize" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long

    VB.NET
    System.IO.FileInfo.Length

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hFile
    Specifies an open handle of the file whose size is being returned. The handle must have been created with either GENERIC_READ or GENERIC_WRITE access to the file.

    · lpFileSizeHigh
    Points to the variable where the high-order word of the file size is returned. This parameter can be NULL if the application does not require the high-order word.

    Return Values
    If the function succeeds, the return value is the low-order doubleword of the file size, and, if lpFileSizeHigh is non-NULL, the function puts the high-order doubleword of the file size into the variable pointed to by that parameter.

    If the function fails and lpFileSizeHigh is NULL, the return value is 0xFFFFFFFF. To get extended error information, call GetLastError.

    If the function fails and lpFileSizeHigh is non-NULL, the return value is 0xFFFFFFFF and GetLastError will return a value other than NO_ERROR.
    Friday, June 15, 2007 5:09 PM
  • GetFileSizeEx

    The GetFileSizeEx function retrieves the size, in bytes, of a specified file.

    VB4-32,5,6
    Declare Function GetFileSizeEx Lib "kernel32" (ByVal hFile As Long, lpFileSize As Currency) As Boolean

    VB.NET
    System.IO.FileInfo.Length

    Operating Systems Supported
    Requires Windows 2000 or later; Win9x/ME: Not supported

    Library
    Kernel32

    Parameter Information
    · hFile
    [in] Handle to the file whose size is to be returned. The handle must have been created with either GENERIC_READ or GENERIC_WRITE access to the file.

    · lpFileSize
    [out] Pointer to a LARGE_INTEGER structure that receives the file size.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:09 PM
  • SetTimer

    The SetTimer function creates a timer with the specified time-out value.

    VB4-32,5,6
    Declare Function SetTimer Lib "user32" Alias "SetTimer" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long

    VB.NET
    System.Threading.Timer

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hWnd
    Identifies the window to be associated with the timer. This window must be owned by the calling thread. If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored.

    · nIDEvent
    Specifies a nonzero timer identifier. If the hWnd parameter is NULL, this parameter is ignored.

    · uElapse
    Specifies the time-out value, in milliseconds.

    · lpTimerFunc
    Points to the function to be notified when the time-out value elapses. For more information about the function, see TimerProc.
    If lpTimerFunc is NULL, the system posts a WM_TIMER message to the application queue. The hwnd member of the message’s MSG structure contains the value of the hWnd parameter.

    Return Values
    If the function succeeds, the return value is an integer identifying the new timer. An application can pass this value, or the string identifier, if it exists, to the KillTimer function to destroy the timer. If the function fails to create a timer, the return value is zero.

    Friday, June 15, 2007 5:09 PM
  • GetFileTime

    The GetFileTime function retrieves the date and time that a file was created, last accessed, and last modified.

    VB4-32,5,6
    Declare Function GetFileTime Lib "kernel32" Alias "GetFileTime" (ByVal hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime As FILETIME) As Long

    VB.NET
    System.IO.File.GetCreationTime

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hFile
    Identifies the files for which to get dates and times. The file handle must have been created with GENERIC_READ access to the file.

    · lpCreationTime
    Points to a FILETIME structure to receive the date and time the file was created. This parameter can be NULL if the application does not require this information.

    · lpLastAccessTime
    Points to a FILETIME structure to receive the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or, in the case of executable files, run. This parameter can be NULL if the application does not require this information.

    · lpLastWriteTime
    Points to a FILETIME structure to receive the date and time the file was last written to. This parameter can be NULL if the application does not require this information.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:09 PM
  • GetFileTitle

    The GetFileTitle function returns the name of the file identified by the lpszFile parameter.

    VB4-32,5,6
    Declare Function GetFileTitle Lib "comdlg32.dll" Alias "GetFileTitleA" (ByVal lpszFile As String, ByVal lpszTitle As String, ByVal cbBuf As Integer) As Integer

    VB.NET
    System.IO.FileInfo.Name

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Comdlg32

    Parameter Information
    · lpszFile
    Pointer to the name and location of a file.

    · lpszTitle
    Pointer to a buffer into which the function is to copy the name of the file.

    · cbBuf
    Specifies the length, in characters, of the buffer pointed to by the lpszTitle parameter.

    Return Values
    If the function succeeds, the return value is zero.

    If the filename is invalid, the return value is a negative number.

    If the buffer pointed to by the lpszTitle parameter is too small, the return value is a positive integer that specifies the required buffer size, in bytes (ANSI version) or characters (Unicode version). The required buffer size includes the terminating null character.
    Friday, June 15, 2007 5:10 PM
  • SetThreadPriority

    The SetThreadPriority function sets the priority value for the specified thread. This value, together with the priority class of the thread’s process, determines the thread’s base priority level.

    VB4-32,5,6
    Declare Function SetThreadPriority Lib "kernel32" Alias "SetThreadPriority" (ByVal hThread As Long, ByVal nPriority As Long) As Long

    VB.NET
    System.Threading.Thread.Priority

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hThread
    Identifies the thread whose priority value is to be set.
    Windows NT: The handle must have the THREAD_SET_INFORMATION access right associated with it. For more information, see Thread Objects.

    · nPriority
    Specifies the priority value for the thread. This parameter can be one of the following values:
    THREAD_PRIORITY_ABOVE_NORMAL
    Indicates 1 point above normal priority for the priority class.
    THREAD_PRIORITY_BELOW_NORMAL
    Indicates 1 point below normal priority for the priority class.
    THREAD_PRIORITY_HIGHEST
    Indicates 2 points above normal priority for the priority class.
    THREAD_PRIORITY_IDLE
    Indicates a base priority level of 1 for IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a base priority level of 16 for REALTIME_PRIORITY_CLASS processes.
    THREAD_PRIORITY_LOWEST
    Indicates 2 points below normal priority for the priority class.
    THREAD_PRIORITY_NORMAL
    Indicates normal priority for the priority class.
    THREAD_PRIORITY_TIME_CRITICAL
    Indicates a base priority level of 15 for IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a base priority level of 31 for REALTIME_PRIORITY_CLASS processes.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:10 PM
  • GetFileType

    The GetFileType function returns the type of the specified file.

    VB4-32,5,6
    Declare Function GetFileType Lib "kernel32" Alias "GetFileType" (ByVal hFile As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · hFile
    Identifies an open file handle.

    Return Values
    The return value is one of the following values:
    FILE_TYPE_UNKNOWN
    The type of the specified file is unknown.

    FILE_TYPE_DISK
    The specified file is a disk file.

    FILE_TYPE_CHAR
    The specified file is a character file, typically an LPT device or a console.

    FILE_TYPE_PIPE
    The specified file is either a named or anonymous pipe.
    Friday, June 15, 2007 5:10 PM
  • GetFileVersionInfo

    The GetFileVersionInfo function returns version information about a specified file.

    VB4-32,5,6
    Declare Function GetFileVersionInfo Lib "version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwHandle As Long, ByVal dwLen As Long, lpData As Any) As Long

    VB.NET
    System.Diagnostics.FileVersionInfo

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Version

    Parameter Information
    · lptstrFilename
    Pointer to a null-terminated filename string that specifies the file of interest.

    · dwHandle
    This parameter is ignored.

    · dwLen
    Specifies the size, in bytes, of the buffer pointed to by lpData.
    Call the GetFileVersionInfoSize function to determine the size in bytes of a file’s version information. dwLen should be equal to or greater than that value.
    If the buffer pointed to by lpData is not large enough, the function truncates the file’s-version information to the size of the buffer.

    · lpData
    Pointer to a buffer to receive file-version information.
    You can use this value in a subsequent call to the VerQueryValue function.
    The file version information is always in Unicode format.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:10 PM
  • GetFileVersionInfoSize

    The GetFileVersionInfoSize function determines whether the operating system can obtain version information about a specified file. If version information is available, GetFileVersionInfoSize returns the size in bytes of that information.

    VB4-32,5,6
    Declare Function GetFileVersionInfoSize Lib "version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long

    VB.NET
    System.Diagnostics.FileVersionInfo

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Version

    Parameter Information
    · lptstrFilename
    Pointer to a null-terminated filename string that specifies the file of interest.

    · lpdwHandle
    Pointer to a variable that the function sets to zero.

    Return Values
    If the function succeeds, the return value is the size in bytes of the file’s version information.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:10 PM
  • GetFocus

    The GetFocus function retrieves the handle of the window that has the keyboard focus, if the window is associated with the calling thread’s message queue.

    VB4-32,5,6
    Declare Function GetFocus Lib "user32" Alias "GetFocus" () As Long

    VB.NET
    System.Windows.Forms.Form.ActiveForm

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Return Values
    If the function succeeds, the return value is the handle of the window with the keyboard focus. If the calling thread’s message queue does not have an associated window with the keyboard focus, the return value is NULL.
    Friday, June 15, 2007 5:10 PM
  • SetWindowText

    The SetWindowText function changes the text of the specified window’s title bar (if it has one). If the specified window is a control, the text of the control is changed.

    VB4-32,5,6
    Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

    VB.NET
    System.Windows.Forms.Form.Text

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hWnd
    Identifies the window or control whose text is to be changed.

    · lpString
    Points to a null-terminated string to be used as the new title or control text.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:10 PM
  • SetWindowRgn

    The SetWindowRgn function sets the window region of a window. The window region determines the area within the window where the operating system permits drawing. The operating system does not display any portion of a window that lies outside of the window region.

    VB4-32,5,6
    Declare Function SetWindowRgn Lib "user32" Alias "SetWindowRgn" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

    VB.NET
    System.Windows.Forms.Region

    Operating Systems Supported
    Requires Windows NT 3.5(1) or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hWnd
    Handle to the window whose window region is to be set.

    · hRgn
    Handle to a region. The function sets the window region of the window to this region.
    If hRgn is NULL, the function sets the window region to NULL.

    · bRedraw
    Boolean value that specifies whether the operating system redraws the window after setting the window region. If bRedraw is TRUE, the operating system does so; otherwise, it does not.
    Typically, you set bRedraw to TRUE if the window is visible.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError
    Friday, June 15, 2007 5:10 PM
  • GetForegroundWindow

    The GetForegroundWindow function returns the handle of the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.

    VB4-32,5,6
    Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long

    VB.NET
    System.Windows.Forms.Form.ActiveForm

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Return Values
    The return value is the handle of the foreground window.
    Friday, June 15, 2007 5:10 PM
  • GetFreeResources

    The GetFreeResources function retrieves information about the free system resources.

    VB4-32,5,6
    Declare Function GetFreeResources Lib "RSRC32" Alias "_MyGetFreeSystemResources32@4" (ByVal lWhat As Long) As Long

    Operating Systems Supported
    Requires RSRC32.DLL

    Library
    Rsrc32

    Parameter Information
    · lWhat
    specifies what information to return

    Return Values
    Returns the free resources.
    Friday, June 15, 2007 5:11 PM
  • SetWindowPos

    The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.

    VB4-32,5,6
    Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

    VB.NET
    System.Windows.Forms.Form.TopMost; System.Windows.Forms.Form.Size; System.Windows.Forms.Form.DesktopLocation; System.Windows.Forms.Form.WindowState

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hWnd
    Identifies the window.

    · hWndInsertAfter
    Identifies the window to precede the positioned window in the Z order. This parameter must be a window handle or one of the following values:
    HWND_BOTTOM
    Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows.
    HWND_NOTOPMOST
    Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.
    HWND_TOP
    Places the window at the top of the Z order.
    HWND_TOPMOST
    Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.

    · X
    Specifies the new position of the left side of the window.

    · Y
    Specifies the new position of the top of the window.

    · cx
    Specifies the new width of the window, in pixels.

    · cy
    Specifies the new height of the window, in pixels.

    · uFlags
    Specifies the window sizing and positioning flags. This parameter can be a combination of the following values:
    SWP_DRAWFRAME
    Draws a frame (defined in the window’s class description) around the window.
    SWP_FRAMECHANGED
    Sends a WM_NCCALCSIZE message to the window, even if the window’s size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window’s size is being changed.
    SWP_HIDEWINDOW
    Hides the window.
    SWP_NOACTIVATE
    Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
    SWP_NOCOPYBITS
    Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
    SWP_NOMOVE
    Retains the current position (ignores the X and Y parameters).
    SWP_NOOWNERZORDER
    Does not change the owner window’s position in the Z order.
    SWP_NOREDRAW
    Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
    SWP_NOREPOSITION
    Same as the SWP_NOOWNERZORDER flag.
    SWP_NOSENDCHANGING
    Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
    SWP_NOSIZE
    Retains the current size (ignores the cx and cy parameters).
    SWP_NOZORDER
    Retains the current Z order (ignores the hWndInsertAfter parameter).
    SWP_SHOWWINDOW
    Displays the window.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:11 PM
  • SetWindowPlacement

    The SetWindowPlacement function sets the show state and the restored, minimized, and maximized positions of the specified window.

    VB4-32,5,6
    Declare Function SetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long

    VB.NET
    System.Windows.Forms.Form.Size;System.Windows.Forms.Form.DesktopLocation;System.Windows.Forms.Form.WindowState

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Parameter Information
    · hWnd
    [in] Handle to the window.

    · lpwndpl
    [in] Pointer to a WINDOWPLACEMENT structure that specifies the new show state and window positions.
    Before calling SetWindowPlacement, set the length member of the WINDOWPLACEMENT structure to sizeof(WINDOWPLACEMENT). SetWindowPlacement fails if lpwndpl->length is not set correctly.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:11 PM
  • GetFullPathName

    The GetFullPathName function retrieves the full path and filename of a specified file.

    VB4-32,5,6
    Declare Function GetFullPathName Lib "kernel32" Alias "GetFullPathNameA" (ByVal lpFileName As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Kernel32

    Parameter Information
    · lpFileName
    Points to a null-terminated string that specifies a valid filename. This string can use either short (the 8.3 form) or long filenames.

    · nBufferLength
    Specifies the size, in characters, of the buffer for the drive and path.

    · lpBuffer
    Points to a buffer that contains the null-terminated string for the name of the drive and path.

    · lpFilePart
    Points to a variable that receives the address (in lpBuffer) of the final filename component in the path. This filename component is the long filename, if any, rather than the 8.3 form of the filename.

    Return Values
    If the GetFullPathName function succeeds, the return value is the length, in characters, of the string copied to lpBuffer, not including the terminating null character.

    If the lpBuffer buffer is too small, the return value is the size of the buffer, in characters, required to hold the path.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:11 PM
  • GetGuiResources

    The GetGuiResources function retrieves the count of handles to graphical user interface (GUI) objects in use by the specified process.

    VB4-32,5,6
    Declare Function GetGuiResources Lib "user32.dll" (ByVal hProcess As Long, ByVal uiFlags As Long) As Long

    Operating Systems Supported
    Requires Windows 2000 or later; Win9x/ME: Not supported

    Library
    User32

    Parameter Information
    · hProcess
    [in] Handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right. For more information, see Process Security and Access Rights.

    · uiFlags
    [in] Specifies the GUI object type. This parameter can be one of the following values.
    GR_GDIOBJECTS
    Return the count of GDI objects.
    GR_USEROBJECTS
    Return the count of USER objects.

    Return Values
    If the function succeeds, the return value is the count of handles to GUI objects in use by the process. If no GUI objects are in use, the return value is zero.
    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:11 PM
  • GetGUIThreadInfo

    The GetGUIThreadInfo function retrieves information about the active window or a specified graphical user interface (GUI) thread.

    VB4-32,5,6
    Declare Function GetGUIThreadInfo Lib "user32" (ByVal dwthreadid As Long, lpguithreadinfo As GUITHREADINFO) As Long

    Operating Systems Supported
    Included in Windows NT 4.0 SP3 and later; Included in Windows 98 and later

    Library
    User32

    Parameter Information
    · idThread
    [in] Identifies the thread for which information is to be retrieved. To retrieve this value, use the GetWindowThreadProcessId function. If this parameter is NULL, the function returns information for the foreground thread.

    · lpgui
    [out] Pointer to a GUITHREADINFO structure that receives information describing the thread.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Friday, June 15, 2007 5:11 PM
  • gethostbyaddr

    This function retrieves the host data corresponding to a network address.

    VB4-32,5,6
    Declare Function gethostbyaddr Lib "wsock32.dll" (haddr As Long, ByVal hnlen As Long, ByVal addrtype As Long) As Long

    VB.NET
    System.Net.Dns.GetHostByAddress

    Operating Systems Supported
    Requires Windows Sockets 1.1 or later

    Library
    Wsock32

    Parameter Information
    · addr
    [in] Pointer to an address in network byte order.

    · len
    [in] Address length.

    · type
    [in] Address type.

    Return Values
    A pointer to the HOSTENT structure indicates no error occurred. A NULL pointer indicates failure. To get a specific error value, call the WSAGetLastError function.
    Friday, June 15, 2007 5:11 PM
  • Shell_NotifyIcon

    Sends a message to the system to add, modify, or delete an icon from the taskbar status area.

    VB4-32,5,6
    Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long

    VB.NET
    System.Windows.Forms.NotifyIcon

    Operating Systems Supported
    Requires Windows NT 4.0 or later; Requires Windows 95 or later

    Library
    Shell32

    Parameter Information
    · dwMessage
    Identifier of the message to send. This parameter can be one of these values:
    NIM_ADD
    Adds an icon to the status area.
    NIM_DELETE
    Deletes an icon from the status area.
    NIM_MODIFY
    Modifies an icon in the status area.

    · pnid
    Pointer to a NOTIFYICONDATA structure. The content of the structure depends on the value of dwMessage.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:11 PM
  • gethostbyname

    The Windows Sockets gethostbyname function retrieves host information corresponding to a host name from a host database.

    VB4-32,5,6
    Declare Function gethostbyname Lib "WSOCK32" (ByVal szHost As String) As Long

    VB.NET
    System.Net.Dns.GetHostByName

    Operating Systems Supported
    Requires Windows Sockets 1.1 or later

    Library
    Wsock32

    Parameter Information
    · name
    [out] A pointer to the null-terminated name of the host to resolve.

    Return Values
    If no error occurs, gethostbyname returns a pointer to the HOSTENT structure described above. Otherwise, it returns a NULL pointer and a specific error number can be retrieved by calling WSAGetLastError.
    Friday, June 15, 2007 5:12 PM
  • ShellExecuteEx

    The ShellExecuteEx function performs an action on a file. The file can be an executable file or a document.

    VB4-32,5,6
    Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long

    VB.NET
    System.Diagnostics.Process

    Operating Systems Supported
    Requires Windows NT 4.0 or later; Requires Windows 95 or later

    Library
    Shell32

    Parameter Information
    · lpExecInfo
    Pointer to a SHELLEXECUTEINFO structure that contains and receives information about the application to start.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    Friday, June 15, 2007 5:12 PM
  • gethostname

    The Windows Sockets gethostname function returns the standard host name for the local machine.

    VB4-32,5,6
    Declare Function gethostname Lib "WSOCK32" (ByVal szHost As String, ByVal dwHostLen As Long) As Long

    VB.NET
    System.Net.Dns.GetHostName

    Operating Systems Supported
    Requires Windows Sockets 1.1 or later

    Library
    Wsock32

    Parameter Information
    · name
    [out] A pointer to a buffer that receives the local host name.

    · namelen
    [in] The length of the buffer.

    Return Values
    If no error occurs, gethostname returns zero. Otherwise, it returns SOCKET_ERROR and a specific error code can be retrieved by calling WSAGetLastError.
    Friday, June 15, 2007 5:12 PM
  • ShellExecute

    The ShellExecute function opens or prints a specified file. The file can be an executable file or a document file.

    VB4-32,5,6
    Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    VB.NET
    System.Diagnostics.Process

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    Shell32

    Parameter Information
    · hwnd
    Specifies a parent window. This window receives any message boxes that an application produces. For example, an application may report an error by producing a message box.

    · lpOperation
    Pointer to a null-terminated string that specifies the operation to perform. The following operation strings are valid:
    “open”
    The function opens the file specified by lpFile. The file can be an executable file or a document file. The file can be a folder to open.
    “print”
    The function prints the file specified by lpFile. The file should be a document file. If the file is an executable file, the function opens the file, as if “open” had been specified.
    “explore”
    The function explores the folder specified by lpFile.

    The lpOperation parameter can be NULL. In that case, the function opens the file specified by lpFile.

    · lpFile
    Pointer to a null-terminated string that specifies the file to open or print or the folder to open or explore. The function can open an executable file or a document file. The function can print a document file.

    · lpParameters
    If lpFile specifies an executable file, lpParameters is a pointer to a null-terminated string that specifies parameters to be passed to the application.
    If lpFile specifies a document file, lpParameters should be NULL.

    · lpDirectory
    Pointer to a null-terminated string that specifies the default directory.

    · nShowCmd
    If lpFile specifies an executable file, nShowCmd specifies how the application is to be shown when it is opened. This parameter can be one of the following values:
    SW_HIDE
    Hides the window and activates another window.
    SW_MAXIMIZE
    Maximizes the specified window.
    SW_MINIMIZE
    Minimizes the specified window and activates the next top-level window in the Z order.
    SW_RESTORE
    Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.
    SW_SHOW
    Activates the window and displays it in its current size and position.
    SW_SHOWDEFAULT
    Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. An application should call ShowWindow with this flag to set the initial show state of its main window.
    SW_SHOWMAXIMIZED
    Activates the window and displays it as a maximized window.
    SW_SHOWMINIMIZED
    Activates the window and displays it as a minimized window.
    SW_SHOWMINNOACTIVE
    Displays the window as a minimized window. The active window remains active.
    SW_SHOWNA
    Displays the window in its current state. The active window remains active.
    SW_SHOWNOACTIVATE
    Displays a window in its most recent size and position. The active window remains active.
    SW_SHOWNORMAL
    Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

    If lpFile specifies a document file, nShowCmd should be zero.

    Return Values
    If the function succeeds, the return value is the instance handle of the application that was run, or the handle of a dynamic data exchange (DDE) server application.

    If the function fails, the return value is an error value that is less than or equal to 32. The following table lists these error values:
    0
    The operating system is out of memory or resources.

    ERROR_FILE_NOT_FOUND
    The specified file was not found.

    ERROR_PATH_NOT_FOUND
    The specified path was not found.

    ERROR_BAD_FORMAT
    The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).

    SE_ERR_ACCESSDENIED
    The operating system denied access to the specified file.

    SE_ERR_ASSOCINCOMPLETE
    The filename association is incomplete or invalid.

    SE_ERR_DDEBUSY
    The DDE transaction could not be completed because other DDE transactions were being processed.

    SE_ERR_DDEFAIL
    The DDE transaction failed.

    SE_ERR_DDETIMEOUT
    The DDE transaction could not be completed because the request timed out.

    SE_ERR_DLLNOTFOUND
    The specified dynamic-link library was not found.

    SE_ERR_FNF
    The specified file was not found.

    SE_ERR_NOASSOC
    There is no application associated with the given filename extension.

    SE_ERR_OOM
    There was not enough memory to complete the operation.

    SE_ERR_PNF
    The specified path was not found.

    SE_ERR_SHARE
    A sharing violation occurred.
    Friday, June 15, 2007 5:12 PM
  • GetIcmpStatistics

    The GetIcmpStatistics function retrieves the Internet Control Message Protocol (ICMP) statistics for the local computer.

    VB4-32,5,6
    Declare Function GetIcmpStatistics Lib "iphlpapi" (pStats As MIBICMPINFO) As Long

    Operating Systems Supported
    Requires Windows NT 4.0 or later; Requires Windows 98 or later

    Library
    Iphlpapi

    Parameter Information
    · pStats
    [out] Pointer to a MIB_ICMP structure that receives the ICMP statistics for the local computer.

    Return Values
    If the function succeeds, the return value is NO_ERROR.

    If the function fails, use FormatMessage to obtain the message string for the returned error
    Friday, June 15, 2007 5:12 PM
  • SHCreateThread

    Creates a thread.

    VB4-32,5,6
    Declare Function SHCreateThread Lib "shlwapi.dll" (ByVal pfnThreadProc As Long, pData As Any, ByVal dwFlags As Long, ByVal pfnCallback As Long) As Long

    VB.NET
    System.Threading.Thread

    Operating Systems Supported
    Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 5.0 or later); Requires Windows 98 (or Windows 95 with Internet Explorer 5.0 or later)

    Library
    Shlwapi

    Parameter Information
    · pfnThreadProc
    Pointer to an application-defined function of the LPTHREAD_START_ROUTINE type. If a new thread was successfully created, this function will be called in the context of that thread. SHCreateThread does not wait for this function to complete before returning to its caller. The return value of this function will be the exit code of the thread.

    · pData
    Pointer to an application-defined data structure containing initialization data. It is passed to the function pointed to by pfnThreadProc and, optionally, pfnCallback.

    · dwFlags
    Flags that control the behavior of the function. This parameter can be a combination of the following flags.
    CTF_COINIT
    Initialize COM for the created thread before calling either the optional function pointed to by pfnCallback or the function pointed to by pfnThreadProc. This flag is useful when COM needs to be initialized for a thread. COM will automatically be uninitialized as well.
    CTF_INSIST
    If the attempt to create the thread with CreateThread fails, setting this flag will cause the function pointed to by pfnThreadProc to be called synchronously from the calling thread. This flag cannot be used if pfnCallback has a non-NULL value.
    CTF_PROCESS_REF
    Hold a reference to the Windows® Explorer process for the duration of the call to the function pointed to by pfnThreadProc. This flag is useful for shell extension handlers, which might need to keep the Windows Explorer process from closing prematurely. Examples of where this action would be useful include tasks such as doing work on a background thread or copying files. For further information, see SHGetInstanceExplorer.
    CTF_THREAD_REF
    Hold a reference to the creating thread for the duration of the call to the function pointed to by pfnThreadProc. This reference must have been set with SHSetThreadRef.

    · pfnCallback
    Pointer to an optional application-defined function of the LPTHREAD_START_ROUTINE type. This function is called in the context of the created thread before the function pointed to by pfnThreadProc is called. It will also receive pData as its argument. SHCreateThread will wait for the function pointed to by pfnCallback to return before returning to its caller. The return value of the function pointed to by pfnCallback is ignored.

    Return Values
    Returns TRUE if the thread is successfully created, or FALSE otherwise.
    Friday, June 15, 2007 5:12 PM
  • GetInputState

    The GetInputState function determines whether there are mouse-button or keyboard messages in the calling thread's message queue.

    VB4-32,5,6
    Declare Function GetInputState Lib "user32" () As Long

    Operating Systems Supported
    Requires Windows NT 3.1 or later; Requires Windows 95 or later

    Library
    User32

    Return Values
    If the queue contains one or more new mouse-button or keyboard messages, the return value is nonzero.

    If the there are no new mouse-button or keyboard messages in the queue, the return value is zero.
    Friday, June 15, 2007 5:12 PM
  • GetIpAddrTable

    The GetIpAddrTable function retrieves the interface-to-IP address mapping table.

    VB4-32,5,6
    Declare Function GetIpAddrTable Lib "IPHlpApi" (pIPAdrTable As Byte, pdwSize As Long, ByVal Sort As Long) As Long

    Operating Systems Supported
    Requires Windows NT 4.0 SP4 or later; Requires Windows 98 or later

    Library
    Iphlpapi

    Parameter Information
    · pIpAddrTable
    [out] Pointer to a buffer that receives the interface–to–IP address mapping table as a structure.

    · pdwSize
    [in, out] On input, specifies the size of the buffer pointed to by the pIpAddrTable parameter.
    On output, if the buffer is not large enough to hold the returned mapping table, the function sets this parameter equal to the required buffer size.

    · bOrder
    [in] Specifies whether the returned mapping table should be sorted in ascending order by IP address. If this parameter is TRUE, the table is sorted.

    Return Values
    If the function succeeds, the return value is NO_ERROR.

    If the function fails, use to obtain the message string for the returned error.
    Friday, June 15, 2007 5:13 PM
  • GetIpNetTable

    The GetIpNetTable function retrieves the IP-to-physical address mapping table.

    VB4-32,5,6
    Declare Function GetIpNetTable Lib "Iphlpapi" (pIpNetTable As Byte, pdwSize As Long, ByVal bOrder As Long) As Long

    Operating Systems Supported
    Windows NT 4.0 SP4 or later; Windows 98 or later

    Library
    Iphlpapi

    Parameter Information
    · pIpNetTable
    [out] Pointer to a buffer that receives the IP-to-physical address mapping table as a MIB_IPNETTABLE structure.

    · pdwSize
    [in, out] On input, specifies the size of the buffer pointed to by the pIpNetTable parameter.
    On output, if the buffer is not large enough to hold the returned mapping table, the function sets this parameter equal to the required buffer size.

    · bOrder
    [in] Specifies whether the returned mapping table should be sorted in ascending order by IP address. If this parameter is TRUE, the table is sorted.

    Return Values
    If the function succeeds, the return value is NO_ERROR.

    If the function fails, use FormatMessage to obtain the message string for the returned error.
    Friday, June 15, 2007 5:13 PM
  • SHCreateDirectoryEx

    Creates a new file system folder.

    VB4-32,5,6
    Declare Function SHCreateDirectoryEx Lib "shell32" Alias "SHCreateDirectoryExA" (ByVal hwnd As Long, ByVal pszPath As String, ByVal psa As Any) As Long

    VB.NET
    System.IO.Directory.CreateDirectory

    Operating Systems Supported
    Requires Windows 2000 or later; Win9x/ME: Not supported

    Library
    Shell32

    Parameter Information
    · hwnd
    [in] Handle to a parent window. This parameter can be set to NULL if no user interface will be displayed.

    · pszPath
    [in] Pointer to a string with the fully qualified path of the directory.

    · psa
    [in] Pointer to a SECURITY_ATTRIBUTES structure with the directory's security attribute. Set this parameter to NULL if no security attributes need to be set.

    Return Values
    Returns ERROR_SUCCESS if successful. If the operation fails, one of the following error codes can be returned.
    ERROR_BAD_PATHNAME The pszPath parameter was set to a relative path.
    ERROR_FILENAME_EXCED_RANGE The path pointed to by pszPath is too long.
    ERROR_FILE_EXISTS The directory exists.
    ERROR_ALREADY_EXISTS The directory exists.
    ERROR_CANCELLED The user canceled the operation.

    Friday, June 15, 2007 5:13 PM