locked
API Programming and functions. - Part II RRS feed

  • Question

  • The first thread has become too long for navigation..
    Wednesday, June 13, 2007 2:19 AM

All replies

  • OffsetClipRgn

    The OffsetClipRgn function moves the clipping region of a device context by the specified offsets.

    VB4-32,5,6
    Declare Function OffsetClipRgn Lib "gdi32" Alias "OffsetClipRgn" (ByVal hdc As Long, ByVal x As Long, ByVal y 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.

    · nXOffset
    Specifies the number of logical units to move left or right.

    · nYOffset
    Specifies the number of logical units to move up or down.

    Return Values
    If the function succeeds, the return value specifies the new 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 current clipping region is unaffected.)

    Wednesday, June 13, 2007 2:21 AM
  • OffsetRect

    The OffsetRect function moves the specified rectangle by the specified offsets.

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

    VB.NET
    System.Drawing.Rectangle.Offset

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

    Library
    User32

    Parameter Information
    · lprc
    Points to a RECT structure that contains the logical coordinates of the rectangle to be moved.

    · dx
    Specifies the amount to move the rectangle left or right. This parameter must be a negative value to move the rectangle to the left.

    · dy
    Specifies the amount to move the rectangle up or down. This parameter must be a negative value to move the rectangle up.

    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.

    Wednesday, June 13, 2007 2:21 AM
  • OffsetRgn

    The OffsetRgn function moves a region by the specified offsets.

    VB4-32,5,6
    Declare Function OffsetRgn Lib "gdi32" Alias "OffsetRgn" (ByVal hRgn As Long, ByVal x As Long, ByVal y As Long) As Long

    VB.NET
    System.Drawing.Region

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

    Library
    Gdi32

    Parameter Information
    · hrgn
    Identifies the region to be moved.

    · nXOffset
    Specifies the number of logical units to move left or right.

    · nYOffset
    Specifies the number of logical units to move up or down.

    Return Values
    The return value specifies the new region’s complexity. It can be 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; region is unaffected.


    Wednesday, June 13, 2007 2:22 AM
  • OleCreatePictureIndirect

    Creates a new picture object initialized according to a PICTDESC structure.

    VB4-32,5,6
    Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long

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

    Library
    Olepro32

    Parameter Information
    · pPictDesc
    [in] Pointer to a caller-allocated structure containing the initial state of the picture.

    · riid
    [in] Reference to the identifier of the interface describing the type of interface pointer to return in ppvObj.

    · fOwn
    [in] If TRUE, the picture object is to destroy its picture when the object is destroyed. If FALSE, the caller is responsible for destroying the picture.

    · ppvObj
    [out] Indirect pointer to the initial interface pointer on the new object. If the call is successful, the caller is responsible for calling Release through this interface pointer when the new object is no longer needed. If the call fails, the value of ppvObj is set to NULL.

    Return Values
    This function supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:

    S_OK

    The new picture object was created successfully.

    E_NOINTERFACE

    The object does not support the interface specified in riid.

    E_POINTER

    The address in pPictDesc or ppvObj is not valid. For example, it may be NULL.

    Wednesday, June 13, 2007 2:22 AM
  • OleLoadPicturePath

    Creates a new picture object and initializes it from the contents of a stream.

    VB4-32,5,6
    Declare Function OleLoadPicturePath Lib "oleaut32.dll" (ByVal szURLorPath As Long, ByVal punkCaller As Long, ByVal dwReserved As Long, ByVal clrReserved As OLE_COLOR, ByRef riid As TGUID, ByRef ppvRet As IPicture) As Long

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

    Library
    Oleaut32

    Parameter Information
    · szURLorPath
    [in] The path or url to the file you want to open.

    · punkCaller
    [in] Points to IUnknown for COM aggregation.

    · dwReserved
    [in] Reserved.

    · clrReserved
    [in] The color you want to reserve to be transparent.

    · riid
    [in] Reference to the identifier of the interface describing the type of interface pointer to return in ppvRet.

    · ppvRet
    [out] Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvRet contains the requested interface pointer on the storage of the object identified by the moniker. If *ppvRet is non-NULL, this function calls IUnknown::AddRef on the interface; it is the caller's responsibility to call IUnknown::Release. If an error occurs, *ppvRet is set to NULL.

    Return Values
    This function supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:
    S_OK
    The picture was created successfully.
    E_POINTER
    The address in ppvRet is NULL.
    E_NOINTERFACE
    The object does not support the interface specified in riid.
    Wednesday, June 13, 2007 2:22 AM
  • OleTranslateColor

    Converts an OLE_COLOR type to a COLORREF.

    VB4-32,5,6
    Private Declare Function OleTranslateColor Lib "olepro32.dll" (ByVal OLE_COLOR As Long, ByVal hPalette As Long, pccolorref As Long) As Long

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

    Library
    Olepro32

    Parameter Information
    · clr
    [in] The OLE color to be converted into a COLORREF.

    · hpal
    [in] Palette used as a basis for the conversion.

    · pcolorref
    [out] Pointer to the caller's variable that receives the converted COLORREF result. This can be NULL, indicating that the caller wants only to verify that a converted color exists.

    Return Values
    This function supports the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following: S_OK

    The color was translated successfully.

    Wednesday, June 13, 2007 2:23 AM
  • OpenClipboard

    The OpenClipboard function opens the clipboard for examination and prevents other applications from modifying the clipboard content.

    VB4-32,5,6
    Declare Function OpenClipboard Lib "user32" Alias "OpenClipboard" (ByVal hwnd 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
    · hWndNewOwner
    Identifies the window to be associated with the open clipboard. If this parameter is NULL, the open clipboard is associated with the current task.

    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.

    Wednesday, June 13, 2007 2:23 AM
  • OpenEventLog

    The OpenEventLog function opens a handle to an event log.

    VB4-32,5,6
    Declare Function OpenEventLog Lib "advapi32.dll" Alias "OpenEventLogA" (ByVal lpUNCServerName As String, ByVal lpSourceName As String) As Long

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

    Library
    Advapi32

    Parameter Information
    · lpUNCServerName
    [in] Pointer to a null-terminated string that specifies the Universal Naming Convention (UNC) name of the server on which the event log is to be opened.

    · lpSourceName
    [in] Pointer to a null-terminated string that specifies the name of the logfile that the returned handle will reference. This can be the Application, Security, or System logfile, or a custom registered logfile. If a custom registered logfile name cannot be found, the event logging service opens the Application logfile, however, there will be no associated message or category string file.

    Return Values
    If the function succeeds, the return value is the handle of an event log.

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

    Wednesday, June 13, 2007 2:24 AM
  • OpenFile

    The OpenFile function creates, opens, reopens, or deletes a file.

    VB4-32,5,6
    Declare Function OpenFile Lib "kernel32" Alias "OpenFile" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long

    VB.NET
    System.IO.File.Open

    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 names the file to be opened. The string must consist of characters from the Windows 3.x character set. The OpenFile function does not support Unicode filenames.

    · lpReOpenBuff
    Points to the OFSTRUCT structure that receives information about the file when it is first opened. The structure can be used in subsequent calls to the OpenFile function to refer to the open file.
    The OFSTRUCT structure contains a pathname string member whose length is limited to OFS_MAXPATHNAME characters. OFS_MAXPATHNAME is currently defined to be 128. Because of this, you cannot use the OpenFile function to open a file whose path length exceeds 128 characters. The CreateFile function does not have such a path length limitation.

    · uStyle
    Specifies the action to take. The following values can be combined by using the bitwise OR operator:
    OF_CANCEL
    Ignored. In the Win32 application programming interface (API), the OF_PROMPT style produces a dialog box containing a Cancel button.
    OF_CREATE
    Creates a new file. If the file already exists, it is truncated to zero length.
    OF_DELETE
    Deletes the file.
    OF_EXIST
    Opens the file and then closes it. Used to test for a file’s existence.
    OF_PARSE
    Fills the OFSTRUCT structure but carries out no other action.
    OF_PROMPT
    Displays a dialog box if the requested file does not exist. The dialog box informs the user that Windows cannot find the file, and it contains Retry and Cancel buttons. Choosing the Cancel button directs OpenFile to return a file-not-found error message.
    OF_READ
    Opens the file for reading only.
    OF_READWRITE
    Opens the file for reading and writing.
    OF_REOPEN
    Opens the file using information in the reopen buffer.
    OF_SHARE_COMPAT
    For MS-DOS-based file systems using the Win32 API, opens the file with compatibility mode, allowing any process on a specified computer to open the file any number of times. Other efforts to open with any other sharing mode fail.
    Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_READ | FILE_SHARE_WRITE flags.
    OF_SHARE_DENY_NONE
    Opens the file without denying read or write access to other processes. On MS-DOS-based file systems using the Win32 API, if the file has been opened in compatibility mode by any other process, the function fails.
    Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_READ | FILE_SHARE_WRITE flags.
    OF_SHARE_DENY_READ
    Opens the file and denies read access to other processes. On MS-DOS-based file systems using the Win32 API, if the file has been opened in compatibility mode or for read access by any other process, the function fails. Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_WRITE flag.
    OF_SHARE_DENY_WRITE
    Opens the file and denies write access to other processes. On MS-DOS-based file systems using the Win32 API, if the file has been opened in compatibility mode or for write access by any other process, the function fails.
    Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_READ flag.
    OF_SHARE_EXCLUSIVE
    Opens the file with exclusive mode, denying both read and write access to other processes. If the file has been opened in any other mode for read or write access, even by the current process, the function fails.
    OF_VERIFY
    Verifies that the date and time of the file are the same as when it was previously opened. This is useful as an extra check for read-only files.
    OF_WRITE
    Opens the file for writing only.

    Return Values
    If the function succeeds, the return value specifies a file handle.

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

    Wednesday, June 13, 2007 2:24 AM
  • OpenIcon

    The OpenIcon function restores a minimized (iconic) window to its previous size and position; it then activates the window.

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

    VB.NET
    System.Drawing.Icon

    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 to be restored and activated.

    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.

    Wednesday, June 13, 2007 2:24 AM
  • OpenPrinter

    The OpenPrinter function retrieves a handle to the specified printer or print server.

    VB4-32,5,6
    Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long

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

    Library
    Winspool

    Parameter Information
    · pPrinterName
    [in] Pointer to a null-terminated string that specifies the name of the printer or print server.
    Windows NT/2000: If NULL, it indicates the local printer server.

    · phPrinter
    [out] Pointer to a variable that receives a handle to the open printer or print server object.
    Windows 2000: The phPrinter parameter can return an Xcv handle for use with the XcvData function. For more information about XcvData, see the Microsoft Windows 2000 Driver Development Kit.

    · pDefault
    [in] Pointer to a PRINTER_DEFAULTS structure. This value 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.

    Wednesday, June 13, 2007 2:24 AM
  • OpenProcess

    The OpenProcess function opens an existing process object.

    VB4-32,5,6
    Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long

    VB.NET
    System.Diagnostics.Process.GetProcessById

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

    Library
    Kernel32

    Parameter Information
    · dwDesiredAccess
    [in] Specifies the access to the process object. For operating systems that support security checking, this access is checked against any security descriptor for the target process. This parameter can be STANDARD_RIGHTS_REQUIRED or one or more of the following values.
    PROCESS_ALL_ACCESS
    Specifies all possible access flags for the process object.
    PROCESS_CREATE_PROCESS
    Used internally.
    PROCESS_CREATE_THREAD
    Enables using the process handle in the CreateRemoteThread function to create a thread in the process.
    PROCESS_DUP_HANDLE
    Enables using the process handle as either the source or target process in the DuplicateHandle function to duplicate a handle.
    PROCESS_QUERY_INFORMATION
    Enables using the process handle in the GetExitCodeProcess and GetPriorityClass functions to read information from the process object.
    PROCESS_SET_QUOTA
    Enables using the process handle in the AssignProcessToJobObject and SetProcessWorkingSetSize functions to set memory limits.
    PROCESS_SET_INFORMATION
    Enables using the process handle in the SetPriorityClass function to set the priority class of the process.
    PROCESS_TERMINATE
    Enables using the process handle in the TerminateProcess function to terminate the process.
    PROCESS_VM_OPERATION
    Enables using the process handle in the VirtualProtectEx and WriteProcessMemory functions to modify the virtual memory of the process.
    PROCESS_VM_READ
    Enables using the process handle in the ReadProcessMemory function to read from the virtual memory of the process.
    PROCESS_VM_WRITE
    Enables using the process handle in the WriteProcessMemory function to write to the virtual memory of the process.
    SYNCHRONIZE
    Windows NT/2000: Enables using the process handle in any of the wait functions to wait for the process to terminate.

    · bInheritHandle
    [in] Specifies whether the returned handle can be inherited by a new process created by the current process. If TRUE, the handle is inheritable.

    · dwProcessId
    [in] Specifies the identifier of the process to open.

    Return Values
    If the function succeeds, the return value is an open handle of the specified process.

    If the function fails, the return value is NULL. To get extended error information, call GetLastError.
    Wednesday, June 13, 2007 2:25 AM
  • OpenProcessToken

    The OpenProcessToken function opens the access token associated with a process.

    VB4-32,5,6
    Declare Function OpenProcessToken Lib "advapi32.dll" Alias "OpenProcessToken" (ByVal ProcessHandle As Long, ByVal DesiredAccess As Long, TokenHandle As Long) As Long

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

    Library
    Advapi32

    Parameter Information
    · ProcessHandle
    Identifies the process whose access token is opened.

    · DesiredAccess
    Specifies an access mask that specifies the requested types of access to the access token. These requested access types are compared with the token’s discretionary access-control list (ACL) to determine which accesses are granted or denied. The following access rights have been defined for access tokens.
    TOKEN_ADJUST_DEFAULT
    Required to change the default ACL, primary group, or owner of an access token.
    TOKEN_ADJUST_GROUPS
    Required to change the groups specified in an access token.
    TOKEN_ADJUST_PRIVILEGES
    Required to change the privileges specified in an access token.
    TOKEN_ALL_ACCESS
    Combines the STANDARD_RIGHTS_REQUIRED standard access rights and all individual access rights for tokens.
    TOKEN_ASSIGN_PRIMARY
    Required to attach a primary token to a process in addition to the SE_CREATE_TOKEN_NAME privilege.
    TOKEN_DUPLICATE
    Required to duplicate an access token.
    TOKEN_EXECUTE
    Combines the STANDARD_RIGHTS_EXECUTE standard access rights and the TOKEN_IMPERSONATE access right.
    TOKEN_IMPERSONATE
    Required to attach an impersonation access token to a process.
    TOKEN_QUERY
    Required to query the contents of an access token.
    TOKEN_QUERY_SOURCE
    Required to query the source of an access token.
    TOKEN_READ
    Combines the STANDARD_RIGHTS_READ standard access rights and the TOKEN_QUERY access right.
    TOKEN_WRITE
    Combines the STANDARD_RIGHTS_WRITE standard access rights and the TOKEN_ADJUST_PRIVILEGES, TOKEN_ADJUST_GROUPS, and TOKEN_ADJUST_DEFAULT access rights.

    · TokenHandle
    Points to a handle identifying the newly-opened access token when the function returns.

    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
    Wednesday, June 13, 2007 2:25 AM
  • OpenSCManager

    The OpenSCManager function establishes a connection to the service control manager on the specified computer and opens the specified service control manager database.

    VB4-32,5,6
    Declare Function OpenSCManager Lib "advapi32.dll" Alias "OpenSCManagerA" (ByVal lpMachineName As String, ByVal lpDatabaseName As String, ByVal dwDesiredAccess As Long) As Long

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

    Library
    Advapi32

    Parameter Information
    · lpMachineName
    [in] Pointer to a null-terminated string that specifies the name of the target computer. The target computer name must be prefixed by "\\". If the pointer is NULL or points to an empty string, the function connects to the service control manager on the local computer.

    · lpDatabaseName
    [in] Pointer to a null-terminated string that specifies the name of the service control manager database to open. This parameter should be set to SERVICES_ACTIVE_DATABASE. If it is NULL, the SERVICES_ACTIVE_DATABASE database is opened by default.

    · dwDesiredAccess
    [in] Specifies the access to the service control manager. Before granting the requested access, the system checks the access token of the calling process against the discretionary access-control list of the security descriptor associated with the service control manager. The SC_MANAGER_CONNECT access type is implicitly specified by calling this function. In addition, any or all of the following service control manager object access types can be specified.
    SC_MANAGER_ALL_ACCESS
    Includes STANDARD_RIGHTS_REQUIRED, in addition to all of the access types listed in this table.
    SC_MANAGER_CONNECT
    Enables connecting to the service control manager.
    SC_MANAGER_CREATE_SERVICE
    Enables calling of the CreateService function to create a service object and add it to the database.
    SC_MANAGER_ENUMERATE_SERVICE
    Enables calling of the EnumServicesStatus function to list the services that are in the database.
    SC_MANAGER_LOCK
    Enables calling of the LockServiceDatabase function to acquire a lock on the database.
    SC_MANAGER_QUERY_LOCK_STATUS
    Enables calling of the QueryServiceLockStatus function to retrieve the lock status information for the database.

    The dwDesiredAccess parameter can specify any or all of the following generic access types.
    GENERIC_READ
    Combines the following access types: STANDARD_RIGHTS_READ, SC_MANAGER_ENUMERATE_SERVICE, and SC_MANAGER_QUERY_LOCK_STATUS.
    GENERIC_WRITE
    Combines the following access types: STANDARD_RIGHTS_WRITE and SC_MANAGER_CREATE_SERVICE.
    GENERIC_EXECUTE
    Combines the following access types: STANDARD_RIGHTS_EXECUTE, SC_MANAGER_CONNECT, and SC_MANAGER_LOCK.

    Return Values
    If the function succeeds, the return value is a handle to the specified service control manager database.

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

    Wednesday, June 13, 2007 2:26 AM
  • OpenThreadToken

    The OpenThreadToken function opens the access token associated with a thread.

    VB4-32,5,6
    Declare Function OpenThreadToken Lib "Advapi32" (ByVal ThreadHandle As Long, ByVal DesiredAccess As Long, ByVal OpenAsSelf As Long, TokenHandle As Long) As Long

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

    Library
    Advapi32

    Parameter Information
    · ThreadHandle
    [in] Handle to the thread whose access token is opened.

    · DesiredAccess
    [in] Specifies an access mask that specifies the requested types of access to the access token. These requested access types are reconciled against the token's discretionary access-control list (DACL) to determine which accesses are granted or denied.
    For a list of access rights for access tokens, see Access Rights for Access-Token Objects.

    · OpenAsSelf
    [in] Indicates whether the access check is to be made against the security context of the thread calling the OpenThreadToken function or against the security context of the process for the calling thread.
    If this parameter is FALSE, the access check is performed using the security context for the calling thread. If the thread is impersonating a client, this security context can be that of a client process. If this parameter is TRUE, the access check is made using the security context of the process for the calling thread.

    · TokenHandle
    [out] Pointer to a variable that receives a handle the newly opened access token.

    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.

    Wednesday, June 13, 2007 2:26 AM
  • OutputDebugString

    The OutputDebugString function sends a string to the debugger for display.Remarks:If the application has no debugger, the system debugger displays the string. If the application has no debugger and the system debugger is not active, OutputDebugString does nothing.

    VB4-32,5,6
    Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String)

    VB.NET
    System.Diagnostics.Debug.Write

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

    Library
    Kernel32

    Parameter Information
    · lpOutputString
    [in] Pointer to the null-terminated string to be displayed.

    Return Values
    This function does not return a value.

    Wednesday, June 13, 2007 2:26 AM
  • QueryPerformanceCounter

    The QueryPerformanceCounter function retrieves the current value of the high-resolution performance counter, if one exists.

    VB4-32,5,6
    Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long

    VB.NET
    System.Diagnostics.PerformanceCounter

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

    Library
    Kernel32

    Parameter Information
    · lpPerformanceCount
    Points to a variable that the function sets, in counts, to the current performance-counter value. If the installed hardware does not support a high-resolution performance counter, this parameter can be to zero.

    Return Values
    If the installed hardware supports a high-resolution performance counter, the return value is nonzero.

    If the installed hardware does not support a high-resolution performance counter, the return value is zero.

    Wednesday, June 13, 2007 2:27 AM
  • QueryPerformanceFrequency

    The QueryPerformanceFrequency function retrieves the frequency of the high-resolution performance counter, if one exists.

    VB4-32,5,6
    Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Long

    VB.NET
    System.Diagnostics.PerformanceCounter

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

    Library
    Kernel32

    Parameter Information
    · lpFrequency
    Points to a variable that the function sets, in counts per second, to the current performance-counter frequency. If the installed hardware does not support a high-resolution performance counter, this parameter can be to zero.

    Return Values
    If the installed hardware supports a high-resolution performance counter, the return value is nonzero.

    If the installed hardware does not support a high-resolution performance counter, the return value is zero.

    Wednesday, June 13, 2007 2:27 AM
  • PAGESETUPDLG

    The PageSetupDlg function creates a Page Setup dialog box that enables the user to specify the attributes of a printed page. These attributes include the paper size and source, the page orientation (portrait or landscape), and the width of the page margins.

    VB4-32,5,6
    Declare Function PageSetupDlg Lib "comdlg32.dll" Alias "PageSetupDlgA" (pPagesetupdlg As PAGESETUPDLG) As Long

    VB.NET
    System.Windows.Forms.PageSetupDialog

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

    Library
    Comdlg32

    Parameter Information
    · lppsd
    Pointer to a PAGESETUPDLG structure that contains information used to initialize the dialog box. The structure receives information about the user’s selections when the function returns.

    Return Values
    If the user clicks the OK button, the return value is nonzero. The members of the PAGESETUPDLG structure pointed to by the lppsd parameter indicate the user’s selections.

    If the user cancels or closes the Page Setup dialog box or an error occurs, the return value is zero. To get extended error information, use the CommDlgExtendedError function

    Wednesday, June 13, 2007 2:28 AM
  • PaintDesktop

    The PaintDesktop function fills the clipping region in the specified device context with the desktop pattern or wallpaper. The function is provided primarily for shell desktops.

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

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

    Library
    User32

    Parameter Information
    · hdc
    Identifies the device context.

    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
    Wednesday, June 13, 2007 2:28 AM
  • PatBlt

    The PatBlt function paints the specified rectangle using the brush that is currently selected into the specified device context. The brush color and the surface color or colors are combined by using the specified raster operation.

    VB4-32,5,6
    Declare Function PatBlt Lib "gdi32" Alias "PatBlt" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop 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.

    · nXLeft
    Specifies the x-coordinate, in logical units, of the upper-left corner of the rectangle to be filled.

    · nYLeft
    Specifies the y-coordinate, in logical units, of the upper-left corner of the rectangle to be filled.

    · nWidth
    Specifies the width, in logical units, of the rectangle.

    · nHeight
    Specifies the height, in logical units, of the rectangle.

    · dwRop
    Specifies the raster operation code. This code may be one of the following values:
    PATCOPY
    Copies the specified pattern into the destination bitmap.
    PATINVERT
    Combines the colors of the specified pattern with the colors of the destination rectangle by using the Boolean OR operator.
    DSTINVERT
    Inverts the destination rectangle.
    BLACKNESS
    Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)
    WHITENESS
    Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)

    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.
    Wednesday, June 13, 2007 2:29 AM
  • PathAddBackslash

    Adds a backslash to the end of a string to create the correct syntax for a path. If the source path already has a trailing backslash, no backslash will be added.

    VB4-32,5,6
    Declare Function PathAddBackslash Lib "shlwapi.dll" Alias "PathAddBackslashA" (ByVal pszPath As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · lpszPath
    [in/out] Pointer to a buffer with a string that represents a path. The size of this buffer should be set to MAX_PATH to ensure that it is large enough to hold the returned string.

    Return Values
    Returns the address of the NULL that terminates the string.

    Wednesday, June 13, 2007 2:29 AM
  • PathAppend

    Appends one path to the end of another.

    VB4-32,5,6
    Declare Function PathAppend Lib "shlwapi.dll" Alias "PathAppendA" (ByVal pszPath As String, ByVal pMore As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · pszPath
    [in/out] Pointer to a buffer with the NULL-terminated string to which the file name will be appended. The size of this buffer should be set to MAX_PATH to ensure that it is large enough to hold the returned string.

    · pszMore
    [in] Address of the string that represents the file name.

    Return Values
    Returns TRUE if successful, or FALSE otherwise.

    Wednesday, June 13, 2007 2:30 AM
  • PathAddExtension

    Adds a file extension to a path string.

    VB4-32,5,6
    Declare Function PathAddExtension Lib "shlwapi.dll" Alias "PathAddExtensionA" (ByVal pszPath As String, ByVal pszExt As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · pszPath
    [in/out] Pointer to a buffer with the NULL-terminated string to which the file extension will be appended. The size of this buffer should be set to MAX_PATH to ensure that it is large enough to hold the returned string.

    · pszExtension
    [in] Pointer to the string that contains the file extension.

    Return Values
    Returns TRUE if an extension was added, or FALSE otherwise.

    Wednesday, June 13, 2007 2:30 AM
  • PathBuildRoot

    Creates a root path from a given drive number.

    VB4-32,5,6
    Declare Function PathBuildRoot Lib "shlwapi.dll" Alias "PathBuildRootA" (ByVal szRoot As String, ByVal iDrive As Long) As Long

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

    Library
    Shlwapi

    Parameter Information
    · szRoot
    Address of the string that receives the constructed root path. This buffer must be at least four characters in size.

    · iDrive
    Integer value that indicates the desired drive number. It should be between 0 and 25.

    Return Values
    Returns the address of the constructed root path. If the call fails for any reason (for example, an invalid drive number), szRoot is returned unchanged.

    Wednesday, June 13, 2007 2:30 AM
  • DestroyCursor

    The DestroyCursor function destroys a cursor created by the CreateCursor function and frees any memory the cursor occupied. Do not use this function to destroy a cursor that was not created with the CreateCursor function.

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

    VB.NET
    N/A

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

    Library
    User32

    Parameter Information
    · hCursor
    Identifies the cursor to be destroyed. The cursor must not be in use.

    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.
    Wednesday, June 13, 2007 6:50 PM
  • DestroyIcon

    The DestroyIcon function destroys an icon and frees any memory the icon occupied.

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

    VB.NET
    N/A

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

    Library
    User32

    Parameter Information
    · hIcon
    Identifies the icon to be destroyed. The icon must not be in use.

    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.
    Wednesday, June 13, 2007 6:50 PM
  • DestroyMenu

    The DestroyMenu function destroys the specified menu and frees any memory that the menu occupies.

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

    VB.NET
    N/A

    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 destroyed.

    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.
    Wednesday, June 13, 2007 6:50 PM
  • DestroyWindow

    The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window’s menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).

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

    VB.NET
    N/A

    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 destroyed.

    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.
    Wednesday, June 13, 2007 6:53 PM
  • DeviceCapabilities

    The DeviceCapabilities function retrieves the capabilities of a printer device driver.

    VB4-32,5,6
    Declare Function DeviceCapabilities Lib "winspool.drv" Alias "DeviceCapabilitiesA" (ByVal lpDeviceName As String, ByVal lpPort As String, ByVal iIndex As Long, ByVal lpOutput As String, lpDevMode As DEVMODE) As Long

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

    Library
    Winspool.drv

    Parameter Information
    · pDevice
    Pointer to a null-terminated string that contains the name of the printer. Note that this is the name of the printer, not of the printer driver.

    · pPort
    Pointer to a null-terminated string that contains the name of the port to which the device is connected, such as “LPT1”.

    · fwCapability
    Specifies the capabilities to query. This parameter can be one of the following values:
    DC_BINADJUST
    Windows 95 only: Retrieves the page positioning for the paper source specified in the DEVMODE structure pointed to by pdevMode. The return value can be one of the following:
    DCBA_FACEUPNONE
    DCBA_FACEUPCENTER
    DCBA_FACEUPLEFT
    DCBA_FACEUPRIGHT
    DCBA_FACEDOWNNONE
    DCBA_FACEDOWNCENTER
    DCBA_FACEDOWNLEFT
    DCBA_FACEDOWNRIGHT
    DC_BINNAMES
    Copies an array containing a list of the names of the paper bins. This array is in the form char PaperNames[cBinMax][cchBinName] where cchBinName is 24. If the pOutput parameter is NULL, the return value is the number of bin entries required. Otherwise, the return value is the number of bins copied.
    DC_BINS
    Retrieves a list of available bins. The function copies the list to the pOutput parameter as a WORD array. If pOutput is NULL, the function returns the number of supported bins to allow the application the opportunity to allocate a buffer with the correct size. For more information about these bins, see the description of the dmDefaultSource member of the DEVMODE structure.
    DC_COPIES
    Returns the number of copies the device can print.
    DC_DRIVER
    Returns the version number of the printer driver.
    DC_DATATYPE_PRODUCED
    Windows 95 only: The return value is the number of datatypes supported by the printer driver. If the function returns -1, the driver understands the “RAW” datatype only. The names of the supported datatypes are copied to an array. Use the names in the DOCINFO structure when calling the StartDoc function to specify the datatype.
    DC_DUPLEX
    Returns the level of duplex support. The function returns 1 if the printer is capable of duplex printing. Otherwise, the return value is zero.
    DC_EMF_COMPLIANT
    Windows 95 only: Determines if a printer driver supports enhanced metafile (EMF). A return value of 1 means the driver supports EMF. A return value of -1 means that the driver does not support EMF
    DC_ENUMRESOLUTIONS
    Returns a list of available resolutions. If pOutput is NULL, the function returns the number of available resolution configurations. Resolutions are represented by pairs of LONG integers representing the horizontal and vertical resolutions (specified in dots per inch).
    DC_EXTRA
    Returns the number of bytes required for the device-specific portion of the DEVMODE structure for the printer driver.
    DC_FIELDS
    Returns the dmFields member of the printer driver’s DEVMODE structure. The dmFields member indicates which members in the device-independent portion of the structure are supported by the printer driver.
    DC_FILEDEPENDENCIES
    Returns a list of files that also need to be loaded when a driver is installed. If the pOutput parameter is NULL, the function returns the number of files. Otherwise, pOutput points to an array of filenames in the form char[chFileName, 64]. Each filename is a null-terminated string.
    DC_MAXEXTENT
    Returns a POINTS structure that contains the maximum paper size that the dmPaperLength and dmPaperWidth members of the printer driver’s DEVMODE structure can specify. The x member of the POINTS structure contains the maximum dmPaperWidth value, and the y member contains the maximum dmPaperLength value.
    DC_MINEXTENT
    Returns a POINTS structure that contains the minimum paper size that the dmPaperLength and dmPaperWidth members of the printer driver’s DEVMODE structure can specify. The x member of the POINTS structure contains the minimum dmPaperWidth value, and the y member contains the minimum dmPaperLength value.
    DC_ORIENTATION
    Returns the relationship between portrait and landscape orientations for a device, in terms of the number of degrees that portrait orientation is rotated counterclockwise to produce landscape orientation. The return value can be one of the following:
    0
    No landscape orientation.
    90
    Portrait is rotated 90 degrees to produce landscape. (For example, Hewlett-Packard PCL printers.)
    270
    Portrait is rotated 270 degrees to produce landscape. (For example, dot-matrix printers.)
    DC_PAPERNAMES
    Retrieves a list of supported paper names (for example, Letter or Legal). If the pOutput parameter is NULL, the function returns the number of paper sizes available. Otherwise, pOutput points to an array for the paper names in the form char[cPaperNames, 64]. Each paper name is a null-terminated string.
    DC_PAPERS
    Retrieves a list of supported paper sizes. The function copies the list to pOutput as a WORD array and returns the number of entries in the array. If pOutput is NULL, the function returns the number of supported paper sizes to allow the application the opportunity to allocate a buffer with the correct size. For more information on paper sizes, see the description of the dmPaperSize member of the DEVMODE structure.
    DC_PAPERSIZE
    Copies the dimensions of all supported paper sizes, in tenths of a millimeter, to an array of POINT structures pointed to by the pOutput parameter. The width (x-dimension) and length (y-dimension) of a paper size are returned as if the paper were in the DMORIENT_PORTRAIT orientation.
    DC_SIZE
    Returns the dmSize member of the printer driver’s DEVMODE structure.
    DC_TRUETYPE
    Retrieves the abilities of the driver to use TrueType fonts. For DC_TRUETYPE, the pOutput parameter should be NULL. The return value can be one or more of the following:
    DCTT_BITMAP
    Device can print TrueType fonts as graphics. (For example, dot-matrix and PCL printers.)
    DCTT_DOWNLOAD
    Device can download TrueType fonts. (For example, PCL and PostScript printers.)
    DCTT_DOWNLOAD_OUTLINE
    Windows 95 only: Device can download outline TrueType fonts.
    DCTT_SUBDEV
    Device can substitute device fonts for TrueType fonts. (For example, PostScript printers.)
    DC_VERSION
    Returns the specification version to which the printer driver conforms.

    · pOutput
    Pointer to an array of bytes. The format of the array depends on the setting of the fwCapability parameter. If pOutput is zero, DeviceCapabilities returns the number of bytes required for the output data.

    · pDevMode
    Pointer to a DEVMODE structure. If this parameter is NULL, DeviceCapabilities retrieves the current default initialization values for the specified printer driver. Otherwise, the function retrieves the values contained in the structure to which pDevMode points.

    Return Values
    If the function succeeds, the return value depends on the setting of the fwCapability parameter.

    If the function fails, the return value is -1.
    Wednesday, June 13, 2007 6:53 PM
  • DeviceIoControl

    The DeviceIoControl function sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.

    VB4-32,5,6
    Declare Function DeviceIoControl Lib "kernel32" (ByVal hDevice As Long, ByVal dwIoControlCode As Long, lpInBuffer As Any, ByVal nInBufferSize As Long, lpOutBuffer As Any, ByVal nOutBufferSize As Long, lpBytesReturned As Long, lpOverlapped As Any) As Long

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

    Library
    Kernel32

    Parameter Information
    · hDevice
    [in] Handle to the device on which to perform the operation, typically a volume, directory, file, or alternate stream. To retrieve a device handle, use the function.

    · dwIoControlCode
    [in] Specifies the control code for the operation. This value identifies the specific operation to be performed and the type of device on which to perform it.
    For a list of the control codes and a short description of each control code, see Device Input and Output Control Codes .

    For more detailed information on each control code, see its documentation. In particular, the documentation provides details on the usage of the lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, and lpBytesReturned parameters.

    · lpInBuffer
    [in] Pointer to a buffer that contains the data required to perform the operation.
    This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not require input data.

    · nInBufferSize
    [in] Specifies the size, in bytes, of the buffer pointed to by lpInBuffer.

    · lpOutBuffer
    [out] Pointer to a buffer that receives the operation's output data.
    This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not produce output data.

    · nOutBufferSize
    [in] Specifies the size, in bytes, of the buffer pointed to by lpOutBuffer.

    · lpBytesReturned
    [out] Pointer to a variable that receives the size, in bytes, of the data stored into the buffer pointed to by lpOutBuffer.
    If the output buffer is too small to return any data, then the call fails, returns the error code ERROR_INSUFFICIENT_BUFFER, and the returned byte count is zero.
    If the output buffer is too small to hold all of the data but can hold some entries, then the operating system returns as much as fits, the call fails, GetLastError returns the error code ERROR_MORE_DATA, and lpBytesReturned indicates the amount of data returned. Your application should call DeviceIoControl again with the same operation, specifying a new starting point.
    If lpOverlapped is NULL, lpBytesReturned cannot be NULL. Even when an operation produces no output data, and lpOutBuffer can be NULL, DeviceIoControl makes use of the variable pointed to by lpBytesReturned. After such an operation, the value of the variable is without meaning.
    If lpOverlapped is not NULL, lpBytesReturned can be NULL. If this is an overlapped operation, you can get the number of bytes returned by calling . If hDevice is associated with an I/O completion port, you can get the number of bytes returned by calling .

    · lpOverlapped
    [in] Pointer to an structure.
    If hDevice was opened with the FILE_FLAG_OVERLAPPED flag, lpOverlapped must point to a valid OVERLAPPED structure. In this case, the operation is performed as an overlapped (asynchronous) operation. If the device was opened with FILE_FLAG_OVERLAPPED and lpOverlapped is NULL, the function fails in unpredictable ways.
    If hDevice was opened without specifying the FILE_FLAG_OVERLAPPED flag, lpOverlapped is ignored and DeviceIoControl does not return until the operation has been completed, or an error occurs.

    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.
    Wednesday, June 13, 2007 6:53 PM
  • DispatchMessage

    The DispatchMessage function dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function.

    VB4-32,5,6
    Declare Function DispatchMessage Lib "user32" Alias "DispatchMessageA" (lpMsg As MSG) As Long

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

    Library
    User32

    Parameter Information
    · lpmsg
    Points to an MSG structure that contains the message.

    Return Values
    The return value specifies the value returned by the window procedure. Although its meaning depends on the message being dispatched, the return value generally is ignored.
    Wednesday, June 13, 2007 6:54 PM
  • DllRegisterServer

    The DllRegisterServer function adds entries associated with a Cluster Administrator extension DLL to the system registry. Client-side registration must be done on each machine on which the Cluster Administrator program is executed.

    VB4-32,5,6
    Declare Function DllRegisterServer Lib "ComCtl32.OCX" () As Long

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

    Library
    Comctl32.ocx

    Return Values
    This function supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:

    S_OK

    The registry entries were created successfully.

    SELFREG_E_TYPELIB

    The server was unable to complete the registration of all the type libraries used by its classes.

    SELFREG_E_CLASS

    The server was unable to complete the registration of all the object classes.
    Wednesday, June 13, 2007 6:54 PM
  • DllUnregisterServer

    The DllUnregisterServer function removes entries associated with a Cluster Administrator extension DLL from the system registry.

    VB4-32,5,6
    Declare Function DllUnregisterServer Lib "ComCtl32.OCX" () As Long

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

    Library
    Comctl32.ocx

    Return Values
    This function supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:

    S_OK

    The registry entries were created successfully.

    S_FALSE

    Unregistration of this server’s known entries was successful, but other entries still exist for this server’s classes.

    SELFREG_E_TYPELIB

    The server was unable to remove the entries of all the type libraries used by its classes.

    SELFREG_E_CLASS

    The server was unable to remove the entries of all the object classes.
    Wednesday, June 13, 2007 6:54 PM
  • DoFileDownload

    The DoFileDownload function opens a download dialog.

    VB4-32,5,6
    Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long

    Operating Systems Supported
    Undocumented

    Library
    Shdocvw

    Parameter Information
    · lpszFile
    File to download

    Return Values
    Undocumented
    Wednesday, June 13, 2007 6:54 PM
  • DrawAnimatedRects

    The DrawAnimatedRects function draws a wire-frame rectangle and animates it to indicate the opening of an icon or the minimizing or maximizing of a window.

    VB4-32,5,6
    Declare Function DrawAnimatedRects Lib "user32" Alias "DrawAnimatedRects" (ByVal hwnd As Long, ByVal idAni As Long, lprcFrom As Rect, lprcTo As Rect) As Long

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

    Library
    User32

    Parameter Information
    · hwnd
    [in] Handle to the window to which the rectangle is clipped. If this parameter is NULL, the working area of the screen is used.

    · idAni
    [in] Specifies the type of animation. If you specify IDANI_CAPTION, the window caption will animate from the position specified by lprcFrom to the position specified by lprcTo. The effect is similar to minimizing or maximizing a window.

    · lprcFrom
    [in] Pointer to a RECT structure specifying the location and size of the icon or minimized window. Coordinates are relative to the rectangle specified by the lprcClip parameter.

    · lprcTo
    [in] Pointer to a RECT structure specifying the location and size of the restored window. Coordinates are relative to the rectangle specified by the lprcClip parameter.

    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.
    Wednesday, June 13, 2007 6:55 PM
  • DrawCaption

    The DrawCaption function draws a window caption.

    VB4-32,5,6
    Declare Function DrawCaption Lib "user32" Alias "DrawCaption" (ByVal hWnd As Long, ByVal hDC As Long, pcRect As Rect, ByVal un As Long) As Long

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

    Library
    User32

    Parameter Information
    · hwnd
    Handle to a window that supplies text and an icon for the window caption.

    · hdc
    Handle to a device context. The function draws the window caption into this device context.

    · lprc
    Pointer to a RECT structure that specifies the bounding rectangle for the window caption.

    · uFlags
    A set of bit flags that specify drawing options. You can set zero or more of the following flags:
    DC_ACTIVE
    The function uses the colors that denote an active caption.
    DC_ICON
    The function draws the icon when drawing the caption text.
    DC_INBUTTON
    The function draws the caption as a button.
    DC_SMALLCAP
    The function draws a small caption, using the current small caption font.
    DC_TEXT
    The function draws the caption text when drawing the caption.

    If DC_SMALLCAP is specified, the function draws a normal window caption.

    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.
    Wednesday, June 13, 2007 6:55 PM
  • DrawEdge

    The DrawEdge function draws one or more edges of rectangle.

    VB4-32,5,6
    Declare Function DrawEdge Lib "user32" Alias "DrawEdge" (ByVal hdc As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long) As Long

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

    Library
    User32

    Parameter Information
    · hdc
    Identifies the device context.

    · qrc
    Points to a RECT structure that contains the logical coordinates of the rectangle.

    · edge
    Specifies the type of inner and outer edge to draw. This parameter must be a combination of one inner-border flag and one outer-border flag. The inner-border flags are as follows:
    BDR_RAISEDINNER
    Raised inner edge.
    BDR_SUNKENINNER
    Sunken inner edge.

    The outer-border flags are as follows:
    BDR_RAISEDOUTER
    Raised outer edge.
    BDR_SUNKENOUTER
    Sunken outer edge.

    Alternatively, the edge parameter can specify one of the following flags:
    EDGE_BUMP
    Combination of BDR_RAISEDOUTER and BDR_SUNKENINNER.
    EDGE_ETCHED
    Combination of BDR_SUNKENOUTER and BDR_RAISEDINNER.
    EDGE_RAISED
    Combination of BDR_RAISEDOUTER and BDR_RAISEDINNER.
    EDGE_SUNKEN
    Combination of BDR_SUNKENOUTER and BDR_SUNKENINNER.

    · grfFlags
    Specifies the type of border. This parameter can be a combination of these values:
    BF_ADJUST
    Rectangle to be adjusted to leave space for client area.
    BF_BOTTOM
    Bottom of border rectangle.
    BF_BOTTOMLEFT
    Bottom and left side of border rectangle.
    BF_BOTTOMRIGHT
    Bottom and right side of border rectangle.
    BF_DIAGONAL
    Diagonal border.
    BF_DIAGONAL_ENDBOTTOMLEFT
    Diagonal border. The end point is the bottom-left corner of the rectangle; the origin is top-right corner.
    BF_DIAGONAL_ENDBOTTOMRIGHT
    Diagonal border. The end point is the bottom-right corner of the rectangle; the origin is top-left corner.
    BF_DIAGONAL_ENDTOPLEFT
    Diagonal border. The end point is the top-left corner of the rectangle; the origin is bottom-right corner.
    BF_DIAGONAL_ENDTOPRIGHT
    Diagonal border. The end point is the top-right corner of the rectangle; the origin is bottom-left corner.
    BF_FLAT
    Flat border.
    BF_LEFT
    Left side of border rectangle.
    BF_MIDDLE
    Interior of rectangle to be filled.
    BF_MONO
    One-dimensional border.
    BF_RECT
    Entire border rectangle.
    BF_RIGHT
    Right side of border rectangle.
    BF_SOFT
    Soft buttons instead of tiles.
    BF_TOP
    Top of border rectangle.
    BF_TOPLEFT
    Top and left side of border rectangle.
    BF_TOPRIGHT
    Top and right side of border 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.
    Wednesday, June 13, 2007 6:56 PM
  • DrawFocusRect

    The DrawFocusRect function draws a rectangle in the style used to indicate that the rectangle has the focus.

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

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

    Library
    User32

    Parameter Information
    · hDC
    Identifies the device context.

    · lprc
    Points to a RECT structure that specifies the logical 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.
    Wednesday, June 13, 2007 6:56 PM
  • DrawFrameControl

    The DrawFrameControl function draws a frame control of the specified type and style.

    VB4-32,5,6
    Declare Function DrawFrameControl Lib "user32" Alias "DrawFrameControl" (ByVal hDC As Long, lpRect As RECT, ByVal un1 As Long, ByVal un2 As Long) As Long

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

    Library
    User32

    Parameter Information
    · hdc
    Identifies the device context of the window in which to draw the control.

    · lprc
    Points to a RECT structure that contains the logical coordinates of the bounding rectangle for frame control.

    · uType
    Specifies the type of frame control to draw. This parameter can be one of the following values:
    DFC_BUTTON
    Standard button
    DFC_CAPTION
    Title bar
    DCF_MENU
    Menu
    DFC_SCROLL
    Scroll bar

    · uState
    Specifies the initial state of the frame control. If uType is DFC_BUTTON, uState can be one of the following values:
    DFCS_BUTTON3STATE
    Three-state button
    DFCS_BUTTONCHECK
    Check box
    DFCS_BUTTONPUSH
    Push button
    DFCS_BUTTONRADIO
    Radio button
    DFCS_BUTTONRADIOIMAGE
    Image for radio button (nonsquare needs image)
    DFCS_BUTTONRADIOMASK
    Mask for radio button (nonsquare needs mask)

    If uType is DFC_CAPTION, uState can be one of the following values:
    DFCS_CAPTIONCLOSE
    Close button
    DFCS_CAPTIONHELP
    Windows 95 only: Help button
    DFCS_CAPTIONMAX
    Maximize button
    DFCS_CAPTIONMIN
    Minimize button
    DFCS_CAPTIONRESTORE
    Restore button

    If uType is DFC_MENU, uState can be one of the following values:
    DFCS_MENUARROW
    Submenu arrow
    DFCS_MENUBULLET
    Bullet
    DFCS_MENUCHECK
    Check mark

    If uType is DFC_SCROLL, uState can be one of the following values:
    DFCS_SCROLLCOMBOBOX
    Combo box scroll bar
    DFCS_SCROLLDOWN
    Down arrow of scroll bar
    DFCS_SCROLLLEFT
    Left arrow of scroll bar
    DFCS_SCROLLRIGHT
    Right arrow of scroll bar
    DFCS_SCROLLSIZEGRIP
    Size grip in bottom-right corner of window
    DFCS_SCROLLUP
    Up arrow of scroll bar

    The following style can be used to adjust the bounding rectangle of the push button:
    DFCS_ADJUSTRECT
    Bounding rectangle is adjusted to exclude the surrounding edge of the push button.

    One or more of the following values can be used to set the state of the control to be drawn:
    DFCS_CHECKED
    Button is checked.
    DFCS_FLAT
    Button has a flat border.
    DFCS_INACTIVE
    Button is inactive (grayed).
    DFCS_MONO
    Button has a monochrome border.
    DFCS_PUSHED
    Button is pushed.

    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.
    Wednesday, June 13, 2007 6:56 PM
  • DrawIcon

    The DrawIcon function draws an icon in the client area of the window of the specified device context.

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

    VB.NET
    System.Drawing.Graphics.DrawIcon

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

    Library
    User32

    Parameter Information
    · hDC
    Identifies the device context for a window.

    · X
    Specifies the logical x-coordinate of the upper-left corner of the icon.

    · Y
    Specifies the logical y-coordinate of the upper-left corner of the icon.

    · hIcon
    Identifies the icon to be drawn.

    Windows NT: The icon resource must have been previously loaded by using the LoadIcon function.
    Windows 95: The icon resource must have been previously loaded by using the LoadIcon or LoadImage functions.

    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.
    Wednesday, June 13, 2007 6:56 PM
  • DrawIconEx

    The DrawIconEx function draws an icon or cursor in the client area of the window of the specified device context, performing the specified raster operations, and stretching or compressing the icon or cursor as specified.

    VB4-32,5,6
    Declare Function DrawIconEx Lib "user32" Alias "DrawIconEx" (ByVal hdc As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long

    VB.NET
    System.Drawing.Graphics.DrawIcon

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

    Library
    User32

    Parameter Information
    · hdc
    Identifies the device context for a window.

    · xLeft
    Specifies the logical x-coordinate of the upper-left corner of the icon or cursor.

    · yTop
    Specifies the logical y-coordinate of the upper-left corner of the icon or cursor.

    · hIcon
    Identifies the icon or cursor to be drawn. This parameter can identify an animated cursor. The icon or cursor resource must have been previously loaded by using the LoadImage function.

    · cxWidth
    Specifies the logical width of the icon or cursor. If this parameter is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses the SM_CXICON or SM_CXCURSOR system metric value to set the width. If this parameter is zero and DI_DEFAULTSIZE is not used, the function uses the actual resource width.

    · cyWidth
    Specifies the logical height of the icon or cursor. If this parameter is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses the SM_CYICON or SM_CYCURSOR system metric value to set the width. If this parameter is zero and DI_DEFAULTSIZE is not used, the function uses the actual resource height.

    · istepIfAniCur
    Specifies the index of the frame to draw, if hIcon identifies an animated cursor. This parameter is ignored if hIcon does not identify an animated cursor.

    · hbrFlickerFreeDraw
    Identifies a brush that the system uses for flicker-free drawing. If hbrBkgnd is a valid brush handle, the system creates an offscreen bitmap using the specified brush for the background color, draws the icon or cursor into the bitmap, and then copies the bitmap into the device context identified by hdc. If hbrBkgnd is NULL, the system draws the icon or cursor directly into the device context.

    · diFlags
    Specifies the drawing flags. This parameter can be one of the following values:
    DI_COMPAT
    Draws the icon or cursor using the system default image rather than the user-specified image.
    DI_DEFAULTSIZE
    Draws the icon or cursor using the width and height specified by the system metric values for cursors or icons, if the cxWidth and cyWidth parameters are set to zero. If this flag is not specified and cxWidth and cyWidth are set to zero, the function uses the actual resource size.
    DI_IMAGE
    Draws the icon or cursor using the image.
    DI_MASK
    Draws the icon or cursor using the mask.
    DI_NORMAL
    Combination of DI_IMAGE and DI_MASK.

    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.
    Wednesday, June 13, 2007 6:57 PM
  • DrawMenuBar

    The DrawMenuBar function redraws the menu bar of the specified window. If the menu bar changes after Windows has created the window, this function must be called to draw the changed menu bar.

    VB4-32,5,6
    Declare Function DrawMenuBar Lib "user32" Alias "DrawMenuBar" (ByVal hwnd As Long) 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 menu bar needs redrawing.

    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.
    Wednesday, June 13, 2007 6:57 PM
  • DrawState

    The DrawState function displays an image and applies a visual effect to indicate a state, such as a disabled or default state.

    VB4-32,5,6
    Declare Function DrawState Lib "user32" Alias "DrawStateA" (ByVal hDC As Long, ByVal hBrush As Long, ByVal lpDrawStateProc As Long, ByVal lParam As Long, ByVal wParam As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal n3 As Long, ByVal n4 As Long, ByVal un As Long) As Long

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

    Library
    User32

    Parameter Information
    · hdc
    Identifies the device context to draw in.

    · hbr
    Identifies the brush used to draw the image, if the state specified by the fuFlags parameter is DSS_MONO. This parameter is ignored for other states.

    · lpOutputFunc
    Points to an application-defined callback function used to render the image. This parameter is required if the image type in fuFlags is DST_COMPLEX. It is optional and can be NULL if the image type is DST_TEXT. For all other image types, this parameter is ignored. For more information about the callback function, see the DrawStateProc function.

    · lData
    Specifies information about the image. The meaning of this parameter depends on the image type.

    · wData
    Specifies information about the image. The meaning of this parameter depends on the image type. It is, however, zero extended for use with the DrawStateProc function.

    · x
    Specifies the horizontal location at which to draw the image.

    · y
    Specifies the vertical location at which to draw the image.

    · cx
    Specifies the width of the image, in device units. This parameter is required if the image type is DST_COMPLEX. Otherwise, it can be zero to calculate the width of the image.

    · cy
    Specifies the height of the image, in device units. This parameter is required if the image type is DST_COMPLEX. Otherwise, it can be zero to calculate the height of the image.

    · fuFlags
    Specifies the image type and state. The type can be one of these values:
    DST_BITMAP
    The image is a bitmap. The low-order word of the lData parameter is the bitmap handle.
    DST_COMPLEX
    The image is application defined. To render the image, DrawState calls the callback function specified by the lpOutputFunc parameter.
    DST_ICON
    The image is an icon. The low-order word of lData is the icon handle.
    DST_PREFIXTEXT
    The image is text that may contain an accelerator mnemonic. DrawState interprets the ampersand (&) prefix character as a directive to underscore the character that follows. The lData parameter specifies the address of the string, and the wData parameter specifies the length. If wData is zero, the string must be null-terminated.
    DST_TEXT
    The image is text. The lData parameter specifies the address of the string, and the wData parameter specifies the length. If wData is zero, the string must be null-terminated.

    The state can be one of these values:
    DSS_NORMAL
    Draws the image without any modification.
    DSS_UNION
    Dithers the image.
    DSS_DISABLED
    Embosses the image.
    DSS_MONO
    Draws the image using the brush specified by the hbr parameter.

    For all states except DSS_NORMAL, the image is converted to monochrome before the visual effect is applied.

    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.
    Wednesday, June 13, 2007 6:57 PM
  • DrawText

    The DrawText function draws formatted text in the specified rectangle. It formats the text according to the specified method (expanding tabs, justifying characters, breaking lines, and so forth).

    VB4-32,5,6
    Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long

    VB.NET
    System.Drawing.Graphics.DrawString

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

    Library
    User32

    Parameter Information
    · hDC
    Identifies the device context.

    · lpString
    Points to the string to be drawn. If the nCount parameter is -1, the string must be null-terminated.

    · nCount
    Specifies the number of characters in the string. If nCount is -1, then the lpString parameter is assumed to be a pointer to a null-terminated string and DrawText computes the character count automatically.

    · lpRect
    Points to a RECT structure that contains the rectangle (in logical coordinates) in which the text is to be formatted.

    · uFormat
    Specifies the method of formatting the text. It can be any combination of the following
    DT_BOTTOM
    Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE.
    DT_CALCRECT
    Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.
    DT_CENTER
    Centers text horizontally in the rectangle.
    DT_EDITCONTROL
    Duplicates the text-displaying characteristics of a multiline edit control. Specifically, the average character width is calculated in the same manner as for an edit control, and the function does not display a partially visible last line.
    DT_END_ELLIPSIS or DT_PATH_ELLIPSIS
    Replaces part of the given string with ellipses, if necessary, so that the result fits in the specified rectangle. The given string is not modified unless the DT_MODIFYSTRING flag is specified.

    You can specify DT_END_ELLIPSIS to replace characters at the end of the string, or DT_PATH_ELLIPSIS to replace characters in the middle of the string. If the string contains backslash (\) characters, DT_PATH_ELLIPSIS preserves as much as possible of the text after the last backslash.

    DT_EXPANDTABS
    Expands tab characters. The default number of characters per tab is eight.
    DT_EXTERNALLEADING
    Includes the font external leading in line height. Normally, external leading is not included in the height of a line of text.
    DT_LEFT
    Aligns text to the left.
    DT_MODIFYSTRING
    Modifies the given string to match the displayed text. This flag has no effect unless the DT_END_ELLIPSIS or DT_PATH_ELLIPSIS flag is specified.
    DT_NOCLIP
    Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used.
    DT_NOPREFIX
    Turns off processing of prefix characters. Normally, DrawText interprets the mnemonic-prefix character & as a directive to underscore the character that follows, and the mnemonic-prefix characters && as a directive to print a single &. By specifying DT_NOPREFIX, this processing is turned off.
    DT_RIGHT
    Aligns text to the right.
    DT_RTLREADING
    Layout in right to left reading order for bi-directional text when the font selected into the hdc is a Hebrew or Arabic font. The default reading order for all text is left to right.
    DT_SINGLELINE
    Displays text on a single line only. Carriage returns and linefeeds do not break the line.
    DT_TABSTOP
    Sets tab stops. Bits 15-8 (high-order byte of the low-order word) of the uFormat parameter specify the number of characters for each tab. The default number of characters per tab is eight.
    DT_TOP
    Top-justifies text (single line only).
    DT_VCENTER
    Centers text vertically (single line only).
    DT_WORDBREAK
    Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-linefeed sequence also breaks the line.

    Note that the DT_CALCRECT, DT_EXTERNALLEADING, DT_INTERNAL, DT_NOCLIP, and DT_NOPREFIX values cannot be used with the DT_TABSTOP value.

    Return Values
    If the function succeeds, the return value is the height of the text.
    Wednesday, June 13, 2007 6:58 PM
  • DrawTextEx

    The DrawTextEx function draws formatted text in the specified rectangle.

    VB4-32,5,6
    Declare Function DrawTextEx Lib "user32" Alias "DrawTextExA" (ByVal hDC As Long, ByVal lpsz As String, ByVal n As Long, lpRect As RECT, ByVal un As Long, lpDrawTextParams As DRAWTEXTPARAMS) As Long

    VB.NET
    System.Drawing.Graphics.DrawString

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

    Library
    User32

    Parameter Information
    · hdc
    Identifies the device context to draw in.

    · lpchText
    Points to the string to draw. The string must be null-terminated if the cchText parameter is -1.

    · cchText
    Specifies the length, in characters, of the string specified by the lpchText parameter. If the string is null-terminated, this parameter can be -1 to calculate the length.

    · lprc
    Points to a RECT structure that contains the rectangle, in logical coordinates, in which the text is to be formatted.

    · dwDTFormat
    Specifies formatting options. This parameter can be one or more of these values:
    DT_BOTTOM
    Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE.
    DT_CALCRECT
    Determines the width and height of the rectangle. If there are multiple lines of text, DrawTextEx uses the width of the rectangle pointed to by the lprc parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawTextEx modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawTextEx returns the height of the formatted text, but does not draw the text.
    DT_CENTER
    Centers text horizontally in the rectangle.
    DT_EDITCONTROL
    Duplicates the text-displaying characteristics of a multiline edit control. Specifically, the average character width is calculated in the same manner as for an edit control, and the function does not display a partially visible last line.
    DT_END_ELLIPSIS or DT_PATH_ELLIPSIS
    Replaces part of the given string with ellipses, if necessary, so that the result fits in the specified rectangle. The given string is not modified unless the DT_MODIFYSTRING flag is specified.
    You can specify DT_END_ELLIPSIS to replace characters at the end of the string, or DT_PATH_ELLIPSIS to replace characters in the middle of the string. If the string contains backslash (\) characters, DT_PATH_ELLIPSIS preserves as much as possible of the text after the last backslash.
    DT_EXPANDTABS
    Expands tab characters. The default number of characters per tab is eight.
    DT_EXTERNALLEADING
    Includes the font external leading in line height. Normally, external leading is not included in the height of a line of text.
    DT_LEFT
    Aligns text to the left.
    DT_MODIFYSTRING
    Modifies the given string to match the displayed text. This flag has no effect unless the DT_END_ELLIPSIS or DT_PATH_ELLIPSIS flag is specified.
    DT_NOCLIP
    Draws without clipping. DrawTextEx is somewhat faster when DT_NOCLIP is used.
    DT_NOPREFIX
    Turns off processing of prefix characters. Normally, DrawTextEx interprets the ampersand (&) mnemonic-prefix character as a directive to underscore the character that follows, and the double ampersand (&&) mnemonic-prefix characters as a directive to print a single ampersand. By specifying DT_NOPREFIX, this processing is turned off.
    DT_RIGHT
    Aligns text to the right.
    DT_RTLREADING
    Layout in right to left reading order for bi-directional text when the font selected into the hdc is a Hebrew or Arabic font. The default reading order for all text is left to right.
    DT_SINGLELINE
    Displays text on a single line only. Carriage returns and linefeeds do not break the line.
    DT_TABSTOP
    Sets tab stops. The DRAWTEXTPARAMS structure pointed to by the lpDTParams parameter specifies the number of average character widths per tab stop.
    DT_TOP
    Top justifies text (single line only).
    DT_VCENTER
    Centers text vertically (single line only).
    DT_WORDBREAK
    Breaks words. Lines are automatically broken between words if a word extends past the edge of the rectangle specified by the lprc parameter. A carriage return-linefeed sequence also breaks the line.

    · dwDTParams
    Points to a DRAWTEXTPARAMS structure that specifies additional formatting options. This parameter can be NULL.

    Return Values
    If the function succeeds, the return value is the text height.

    If the function fails, the return value is zero.
    Wednesday, June 13, 2007 6:58 PM
  • DsBrowseForContainer

    The DsBrowseForContainer function sets up and displays a simple dialog box with which users can scope parts of Active Directory™. The dialog box displays a simple container picker which is either populated with containers from a particular root or which uses trusted domains. If it uses trusted domains, it can use either the domain that the user is currently logged in to, or it can use a domain that the user has specified. The user can specify a caption, title, root, and, optionally, an expansion path for the dialog box to be expanded to. Upon exiting, the path and object class of the selected object is returned. The dialog box also supports a callback to allow the user to override some of the default behaviors or to provide extra filtering.

    VB4-32,5,6
    Declare Function DsBrowseForContainer Lib "dsuiext" Alias "DsBrowseForContainerA" (pInfo As DSBROWSEINFO) As Long

    Operating Systems Supported
    Requires Windows 2000 (or Windows NT 4.0 SP6a or later with DSClient); Requires Windows 95/98 (with IE 4.01 or later and DSClient). Not supported on Windows Me

    Library
    Dsuiext

    Parameter Information
    · pInfo
    [in] A pointer to the DSBROWSEINFO structure.

    Return Values
    The function returns the following values.
    -1 There is an error.
    IDCANCEL The user clicked the CANCEL button in the dialog box.
    IDOK The user clicked the OK button in the dialog box.
    Wednesday, June 13, 2007 6:58 PM
  • DuplicateIcon

    The DuplicateIcon function creates a duplicate of a specified icon.

    VB4-32,5,6
    Declare Function DuplicateIcon Lib "shell32.dll" (ByVal hInst As Long, ByVal hIcon As Long) As Long

    VB.NET
    System.Drawing.Icon.Clone

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

    Library
    Shell32

    Parameter Information
    · hInst
    [in] This parameter is not used; it can be NULL.

    · hIcon
    [in] Handle to the icon to be duplicated.

    Return Values
    If successful, the function returns the handle to the new icon that was created. If unsuccessful, it returns NULL.
    Wednesday, June 13, 2007 6:59 PM
  • Ellipse

    The Ellipse function draws an ellipse. The center of the ellipse is the center of the specified bounding rectangle. The ellipse is outlined by using the current pen and is filled by using the current brush.

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

    VB.NET
    System.Drawing.Graphics.Ellipse

    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 bounding rectangle.

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

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

    · nBottomRect
    Specifies the y-coordinate of the lower-right corner of the bounding 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.
    Wednesday, June 13, 2007 7:02 PM
  • Ellipse

    The Ellipse function draws an ellipse. The center of the ellipse is the center of the specified bounding rectangle. The ellipse is outlined by using the current pen and is filled by using the current brush.

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

    VB.NET
    System.Drawing.Graphics.Ellipse

    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 bounding rectangle.

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

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

    · nBottomRect
    Specifies the y-coordinate of the lower-right corner of the bounding 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.
    Wednesday, June 13, 2007 7:05 PM
  • EmptyClipboard

    The EmptyClipboard function empties the clipboard and frees handles to data in the clipboard. The function then assigns ownership of the clipboard to the window that currently has the clipboard open.

    VB4-32,5,6
    Declare Function EmptyClipboard Lib "user32" Alias "EmptyClipboard" () 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

    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.
    Wednesday, June 13, 2007 7:05 PM
  • EnableWindow

    The EnableWindow function enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.

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

    VB.NET
    System.Windows.Forms.Form.Enabled

    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 enabled or disabled.

    · bEnable
    Specifies whether to enable or disable the window. If this parameter is TRUE, the window is enabled. If the parameter is FALSE, the window is disabled.

    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.
    Wednesday, June 13, 2007 7:06 PM
  • PathCanonicalize

    Canonicalizes a path.

    VB4-32,5,6
    Declare Function PathCanonicalize Lib "shlwapi.dll" Alias "PathCanonicalizeA" (ByVal pszBuf As String, ByVal pszPath As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · lpszDst
    Address of a string that receives the canonicalized path. The size of this buffer should be set to MAX_PATH to ensure that it is large enough to hold the returned string..

    · lpszSrc
    Address of the path to be canonicalized.

    Return Values
    Returns TRUE if successful, or FALSE otherwise.

    Thursday, June 14, 2007 2:03 AM
  • PathCombine

    Concatenates two strings that represent properly formed paths into one path, as well as any relative path pieces.

    VB4-32,5,6
    Declare Function PathCombine Lib "shlwapi.dll" Alias "PathCombineA" (ByVal szDest As String, ByVal lpszDir As String, ByVal lpszFile As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · lpszDest
    [out] Pointer to a buffer with the NULL-terminated string to hold the combined path string. The size of this buffer should be set to MAX_PATH to ensure that it is large enough to hold the returned string.

    · lpszDir
    [in]Address of the string that represents the directory path.

    · lpszFile
    [in]Address of the string that represents the file path.

    Return Values
    Returns a pointer to a string with the concatenated path if successful, or NULL otherwise

    Thursday, June 14, 2007 2:04 AM
  • PathCommonPrefix

    Compares two paths to determine if they share a common prefix. A prefix is one of these types: "C:\\", ".", "..", "..\\".

    VB4-32,5,6
    Declare Function PathCommonPrefix Lib "shlwapi.dll" Alias "PathCommonPrefixA" (ByVal pszFile1 As String, ByVal pszFile2 As String, ByVal achPath As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · pszFile1
    [in] Address of the first path name.

    · pszFile2
    [in] Address of the second path name.

    · pszPath
    [out] Address of a buffer that receives the common prefix. If there is no common prefix, it will be set to NULL.

    Return Values
    Returns the count of common prefix characters in the path. If the output buffer pointer is not NULL, then these characters are copied to the output buffer.

    Thursday, June 14, 2007 2:04 AM
  • PathCompactPath

    Truncates a file path to fit within a given pixel width by replacing path components with ellipses.

    VB4-32,5,6
    Declare Function PathCompactPath Lib "shlwapi.dll" Alias "PathCompactPathA" (ByVal hDC As Long, ByVal pszPath As String, ByVal dx As Long) As Long

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

    Library
    Shlwapi

    Parameter Information
    · hDC
    Handle to the device context used for font metrics.

    · lpszPath
    Address of a buffer containing the path string to be modified. The buffer must be at least MAX_PATH characters long. On return, this buffer will contain the modified string.

    · dx
    Width, in pixels, within which the string will be forced to fit.

    Return Values
    Returns TRUE if the path was successfully compacted to the specified width. Returns FALSE on failure, or if the base portion of the path would not fit the specified width

    Thursday, June 14, 2007 2:05 AM
  • PathCompactPathEx

    Truncates a path to fit within a certain number of characters by replacing path components with ellipses.

    VB4-32,5,6
    Declare Function PathCompactPathEx Lib "shlwapi.dll" Alias "PathCompactPathExA" (ByVal pszOut As String, ByVal pszSrc As String, ByVal cchMax As Long, ByVal dwFlags As Long) As Long

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

    Library
    Shlwapi

    Parameter Information
    · pszOut
    [out] Address of the string that has been altered.

    · pszSrc
    [in] Address of the string to be altered.

    · cchMax
    [in] Maximum number of characters to be contained in the new string, including the terminating NULL character. For example, if cchMax = 8, the resulting string can contain a maximum of 7 characters plus the NULL terminator.

    · dwFlags
    Reserved.

    Return Values
    Returns TRUE if successful, or FALSE otherwise

    Thursday, June 14, 2007 2:05 AM
  • PathCreateFromUrl

    Takes a file URL and converts it to a DOS path.

    VB4-32,5,6
    Private Declare Sub PathCreateFromUrl Lib "shlwapi.dll" Alias "PathCreateFromUrlA" (ByVal pszUrl As String, ByVal pszPath As String, ByRef pcchPath As Long, ByVal dwFlags As Long)

    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
    · pszUrl
    Pointer to the string with the URL.

    · pszPath
    Value used to return the DOS path. The size of this buffer should be set to MAX_PATH to ensure that it is large enough to hold the returned string.

    · pcchPath
    Length of pszPath.

    · dwReserved
    Reserved. Set this parameter to NULL.

    Return Values
    Returns S_OK if successful, or a standard OLE error value otherwise

    Thursday, June 14, 2007 2:06 AM
  • PathFileExists

    Determines if a file exists.

    VB4-32,5,6
    Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long

    VB.NET
    System.IO.File.Exists

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

    Library
    Shlwapi

    Parameter Information
    · pszPath
    Address of the file to verify.

    Return Values
    Returns TRUE if the file exists, or FALSE otherwise.

    Thursday, June 14, 2007 2:06 AM
  • PathFindOnPath

    Searches for a file.

    VB4-32,5,6
    Declare Function PathFindOnPath Lib "shlwapi.dll" Alias "PathFindOnPathA" (ByVal pszPath As String, ByVal ppszOtherDirs As String) As Boolean

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

    Library
    Shlwapi

    Parameter Information
    · pszFile
    File name for which to search. If the search is successful, this parameter is used to return the fully qualified path name.

    · ppszOtherDirs
    Optional null-terminated array of directories to be searched first.

    Return Values
    Returns TRUE if successful, or FALSE otherwise.

    Thursday, June 14, 2007 2:19 AM
  • PathGetCharType

    Determines the type of character with respect to a path.

    VB4-32,5,6
    Declare Function PathGetCharType Lib "shlwapi.dll" Alias "PathGetCharTypeA" (ByVal ch As Byte) As Long

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

    Library
    Shlwapi

    Parameter Information
    · ch
    Character for which to determine the type.

    Return Values
    Returns one or more of the following values that define the type of character:
    GCT_INVALID The character is not valid in a path.
    GCT_LFNCHAR The character is valid in a long file name.
    GCT_SEPARATOR The character is a path separator.
    GCT_SHORTCHAR The character is valid in a short (8.3) file name.
    GCT_WILD The character is a wildcard character.

    Thursday, June 14, 2007 2:20 AM
  • PathGetDriveNumber

    Searches a path for a drive letter within the range of 'A' to 'Z' and returns the corresponding drive number.

    VB4-32,5,6
    Declare Function PathGetDriveNumber Lib "shlwapi.dll" Alias "PathGetDriveNumberA" (ByVal pszPath As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · lpsz
    Address of a string that contains the path to be searched.

    Return Values
    Returns 0 through 25 (corresponding to 'A' through 'Z') if the path has a drive letter, or -1 otherwise.

    Thursday, June 14, 2007 2:20 AM
  • PathIsDirectory

    Verifies that a path is a valid directory.

    VB4-32,5,6
    Declare Function PathIsDirectory Lib "shlwapi.dll" Alias "PathIsDirectoryA" (ByVal pszPath As String) As Long

    VB.NET
    System.IO.Directory.Exists

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

    Library
    Shlwapi

    Parameter Information
    · pszPath
    Address of the path to verify.

    Return Values
    Returns TRUE if the path is a valid directory, or FALSE otherwise.

    Thursday, June 14, 2007 2:21 AM
  • PathIsDirectoryEmpty

    Determines whether or not a specified path is an empty directory.

    VB4-32,5,6
    Declare Function PathIsDirectoryEmpty Lib "shlwapi.dll" Alias "PathIsDirectoryEmptyA" (ByVal pszPath As String) As Long

    VB.NET
    System.IO.Directory.GetFileSystemEntries.Length = 0

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

    Library
    Shlwapi

    Parameter Information
    · pszPath
    [in] NULL-terminated string with the path to be tested.

    Return Values
    Returns TRUE if pszPath is an empty directory. Returns FALSE if pszPath is not a directory, or if it contains at least one file other than "." or "..".
    Thursday, June 14, 2007 2:21 AM
  • PathIsLFNFileSpec

    Determines whether or not a file name is in long format.

    VB4-32,5,6
    Declare Function PathIsLFNFileSpec Lib "shlwapi.dll" Alias "PathIsLFNFileSpecA" (ByVal lpName As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · pszName
    [in] NULL-terminated string with the file name to be tested.

    Return Values
    Returns TRUE if pszName exceeds the number of characters allowed by the 8.3 format, or FALSE otherwise.

    Thursday, June 14, 2007 2:28 AM
  • PathIsNetworkPath

    Determines whether a path string represents a network resource.

    VB4-32,5,6
    Declare Function PathIsNetworkPath Lib "shlwapi.dll" Alias "PathIsNetworkPathA" (ByVal pszPath As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · pszPath
    [in] NULL-terminated string that contains the path.

    Return Values
    Returns TRUE if the string represents a network resource, or FALSE otherwise.
    Thursday, June 14, 2007 2:29 AM
  • PathIsPrefix

    Searches a path to determine if it contains a valid prefix of the type passed by pszPrefix. A prefix is one of these types: "C:\\", ".", "..", "..\\".

    VB4-32,5,6
    Declare Function PathIsPrefix Lib "shlwapi.dll" Alias "PathIsPrefixA" (ByVal pszPrefix As String, ByVal pszPath As String) As Long

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

    Library
    Shlwapi

    Parameter Information
    · pszPrefix
    Address of the prefix for which to search.

    · pszPath
    Address of the path to be searched.

    Return Values
    Returns TRUE if the compared path is the full prefix for the path, or FALSE otherwise.
    Thursday, June 14, 2007 2:30 AM
  • EncryptFile

    The EncryptFile function encrypts a file or directory. All data streams in a file are encrypted. All new files created in an encrypted directory are encrypted.

    VB4-32,5,6
    Declare Function EncryptFile Lib "ADVAPI32" Alias "EncryptFileA" (ByVal lpFileName As String) As Boolean

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

    Library
    Advapi32

    Parameter Information
    · lpFileName
    [in] Pointer to a null-terminated string that specifies the name of the file or directory to encrypt.
    The caller must have FILE_READ_DATA, FILE_WRITE_DATA, FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES, and SYNCHRONIZE 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.
    Thursday, June 14, 2007 6:28 AM
  • EncryptFile

    The EncryptFile function encrypts a file or directory. All data streams in a file are encrypted. All new files created in an encrypted directory are encrypted.

    VB4-32,5,6
    Declare Function EncryptFile Lib "ADVAPI32" Alias "EncryptFileA" (ByVal lpFileName As String) As Boolean

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

    Library
    Advapi32

    Parameter Information
    · lpFileName
    [in] Pointer to a null-terminated string that specifies the name of the file or directory to encrypt.
    The caller must have FILE_READ_DATA, FILE_WRITE_DATA, FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES, and SYNCHRONIZE 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.
    Thursday, June 14, 2007 6:28 AM
  • EndDeferWindowPos

    The EndDeferWindowPos function simultaneously updates the position and size of one or more windows in a single screen-refreshing cycle.

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

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

    Library
    User32

    Parameter Information
    · hWinPosInfo
    Identifies a multiple-window - position structure that contains size and position information for one or more windows. This internal structure is returned by the BeginDeferWindowPos function or by the most recent call to the DeferWindowPos function.

    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.
    Thursday, June 14, 2007 6:29 AM
  • EndDoc

    The EndDoc function ends a print job. This function replaces the ENDDOC printer escape.

    VB4-32,5,6
    Declare Function EndDoc Lib "gdi32" Alias "EndDoc" (ByVal hdc 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 for the print job.

    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.
    Thursday, June 14, 2007 6:29 AM
  • EndMenu

    The EndMenu function ends the calling thread's active menu.

    VB4-32,5,6
    Declare Function EndMenu Lib "user32.dll" () As Long

    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 nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Thursday, June 14, 2007 6:29 AM
  • EndPage

    The EndPage function informs the device that the application has finished writing to a page. This function is typically used to direct the device driver to advance to a new page. This function replaces the NEWFRAME printer escape.

    VB4-32,5,6
    Declare Function EndPage Lib "gdi32" Alias "EndPage" (ByVal hdc 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 for the print job.

    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.
    Thursday, June 14, 2007 6:30 AM
  • EndPath

    The EndPath function closes a path bracket and selects the path defined by the bracket into the specified device context.

    VB4-32,5,6
    Declare Function EndPath Lib "gdi32" Alias "EndPath" (ByVal hdc 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 into which the new path is selected.

    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. GetLastError may return one of the following error codes:
    ERROR_CAN_NOT_COMPLETE
    ERROR_INVALID_PARAMETER
    Thursday, June 14, 2007 6:30 AM
  • EnumChildWindows

    The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE.

    VB4-32,5,6
    Declare Function EnumChildWindows Lib "user32" Alias "EnumChildWindows" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long

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

    Library
    User32

    Parameter Information
    · hWndParent
    Identifies the parent window whose child windows are to be enumerated.

    · lpEnumFunc
    Points to an application-defined callback function. For more information about the callback function, see the EnumChildProc callback function.

    · lParam
    Specifies a 32-bit, application-defined value to be passed to the callback function.

    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.
    Thursday, June 14, 2007 6:30 AM
  • EnumDesktops

    The EnumDesktops function enumerates all desktops in the window station assigned to the calling process. The function does so by passing the name of each desktop, in turn, to an application-defined callback function.

    VB4-32,5,6
    Declare Function EnumDesktops Lib "user32" Alias "EnumDesktopsA" (ByVal hwinsta As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long

    Operating Systems Supported
    Requires Windows NT 3.5(1) or later; Win9x/ME: Not supported

    Library
    User32

    Parameter Information
    · hwinsta
    Specifies the handle to the window station whose desktops are to be enumerated. The CreateWindowStation, GetProcessWindowStation, and OpenWindowStation functions return a window station handle.

    · lpEnumFunc
    Points to an application-defined EnumDesktopProc callback function.

    · dwDesiredAccess
    Specifies a 32-bit application-defined value to be passed to the callback function.

    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.
    Thursday, June 14, 2007 6:31 AM
  • EnumDisplayDevices

    The EnumDisplayDevices function lets you obtain information about the display devices in a system.

    VB4-32,5,6
    Declare Function EnumDisplayDevices Lib "user32" Alias "EnumDisplayDevicesA" (Unused As Any, ByVal iDevNum As Long, lpDisplayDevice As DISPLAY_DEVICE, ByVal dwFlags As Long) As Boolean

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

    Library
    User32

    Parameter Information
    · Unused
    This parameter is not used and should be set to NULL.

    · iDevNum
    [in] Index value that specifies the display device of interest.
    The operating system identifies each display device with an index value. The index values are consecutive integers, starting at 0. If a system has three display devices, for example, they are specified by the index values 0, 1, and 2.

    · lpDisplayDevice
    [out] Pointer to a DISPLAY_DEVICE structure that receives information about the display device specified by iDevNum.
    Before calling EnumDisplayDevices, you must initialize the cb member of DISPLAY_DEVICE to the size, in bytes, of DISPLAY_DEVICE.

    · dwFlags
    This parameter is currently not used and should be set to zero.

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

    If the function fails, the return value is zero. The function fails if iDevNum is greater than the largest device index.
    Thursday, June 14, 2007 6:31 AM
  • EnumDisplayMonitors

    The EnumDisplayMonitors function enumerates display monitors (including invisible pseudo-monitors associated with the mirroring drivers) that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context. EnumDisplayMonitors calls an application-defined MonitorEnumProc callback function once for each monitor that is enumerated. Note that GetSystemMetrics(SM_CMONITORS) counts only the display monitors.

    VB4-32,5,6
    Declare Function EnumDisplayMonitors Lib "user32.dll" (ByVal hdc As Long, ByRef lprcClip As Any, ByVal lpfnEnum As Long, ByVal dwData As Long) As Long

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

    Library
    User32

    Parameter Information
    · hdc
    [in] Handle to a display device context that defines the visible region of interest.
    If this parameter is NULL, the hdcMonitor parameter passed to the callback function will be NULL, and the visible region of interest is the virtual screen that encompasses all the displays on the desktop.

    · lprcClip
    [in] Pointer to a RECT structure that specifies a clipping rectangle. The region of interest is the intersection of the clipping rectangle with the visible region specified by hdc.
    If hdc is non-NULL, the coordinates of the clipping rectangle are relative to the origin of the hdc. If hdc is NULL, the coordinates are virtual-screen coordinates.

    This parameter can be NULL if you don't want to clip the region specified by hdc.

    · lpfnEnum
    [in] Pointer to a MonitorEnumProc application-defined callback function.

    · dwData
    [in] Application-defined data that EnumDisplayMonitors passes directly to the MonitorEnumProc function.

    Return Values
    TRUE indicates success. FALSE indicates failure, or that lpfnEnum is NULL. To get extended error information, call GetLastError. When lpfnEnum is NULL, GetLastError returns ERROR_INVALID_PARAMETER.
    Thursday, June 14, 2007 6:31 AM
  • EnumDisplaySettings

    The EnumDisplaySettings function obtains information about one of a display device’s graphics modes. You can obtain information for all of a display device’s graphics modes by making a series of calls to this function.

    VB4-32,5,6
    Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As Boolean

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

    Library
    User32

    Parameter Information
    · lpszDeviceName
    Pointer to a null-terminated string that specifies the display device whose graphics mode the function will obtain information about.
    This parameter can be NULL. A NULL value specifies the current display device on the computer that the calling thread is running on.
    If lpszDeviceName is not NULL, the string must be of the form \\.\DisplayX, where X can have the values 1, 2, or 3.
    Windows 95: lpszDeviceName must be NULL.

    · iModeNum
    Index value that specifies the graphics mode for which information is to be obtained.
    Graphics mode indexes start at zero. To obtain information for all of a display device’s graphics modes, make a series of calls to EnumDisplaySettings, as follows: Set iModeNum to zero for the first call, and increment iModeNum by one for each subsequent call. Continue calling the function until the return value is FALSE.
    When you call EnumDisplaySettings with iModeNum set to zero, the operating system initializes and caches information about the display device. When you call EnumDisplaySettings with iModeNum set to a non-zero value, the function returns the information that was cached the last time the function was called with iModeNum set to zero.

    · lpDevMode
    Pointer to a DEVMODE structure into which the function stores information about the specified graphics mode.
    The EnumDisplaySettings function sets values for the following five DEVMODE members:
    dmBitsPerPel
    dmPelsWidth
    dmPelsHeight
    dmDisplayFlags
    dmDisplayFrequency

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

    If the function fails, the return value is zero.

    The function fails if iModeNum is greater than the index of the display device’s last graphics mode. As noted in the description of the iModeNum parameter, you can use this behavior to enumerate all of a display device’s graphics modes.
    Thursday, June 14, 2007 6:32 AM
  • EnumFontFamilies

    The EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device. This function supersedes the EnumFonts function.

    VB4-32,5,6
    Declare Function EnumFontFamilies Lib "gdi32" Alias "EnumFontFamiliesA" (ByVal hdc As Long, ByVal lpszFamily As String, ByVal lpEnumFontFamProc As Long, ByVal lParam As Long) As Long

    VB.NET
    System.Drawing.Text.FontCollection.Families

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

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · lpszFamily
    Points to a null-terminated string that specifies the family name of the desired fonts. If lpszFamily is NULL, EnumFontFamilies randomly selects and enumerates one font of each available type family.

    · lpEnumFontFamProc
    Specifies the procedure-instance address of the application-defined callback function. For information about the callback function, see the EnumFontFamProc function.

    · lParam
    Points to application-supplied data. The data is passed to the callback function along with the font information.

    Return Values
    If the function succeeds, the return value is the last value returned by the callback function. Its meaning is implementation specific.
    Thursday, June 14, 2007 6:32 AM
  • EnumFontFamiliesEx

    The EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics specified by the LOGFONT structure. EnumFontFamiliesEx enumerates fonts based on typeface name, character set, or both.

    VB4-32,5,6
    Declare Function EnumFontFamiliesEx Lib "gdi32" Alias "EnumFontFamiliesExA" (ByVal hdc As Long, lpLogFont As LOGFONT, ByVal lpEnumFontProc As Long, ByVal lParam As Long, ByVal dw As Long) As Long

    VB.NET
    System.Drawing.Text.FontCollection.Families

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

    Library
    Gdi32

    Parameter Information
    · hdc
    Identifies the device context.

    · lpLogfont
    Points to a LOGFONT structure that contains information about the fonts to enumerate. The function examines these members:
    lfCharset
    If set to DEFAULT_CHARSET, the function enumerates all fonts in all character sets. If set to a valid character set value, the function enumerates only fonts in the specified character set.
    lfFaceName
    If set to an empty string, the function enumerates one font in each available typeface name. If set to a valid typeface name, the function enumerates all fonts with the specified name.
    lfPitchAndFamily
    Must be set to zero for all language versions of the operating system except Hebrew and Arabic. For these languages, set IfPitchAndFamily to MONO_FONT to enumerate only fonts that provide all codepage characters within the font.

    · lpEnumFontFamExProc
    Points to the application-defined callback function. For more information about the callback function, see the EnumFontFamExProc function.

    · lParam
    Specifies a 32-bit application-defined value. The function passes this value to the callback function along with font information.

    · dwFlags
    Reserved; must be zero.

    Return Values
    If the function succeeds, the return value is the last value returned by the callback function. This value depends on which font families are available for the specified device.
    Thursday, June 14, 2007 6:32 AM
  • EnumPorts

    The EnumPorts function enumerates the ports that are available for printing on a specified server.

    VB4-32,5,6
    Declare Function EnumPorts Lib "winspool.drv" Alias "EnumPortsA" (ByVal pName As String, ByVal Level As Long, ByVal lpbPorts As Long, ByVal cbBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long

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

    Library
    Winspool.drv

    Parameter Information
    · pName
    Pointer to a null-terminated string that specifies the name of the server whose printer ports you wish to enumerate.
    If pName is NULL, the function enumerates the local machine’s printer ports.

    · Level
    Specifies the type of data structures pointed to by pPorts.
    This value can be 1 or 2.

    · pPorts
    Pointer to a buffer that receives an array of PORT_INFO_1 or PORT_INFO_2 structures. Each structure contains data that describes an available printer port. The value of Level specifies the type of structure. A Level value of 1 specifies PORT_INFO_1 structures. A Level value of 2 specifies PORT_INFO_2 structures.

    · cbBuf
    Specifies the size, in bytes, of the buffer pointed to by pPorts.

    · pcbNeeded
    Pointer to a variable that the function sets to the size, in bytes, of the data that enumerates the printer ports. If cbBuf is smaller than this value, EnumPorts fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and the variable pointed to by pcbNeeded represents the required buffer size. If cbBuf is equal to or greater than this value, the variable pointed to by pcbNeeded represents the number of bytes stored into the buffer.

    · pcReturned
    Pointer to a variable that the function sets to the number of PORT_INFO_* structures that it stores into the buffer pointed to by pPorts. This is the number of printer ports that are available on the specified server.

    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.
    Thursday, June 14, 2007 6:34 AM
  • EnumPrinters

    The EnumPrinters function enumerates available printers, print servers, domains, or print providers.

    VB4-32,5,6
    Declare Function EnumPrinters Lib "winspool.drv" Alias "EnumPrintersA" (ByVal flags As Long, ByVal name As String, ByVal Level As Long, pPrinterEnum As Byte, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long

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

    Library
    Winspool.drv

    Parameter Information
    · Flags
    Specifies the types of print objects that the function should enumerate. This value can be a combination of the following constants:
    PRINTER_ENUM_LOCAL
    The function ignores the Name parameter, and enumerates the locally installed printers.
    Windows 95: The function will also enumerate network printers because they are handled by the local print provider.
    PRINTER_ENUM_NAME
    The function enumerates the printer identified by Name. This can be a server, a domain, or a print provider. If Name is NULL, the function enumerates available print providers.
    PRINTER_ENUM_SHARED
    The function enumerates printers that have the shared attribute. Cannot be used in isolation; use an OR operation to combine with another PRINTER_ENUM type.
    PRINTER_ENUM_DEFAULT
    Windows 95 only: The function returns information about the default printer.
    PRINTER_ENUM_CONNECTIONS
    Windows NT only: The function enumerates the list of printers to which the user has made previous connections.
    PRINTER_ENUM_NETWORK
    Windows NT only: The function enumerates network printers in the computer’s domain. This value is valid only if Level is 1.
    PRINTER_ENUM_REMOTE
    Windows NT only: The function enumerates network printers and print servers in the computer’s domain. This value is valid only if Level is 1.

    If Level is 4, you can only use the PRINTER_ENUM_CONNECTIONS and PRINTER_ENUM_LOCAL constants.

    · Name
    If Level is 1, Flags contains PRINTER_ENUM_NAME, and Name is non-NULL, Name points to a null-terminated string that specifies the name of the object to enumerate. This string can be the name of a server, a domain, or a print provider.
    If Level is 1, Flags contains PRINTER_ENUM_NAME, and Name is NULL, the function enumerates the available print providers.
    If Level is 1, Flags contains PRINTER_ENUM_REMOTE, and Name is NULL, the function enumerates the printers in the user’s domain.
    If Level is 2 or 5, Name points to a null-terminated string that specifies the name of a server whose printers are to be enumerated. If this string is NULL, the function enumerates the printers installed on the local machine.
    If Level is 4, Name should be NULL. The function always queries on the local machine.
    When Name is NULL, it enumerates printers that are installed on the local machine. These printers include those that are physically attached to the local machine as well as remote printers to which it has a network connection.

    · Level
    Specifies the type of data structures pointed to by pPrinterEnum. Valid values are 1, 2, 4, and 5, which correspond to the PRINTER_INFO_1, PRINTER_INFO_2, PRINTER_INFO_4, and PRINTER_INFO_5 data structures.
    Windows 95: The value can be 1, 2, or 5.
    Windows NT: This value can be 1, 2, 4, or 5.

    · pPrinterEnum
    Pointer to a buffer that receives an array of PRINTER_INFO_1, PRINTER_INFO_2, PRINTER_INFO_4, or PRINTER_INFO_5 structures. Each structure contains data that describes an available print object. If Level is 1, the array contains PRINTER_INFO_1 structures. If Level is 2, the array contains PRINTER_INFO_2 structures. If Level is 4, the array contains PRINTER_INFO_4 structures. If Level is 5, the array contains PRINTER_INFO_5 structures.
    Windows 95: The buffer cannot receive PRINTER_INFO_4 structures. It can receive any of the other types.

    · cbBuf
    Specifies the size, in bytes, of the array pointed to by pPrinterEnum.

    · pcbNeeded
    Pointer to a value that receives the number of bytes copied if the function succeeds or the number of bytes required if cbBuf is too small.

    · pcReturned
    Pointer to a value that receives the number of PRINTER_INFO_1, PRINTER_INFO_2, PRINTER_INFO_4, or PRINTER_INFO_5 structures that the function returns in the array to which pPrinterEnum points.

    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.
    Thursday, June 14, 2007 6:34 AM
  • EnumProcesses

    The EnumProcesses function retrieves the process identifier for each process object in the system.

    VB4-32,5,6
    Declare Function EnumProcesses Lib "PSAPI.DLL" (ByRef lpidProcess As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long

    VB.NET
    System.Diagnostics.Process

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

    Library
    Psapi

    Parameter Information
    · lpidProcess
    [out] Pointer to an array that receives the list of process identifiers.

    · cb
    [in] Specifies the size, in bytes, of the lpidProcess array.

    · cbNeeded
    [out] Receives the number of bytes returned in the lpidProcess array.

    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.
    Thursday, June 14, 2007 6:34 AM
  • EnumProcessModules

    The EnumProcessModules function retrieves a handle for each module in the specified process.

    VB4-32,5,6
    Declare Function EnumProcessModules Lib "PSAPI.DLL" (ByVal hProcess As Long, ByRef lphModule As Long, ByVal cb As Long, ByRef cbNeeded As Long) As Long

    VB.NET
    System.Diagnostics.Process.Modules

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

    Library
    Psapi

    Parameter Information
    · hProcess
    [in] Handle to the process.

    · lphModule
    [out] Pointer to the array that receives the list of module handles.

    · cb
    [in] Specifies the size, in bytes, of the lphModule array.

    · lpcbNeeded
    [out] Receives the number of bytes required to store all module handles in the lphModule array.

    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.
    Thursday, June 14, 2007 6:35 AM
  • numProps

    The EnumProps function enumerates all entries in the property list of a window by passing them, one by one, to the specified callback function. EnumProps continues until the last entry is enumerated or the callback function returns FALSE.

    VB4-32,5,6
    Declare Function EnumProps Lib "user32" Alias "EnumPropsA" (ByVal hWnd As Long, ByVal lpEnumFunc As Long) 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 enumerated.

    · lpEnumFunc
    Points to the callback function. For more information about the callback function, see the PropEnumProc function.

    Return Values
    The return value specifies the last value returned by the callback function. It is -1 if the function did not find a property for enumeration.
    Thursday, June 14, 2007 6:35 AM
  • EnumPropsEx

    The EnumPropsEx function enumerates all entries in the property list of a window by passing them, one by one, to the specified callback function. EnumPropsEx continues until the last entry is enumerated or the callback function returns FALSE.

    VB4-32,5,6
    Function EnumPropsEx Lib "user32" Alias "EnumPropsExA" (ByVal hWnd As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long

    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 whose property list is to be enumerated.

    · lpEnumFunc
    [in] Pointer to the callback function. For more information about the callback function, see the PropEnumProcEx function.

    · lParam
    [in] Contains application-defined data to be passed to the callback function.

    Return Values
    The return value specifies the last value returned by the callback function. It is -1 if the function did not find a property for enumeration.
    Thursday, June 14, 2007 6:35 AM
  • EnumResourceNames

    The EnumResourceNames function searches a module for each resource of the specified type and passes the name of each resource it locates to an application-defined callback function.

    VB4-32,5,6
    Declare Function EnumResourceNames Lib "kernel32" Alias "EnumResourceNamesA" (ByVal HModule As Long, ByVal lpType As resType, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long

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

    Library
    Kernel32

    Parameter Information
    · hModule
    Identifies the module whose executable file contains the resources for which the names are to be enumerated. If this parameter is NULL, the function enumerates the resource names in the module used to create the current process.

    · lpszType
    Points to a null-terminated string specifying the type name of the resource for which the name is being enumerated. For standard resource types, this parameter can be one of the following values:
    RT_ACCELERATOR
    Accelerator table
    RT_ANICURSOR
    Animated cursor
    RT_ANIICON
    Animated icon
    RT_BITMAP
    Bitmap resource
    RT_CURSOR
    Hardware-dependent cursor resource
    RT_DIALOG
    Dialog box
    RT_FONT
    Font resource
    RT_FONTDIR
    Font directory resource
    RT_GROUP_CURSOR
    Hardware-independent cursor resource
    RT_GROUP_ICON
    Hardware-independent icon resource
    RT_ICON
    Hardware-dependent icon resource
    RT_MENU
    Menu resource
    RT_MESSAGETABLE
    Message-table entry
    RT_PLUGPLAY
    Plug and play resource
    RT_RCDATA
    Application-defined resource (raw data)
    RT_STRING
    String-table entry
    RT_VERSION
    Version resource
    RT_VXD
    VXD

    · lpEnumFunc
    Points to the callback function to be called for each enumerated resource name. For more information, see the EnumResNameProc function.

    · lParam
    Specifies an application-defined value passed to the callback function. This parameter can be used in error checking.

    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.
    Thursday, June 14, 2007 6:36 AM
  • EnumServicesStatus

    The EnumServicesStatus function enumerates services in the specified service control manager database. The name and status of each service are provided.

    VB4-32,5,6
    Declare Function EnumServicesStatus Lib "advapi32.dll" Alias "EnumServicesStatusA" (ByVal hSCManager As Long, ByVal dwServiceType As Long, ByVal dwServiceState As Long, lpServices As Any, ByVal cbBufSize As Long, pcbBytesNeeded As Long, lpServicesReturned As Long, lpResumeHandle As Long) As Long

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

    Library
    Advapi32

    Parameter Information
    · hSCManager
    [in] Handle to the service control manager database. The OpenSCManager function returns this handle, which must have SC_MANAGER_ENUMERATE_SERVICE access.

    · dwServiceType
    [in] Specifies the type of services to enumerate. This parameter can be one or more of the following values.
    SERVICE_WIN32
    Enumerates services of type SERVICE_WIN32_OWN_PROCESS and SERVICE_WIN32_SHARE_PROCESS.
    SERVICE_DRIVER
    Enumerates services of type SERVICE_KERNEL_DRIVER and SERVICE_FILE_SYSTEM_DRIVER.

    · dwServiceState
    [in] Specifies the services to enumerate based on their state. This parameter must be one of the following values. Value Meaning
    SERVICE_ACTIVE Enumerates services that are in the following states: SERVICE_START_PENDING, SERVICE_STOP_PENDING, SERVICE_RUNNING, SERVICE_CONTINUE_PENDING, SERVICE_PAUSE_PENDING, and SERVICE_PAUSED.
    SERVICE_INACTIVE Enumerates services that are in the SERVICE_STOPPED state.
    SERVICE_STATE_ALL Combines the following states: SERVICE_ACTIVE and SERVICE_INACTIVE.

    · lpServices
    [out] Pointer to a buffer that contains an array of ENUM_SERVICE_STATUS structures that receive the name and service status information for each service in the database. The buffer must be large enough to hold the structures, plus the strings to which their members point.

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

    · pcbBytesNeeded
    [out] Pointer to a variable that receives the number of bytes needed to return the remaining service entries.

    · lpServicesReturned
    [out] Pointer to a variable that receives the number of service entries returned.

    · lpResumeHandle
    [in/out] Pointer to a variable that, on input, specifies the starting point of enumeration. You must set this value to zero the first time this function is called. On output, this value is zero if the function succeeds. However, if the function returns zero and the GetLastError function returns ERROR_MORE_DATA, this value is used to indicate the next service entry to be read when the function is called to retrieve the additional data.

    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.
    Thursday, June 14, 2007 6:36 AM
  • EnumThreadWindows

    The EnumThreadWindows function enumerates all nonchild windows associated with a thread by passing the handle of each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last window is enumerated or the callback function returns FALSE.

    VB4-32,5,6
    Declare Function EnumThreadWindows Lib "user32" Alias "EnumThreadWindows" (ByVal dwThreadId As Long, ByVal lpfn As Long, ByVal lParam As Long) As Long

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

    Library
    User32

    Parameter Information
    · dwThreadId
    Identifies the thread whose windows are to be enumerated.

    · lpfn
    Points to an application-defined callback function. For more information about the callback function, see the EnumThreadWndProc callback function.

    · lParam
    Specifies a 32-bit, application-defined value to be passed to the callback function.

    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.
    Thursday, June 14, 2007 6:36 AM
  • EnumWindows

    The EnumWindows function enumerates all top-level windows on the screen by passing the handle of each window, in turn, to an application-defined callback function. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE.

    VB4-32,5,6
    Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long

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

    Library
    User32

    Parameter Information
    · lpEnumFunc
    Points to an application-defined callback function. For more information, see the EnumWindowsProc callback function.

    · lParam
    Specifies a 32-bit, application-defined value to be passed to the callback function.

    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.
    Thursday, June 14, 2007 6:37 AM
  • EqualRgn

    The EqualRgn function checks the two specified regions to determine whether they are identical. The function considers two regions identical if they are equal in size and shape.

    VB4-32,5,6
    Declare Function EqualRgn Lib "gdi32" (ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long) As Long

    VB.NET
    System.Drawing.Region

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

    Library
    Gdi32

    Parameter Information
    · hSrcRgn1
    [in] Handle to a region.

    · hSrcRgn2
    [in] Handle to a region.

    Return Values
    If the two regions are equal, the return value is nonzero.

    If the two regions are not equal, the return value is zero. A return value of ERROR means at least one of the region handles is invalid.
    Thursday, June 14, 2007 6:37 AM
  • EqualSid

    The EqualSid function tests two security identifier (SID) values for equality. Two SIDs must match exactly to be considered equal.

    VB4-32,5,6
    Declare Function EqualSid Lib "advapi32.dll" (pSid1 As Byte, ByVal pSid2 As Long) As Long

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

    Library
    Advapi32

    Parameter Information
    · pSid1
    [in] Pointer to the first SID structure to compare. This structure is assumed to be valid.

    · pSid2
    [in] Pointer to the second SID structure to compare. It also is assumed to be valid.

    Return Values
    If the SID structures are equal, the return value is nonzero.

    If the SID structures are not equal, the return value is zero. To get extended error information, call GetLastError.

    If either SID structure is invalid, the return value is undefined.
    Thursday, June 14, 2007 6:37 AM
  • Escape

    The Escape function allows applications to access capabilities of a particular device not directly available through GDI. Escape calls made by an application are translated and sent to the driver.

    VB4-32,5,6
    Declare Function Escape Lib "gdi32" Alias "Escape" (ByVal hdc As Long, ByVal nEscape As Long, ByVal nCount As Long, ByVal lpInData As String, lpOutData As Any) 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.

    · nEscape
    Specifies the escape function to be performed. This parameter must be one of the predefined escape values. Use the ExtEscape function if your application defines a private escape value.

    · cbInput
    Specifies the number of bytes of data pointed to by the lpvInData parameter.

    · lpvInData
    Points to the input structure required for the specified escape.

    · lpvOutData
    Points to the structure that receives output from this escape. This parameter should be NULL if no data is returned.

    Return Values
    If the function succeeds, the return value is greater than zero, except with the QUERYESCSUPPORT printer escape, which checks for implementation only. If the escape is not implemented, the return value is zero.

    If the function fails, the return value is an error. To get extended error information, call GetLastError.
    Thursday, June 14, 2007 6:38 AM
  • ExitProcess

    The ExitProcess function ends a process and all its threads.

    VB4-32,5,6
    Declare Sub ExitProcess Lib "kernel32" Alias "ExitProcess" (ByVal uExitCode As Long)

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

    Library
    Kernel32

    Parameter Information
    · uExitCode
    Specifies the exit code for the process, and for all threads that are terminated as a result of this call. Use the GetExitCodeProcess function to retrieve the process’s exit value. Use the GetExitCodeThread function to retrieve a thread’s exit value.

    Return Values
    This function does not return a value.
    Thursday, June 14, 2007 6:38 AM
  • ExitThread

    The ExitThread function ends a thread.

    VB4-32,5,6
    Declare Sub ExitThread Lib "kernel32" Alias "ExitThread" (ByVal dwExitCode As Long)

    VB.NET
    System.Threading.Thread.Abort

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

    Library
    Kernel32

    Parameter Information
    · dwExitCode
    Specifies the exit code for the calling thread. Use the GetExitCodeThread function to retrieve a thread’s exit code.

    Return Values
    This function does not return a value.
    Thursday, June 14, 2007 6:38 AM
  • ExitWindowsEx

    The ExitWindowsEx function either logs off, shuts down, or shuts down and restarts the system.

    VB4-32,5,6
    Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

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

    Library
    User32

    Parameter Information
    · uFlags
    Specifies the type of shutdown. This parameter must be some combination of the following values:
    EWX_FORCE
    Forces processes to terminate. When this flag is set, Windows does not send the messages WM_QUERYENDSESSION and WM_ENDSESSION to the applications currently running in the system. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.
    EWX_LOGOFF
    Shuts down all processes running in the security context of the process that called the ExitWindowsEx function. Then it logs the user off.
    EWX_POWEROFF
    Shuts down the system and turns off the power. The system must support the power-off feature.
    Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
    Windows 95: Security privileges are not supported or required.
    EWX_REBOOT
    Shuts down the system and then restarts the system.
    Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
    Windows 95: Security privileges are not supported or required.
    EWX_SHUTDOWN
    Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.
    Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
    Windows 95: Security privileges are not supported or required.

    · dwReserved
    Reserved; this parameter is ignored.

    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.
    Thursday, June 14, 2007 6:39 AM
  • ExtFloodFill

    The ExtFloodFill function fills an area of the display surface with the current brush.

    VB4-32,5,6
    Declare Function ExtFloodFill Lib "gdi32" Alias "ExtFloodFill" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long, ByVal wFillType 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 a device context.

    · nXStart
    Specifies the logical x-coordinate of the point where filling is to begin.

    · nYStart
    Specifies the logical y-coordinate of the point where filling is to begin.

    · crColor
    Specifies the color of the boundary or of the area to be filled. The interpretation of crColor depends on the value of the fuFillType parameter.

    · fuFillType
    Specifies the type of fill operation to be performed. It must be one of the following values:
    FLOODFILLBORDER
    The fill area is bounded by the color specified by the crColor parameter. This style is identical to the filling performed by the FloodFill function.
    FLOODFILLSURFACE
    The fill area is defined by the color that is specified by crColor. Filling continues outward in all directions as long as the color is encountered. This style is useful for filling areas with multicolored boundaries.

    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.
    Thursday, June 14, 2007 6:39 AM
  • ExtractAssociatedIcon

    The ExtractAssociatedIcon function returns the handle of an indexed icon found in a file or an icon found in an associated executable file.

    VB4-32,5,6
    Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long

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

    Library
    Shell32

    Parameter Information
    · hInst
    Specifies the instance of the application calling the function.

    · lpIconPath
    Points to a string that specifies the full path and filename of the file for which an icon is desired. The function extracts the icon handle from that file, or from an executable file associated with that file.
    If the icon handle is obtained from an executable file, the function stores the full path and filename of that executable in the string pointed to by lpIconPath.

    · lpiIcon
    Points to a WORD that specifies the index of the icon whose handle is to be obtained.
    If the icon handle is obtained from an executable file, the function stores the icon’s identifier in the WORD pointed to by lpiIcon.

    Return Values
    If the function succeeds, the return value is an icon handle. If the icon is extracted from an associated executable file, the function stores the full path and filename of the executable file in the string pointed to by lpIconPath, and stores the icon’s identifier in the WORD pointed to by lpiIcon.

    If the function fails, the return value is NULL.
    Thursday, June 14, 2007 6:40 AM
  • ExtractIcon

    The ExtractIcon function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file.

    VB4-32,5,6
    Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long

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

    Library
    Shell32

    Parameter Information
    · hInst
    Identifies the instance of the application calling the function.

    · lpszExeFileName
    Points to a null-terminated string specifying the name of an executable file, DLL, or icon file.

    · nIconIndex
    Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1, the function returns the total number of icons in the specified file.

    Return Values
    If the function succeeds, the return value is the handle to an icon. If the file specified was not an executable file, DLL, or icon file, the retur
    Thursday, June 14, 2007 6:40 AM
  • ExtractIconEx

    The ExtractIconEx function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file.

    VB4-32,5,6
    Declare Function ExtractIconEx Lib "shell32.dll" Alias "ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Long, phiconLarge As Long, phiconSmall As Long, ByVal nIcons As Long) As Long

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

    Library
    Gdi32

    Parameter Information
    · lpszFile
    Pointer to a null-terminated string specifying the name of an executable file, DLL, or icon file.

    · nIconIndex
    Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1 and phIconLargeand phiconSmall are both NULL, the function returns the total number of icons in the specified file.

    · phiconLarge
    Pointer to an array of handles of large icons returned. This parameter can be NULL.

    · phiconSmall
    Pointer to an array of handles of small icons returned. This parameter can be NULL.

    · nIcons
    Specifies the count of the number of icons to extract.

    Return Values
    If the function succeeds, the return value is the handle to an icon. If the file specified was not an executable file, DLL, or icon file, the return value is 1. If no icons were found in the file, the return value is NULL.
    Thursday, June 14, 2007 6:40 AM
  • ExtTextOut

    The ExtTextOut function draws a character string by using the currently selected font. An optional rectangle may be provided, to be used for clipping, opaquing, or both.

    VB4-32,5,6
    Declare Function ExtTextOut Lib "gdi32" Alias "ExtTextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal wOptions As Long, lpRect As Rect, ByVal lpString As String, ByVal nCount As Long, lpDx As Long) As Long

    VB.NET
    System.Drawing.Graphics.DrawString

    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 logical x-coordinate of the reference point used to position the string.

    · Y
    Specifies the logical y-coordinate of the reference point used to position the string.

    · fuOptions
    Specifies how to use the application-defined rectangle. This parameter can be a combination of the following values:
    ETO_CLIPPED
    The text will be clipped to the rectangle.
    ETO_GLYPH_INDEX
    Windows 95 only: The lpString array refers to an array returned from GetCharacterPlacement and should be parsed directly by GDI as no further language-specific processing is required. Glyph indexing only applies to TrueType fonts, but the flag can be used for Windows bitmap and vector fonts to indicate no further language processing is necessary and GDI should process the string directly. Note that all glyph indices are 16-bit values even though the string is assumed to be an array of 8-bit values for raster fonts.
    ETO_OPAQUE
    The current background color should be used to fill the rectangle.
    ETO_RTLREADING
    Windows 95 only: If this value is specified and a Hebrew or Arabic font is selected into the device context, the string is output using right-to-left reading order. If this value is not specified, the string is output in left- to-right order. The same effect can be achieved by setting the TA_RTLREADING value in SetTextAlign. This value is preserved for backward compatability.

    The ETO_GLYPH_INDEX and ETO_RTLREADING values cannot be used together. Because ETO_GLYPH_INDEX implies that all language processing has been completed, the function ignores the ETO_RTLREADING flag if also specified.

    · lprc
    Points to an optional RECT structure that specifies the dimensions of a rectangle that is used for clipping, opaquing, or both.

    · lpString
    Points to the character string to be drawn. The string does not need to be zero-terminated, since cbCount specifies the length of the string.

    · cbCount
    Specifies the number of characters in the string.

    · lpDx
    Points to an optional array of values that indicate the distance between origins of adjacent character cells. For example, lpDxIdea logical units separate the origins of character cell i and character cell i + 1.

    Return Values
    If the string is drawn, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.
    Thursday, June 14, 2007 6:40 AM
  • Man I think we should another part for this thread, as the number increased more than 100, we will start new part.

    The next part for this thread is :

    API Programming and functions. - Part III


    Thursday, June 14, 2007 6:43 AM
  • Hi,

     

    Something is missing in Microsoft documentation about this function return values.

    I've don't check every cases and every OS, but with my Windows XP return value is 16 when the path is a valid directory.

     

    So for execution result checking use :

    • if (function call result)
    • if (function call result) is not equal to FALSE

    But never use : if (function call result) is equal to TRUE, because TRUE is equal to one.

     

    This function return 16 because it's FILE_ATTRIBUTE_DIRECTORY value (winnt.h include file from Windows SDK).

    Friday, July 6, 2007 9:53 AM