Attribute VB_Name = "MDeclare" Option Explicit ' Here's another comment ' These are types and declares described in the book (especially Chapter 2). ' They are in a false conditionals so that the ones in the Windows API type ' library will override them. You can enable these versions to confirm that ' the Declare statements and type library entries are equivalent. #If fUseDeclares Then Type LARGE_INTEGER LowPart As Long HighPart As Long End Type Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As Long End Type Type POINTL x As Long y As Long End Type Type WINDOWPLACEMENT length As Long Flags As Long showCmd As Long ptMinPosition As POINTL ptMaxPosition As POINTL rcNormalPosition As RECT End Type Declare Function Polygon Lib "GDI32" (ByVal hDC As Long, _ lpPoints As POINTL, ByVal nCount As Long) As Long Declare Function SetWindowPlacement Lib "USER32" ( _ ByVal hWnd As Long, lpwndpl As WINDOWPLACEMENT) As Long Declare Function GetWindowPlacement Lib "USER32" ( _ ByVal hWnd As Long, lpwndpl As WINDOWPLACEMENT) As Long Public Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" ( _ lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long) Declare Function GetScrollRange Lib "USER32" (ByVal hWnd As Long, _ ByVal nBar As Long, lpMin As Long, lpMax As Long) As Long #If 0 Then Declare Function FindWindow Lib "USER32" Alias "FindWindowA" ( _ ByVal lpszClassName As String, ByVal lpszWindow As String) As Long #Else Declare Function FindWindow Lib "USER32" Alias "FindWindowA" ( _ Optional ByVal Class As String, _ Optional ByVal Title As String) As Long #End If Declare Function WindowFromPointXY Lib "USER32" _ Alias "WindowFromPoint" (ByVal xPoint As Long, _ ByVal yPoint As Long) As Long Declare Function ChildWindowFromPointXY Lib "USER32" _ Alias "WindowFromPoint" (ByVal hWnd As Long, _ ByVal xPoint As Long, ByVal yPoint As Long) As Long Declare Function WindowFromPoint Lib "USER32" _ (ByVal xPoint As Long, ByVal yPoint As Long) As Long Declare Function VBGetObject Lib "GDI32" Alias "GetObjectA" ( _ ByVal hObject As Long, ByVal cbBuffer As Long, _ lpvObject As Any) As Long Declare Function GetObjectBrush Lib "GDI32" Alias "GetObjectA" ( _ ByVal hBrush As Long, ByVal cbBuffer As Long, _ lpBrush As LOGBRUSH) As Long Declare Function GetObjectBitmap Lib "GDI32" Alias "GetObjectA" ( _ ByVal hBitmap As Long, ByVal cbBuffer As Long, _ lpBitmap As BITMAP) As Long Declare Function SendMessageVal Lib "USER32" Alias "SendMessageA" ( _ ByVal hWnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, ByVal lParam As Any) As Long Declare Function SendMessageStr Lib "USER32" Alias "SendMessageA" ( _ ByVal hWnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, ByVal lParam As String) As Long Declare Function SendMessage Lib "USER32" Alias "SendMessageA" ( _ ByVal hWnd As Long, ByVal wMsg As Long, _ wParam As Any, lParam As Any) As Long Declare Function GetWindowText Lib "USER32" Alias "GetWindowTextA" ( _ ByVal hWnd As Long, ByVal lpString As String, _ ByVal nMaxCount As Long) As Long Declare Function GetWindowRect Lib "USER32" (ByVal hWnd As Long, _ lprc As RECT) As Long Declare Sub ClientToScreen Lib "USER32" (ByVal hWnd As Long, _ lpPoint As POINTL) Declare Function FloodFill Lib "GDI32" (ByVal hDC As Long, _ ByVal nXStart As Long, ByVal nYStart As Long, _ ByVal crFill As Long) As Long Public Declare Function EnumWindows Lib "USER32" ( _ ByVal lpEnumFunc As Long, lParam As Any) As Long Private Declare Function SearchPath Lib "kernel32.dll" ( _ ByVal lpPath As String, ByVal lpFileName As String, _ ByVal lpExtension As String, ByVal nBufferLenght As Long, _ ByVal lpBuffer As String, lpFilePart As Long) As Long Declare Function QueryPerformanceCounter Lib "KERNEL32" ( _ lpPerformanceCount As Currency) As Long Declare Function QueryPerformanceFrequency Lib "KERNEL32" ( _ lpFrequency As Currency) As Long #End If