Declare Function ClientToScreenPtr Lib "User32" Alias "ClientToScreen" (ByVal hWnd As Long, ByVal lpPoint As Long) As Long
Declare Function FlashWindow Lib "User32" (ByVal hWnd As Long, ByVal fInvert As Long) As Long
Declare Function GetActiveWindow Lib "User32" () As Long
Declare Function GetCapture Lib "User32" () As Long
Declare Function GetClassLong Lib "User32" Alias "GetClassLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function GetDC Lib "User32" (ByVal hWnd As Long) As Long
Declare Function GetSystemMetrics Lib "User32" (ByVal nIndex As Long) As Long
Declare Function GetSysColor Lib "User32" (ByVal nIndex As Long) As Long
Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function IsDialogMessagePtr Lib "User32" Alias "IsDialogMessage" (ByVal hWnd As Long, ByVal msg As Long) As Long
Declare Function LoadCursor Lib "User32" Alias "LoadCursorA" (ByVal hInst As Long, ByVal cursorIdOrName As Long) As Long
Declare Function MessageBox Lib "User32" Alias "MessageBoxA" (ByVal ownerHWnd As Long, ByVal msg As String, ByVal title As String, ByVal style As Long) As Long
Declare Function ReleaseCapture Lib "User32" () As Long
Declare Function ScreenToClientPtr Lib "User32" Alias "ScreenToClient" (ByVal hWnd As Long, ByVal lpPoint As Long) As Long
Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function SetActiveWindow Lib "User32" (ByVal hWnd As Long) As Long
Declare Function SetClassLong Lib "User32" Alias "SetClassLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal lNewLong As Long) As Long
Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal lNewLong As Long) As Long
Declare Function ShowWindow Lib "User32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Declare Function WinHelp Lib "User32" Alias "WinHelpA" (ByVal hWnd As Long, ByVal HelpFile As String, ByVal Command As Long, ByVal Data As Long) As Long
Declare Sub DrawFocusRectPtr Lib "User32" Alias "DrawFocusRect" (ByVal hDC As Long, ByVal lpRect As Long)
Const COLOR_SCROLLBAR& = 0
Const COLOR_BACKGROUND& = 1
Const COLOR_ACTIVECAPTION& = 2
Const COLOR_INACTIVECAPTION& = 3
Const COLOR_MENU& = 4
Const COLOR_WINDOW& = 5
Const COLOR_WINDOWFRAME& = 6
Const COLOR_MENUTEXT& = 7
Const COLOR_WINDOWTEXT& = 8
Const COLOR_CAPTIONTEXT& = 9
Const COLOR_ACTIVEBORDER& = 10
Const COLOR_INACTIVEBORDER& = 11
Const COLOR_APPWORKSPACE& = 12
Const COLOR_HIGHLIGHT& = 13
Const COLOR_HIGHLIGHTTEXT& = 14
Const COLOR_BTNFACE& = 15
Const COLOR_BTNSHADOW& = 16
Const COLOR_GRAYTEXT& = 17
Const COLOR_BTNTEXT& = 18
Const COLOR_INACTIVECAPTIONTEXT& = 19
Const COLOR_BTNHIGHLIGHT& = 20
Const MB_OK& = 0
Const MB_OKCANCEL& = 1
Const MB_ABORTRETRYIGNORE& = 2
Const MB_YESNOCANCEL& = 3
Const MB_YESNO& = 4
Const MB_RETRYCANCEL& = 5
Const MB_TYPEMASK& = 15
Const MB_ICONHAND& = 16
Const MB_ICONQUESTION& = 32
Const MB_ICONEXCLAMATION& = 48
Const MB_ICONASTERISK& = 64
Const MB_ICONMASK& = 240
Const MB_ICONINFORMATION& = 64
Const MB_ICONSTOP& = 16
Const MB_DEFBUTTON1& = 0
Const MB_DEFBUTTON2& = 256
Const MB_DEFBUTTON3& = 512
Const MB_DEFBUTTON4& = 768
Const MB_DEFMASK& = 3840
Const MB_APPLMODAL& = 0
Const MB_SYSTEMMODAL& = 4096
Const MB_TASKMODAL& = 8192
Const MB_NOFOCUS& = 32768
Const SW_HIDE& = 0
Const SW_SHOW& = 5
Const IDOK& = 1
Const IDCANCEL& = 2
Const IDABORT& = 3
Const IDRETRY& = 4
Const IDIGNORE& = 5
Const IDYES& = 6
Const IDNO& = 7
Const GWL_WNDPROC& = -4
Const GWL_HINSTANCE& = -6
Const GWL_HWNDPARENT& = -8
Const GWL_STYLE& = -16
Const GWL_EXSTYLE& = -20
Const GWL_USERDATA& = -21
Const GWL_ID& = -12
Const GCL_MENUNAME& = -8
Const GCL_HBRBACKGROUND& = -10
Const GCL_HCURSOR& = -12
Const GCL_HICON& = -14
Const GCL_HMODULE& = -16
Const GCL_CBWNDEXTRA& = -18
Const GCL_CBCLSEXTRA& = -20
Const GCL_WNDPROC& = -24
Const GCL_STYLE& = -26
Const GCW_ATOM& = -32
Const HELP_CONTEXT& = 1
Const HELP_QUIT& = 2
Const HELP_INDEX& = 3
Const HELP_CONTENTS& = 3
Const HELP_HELPONHELP& = 4
Const HELP_SETINDEX& = 5
Const HELP_SETCONTENTS& = 5
Const HELP_CONTEXTPOPUP& = 8
Const HELP_FORCEFILE& = 9
Const HELP_FINDER& = 11
Const HELP_KEY& = 257
Const HELP_COMMAND& = 258
Const HELP_PARTIALKEY& = 261
Const HELP_MULTIKEY& = 513
Const HELP_SETWINPOS& = 515
Const SM_CYCAPTION& = 4
Const SM_CXBORDER& = 5
Const SM_CYBORDER& = 6
Const SM_CXICON& = 11
Const SM_CYICON& = 12
Const SM_CXSIZE& = 30
Const SM_CYSIZE& = 31
Const SM_CXFRAME& = 32
Const SM_CYFRAME& = 33
Const WM_LBUTTONUP& = 514
' METHODS for object: User32
Function ClientToScreen(ByVal hWin As Long, p As Point) As Long
Dim db As New DataBuffer
db.Size = 8
db.SetLong(0, p.x)
db.SetLong(4, p.y)
ClientToScreen = ClientToScreenPtr(hWin, db.Data)
p.x = db.GetLong(0)
p.y = db.GetLong(4)
End Function
Sub DrawFocusRect(ByVal hDC As Long, rect As RECT)
Dim db As New DataBuffer
db.Size = 16
db.SetLong(0, rect.left_)
db.SetLong(4, rect.top)
db.SetLong(8, rect.right_)
db.SetLong(12, rect.bottom)
DrawFocusRectPtr(hDC, db.Data)
End Sub
Function IsDialogMessage(ByVal hWnd As Long, msg As MSG) As Long
Function ScreenToClient(ByVal hWin As Long, p As Point) As Long
Dim db As New DataBuffer
db.Size = 8
db.SetLong(0, p.x)
db.SetLong(4, p.y)
ScreenToClient = ScreenToClientPtr(hWin, db.Data)
p.x = db.GetLong(0)
p.y = db.GetLong(4)
End Function
End Type
Type Point
Dim x As Long
Dim y As Long
End Type
Type RECT
Dim left_ As Long
Dim top As Long
Dim right_ As Long
Dim bottom As Long
End Type
Type MSG
Dim hwnd As Long
Dim message As Long
Dim wParam As Long
Dim lParam As Long
Dim time As Long
Dim pt As New Point
End Type
Type Kernel32 From Globals
Declare Function Beep Lib "Kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Declare Function CloseHandle Lib "Kernel32" (ByVal handle As Long) As Long
Declare Function CallNamedPipe Lib "Kernel32" Alias "CallNamedPipeA" (ByVal nm As String, ByVal writeBuf As Long, ByVal cbWrite As Long, ByVal readBuf As Long, ByVal cbRead As Long, cbActual As Long, ByVal tmOut As Long) As Long
Declare Function ConnectNamedPipe Lib "Kernel32" (ByVal hPipe As Long, ByVal lpOverlapped As Long) As Long
Declare Function CopyFile Lib "Kernel32" Alias "CopyFileA" (ByVal existingFile As String, ByVal newFile As String, ByVal fFailIfExists As Long) As Long
Declare Function CreateDirectory Lib "Kernel32" Alias "CreateDirectoryA" (ByVal dirPath As String, ByVal lpSecurityAttrs As Long) As Long
Declare Function CreateDirectoryEx Lib "Kernel32" Alias "CreateDirectoryExA" (ByVal templateDir As String, ByVal newDir As String, ByVal lpSecurityAttrs As Long) As Long
Declare Function CreateFile Lib "Kernel32" Alias "CreateFileA" (ByVal name As String, ByVal fAccess As Long, ByVal fShareMode As Long, ByVal lpSecurityAttr As Long, ByVal fCreate As Long, ByVal fAttrAndFlag As Long, ByVal hTemplate As Long) As Long
Declare Function CreateMailslot Lib "Kernel32" Alias "CreateMailslotA" (ByVal name As String, ByVal cbMaxMsg As Long, ByVal readTimeout As Long, ByVal lpSecurityAttr As Long) As Long
Declare Function CreateNamedPipe Lib "Kernel32" Alias "CreateNamedPipeA" (ByVal nm As String, ByVal oMode As Long, ByVal pMode As Long, ByVal maxInst As Long, ByVal outSz As Long, ByVal inSz As Long, ByVal tmOut As Long, ByVal lpSecAttr As Long) As Long
Declare Function DeleteFile Lib "Kernel32" Alias "DeleteFileA" (ByVal fileName As String) As Long
Declare Function DisconnectNamedPipe Lib "Kernel32" (ByVal hPipe As Long) As Long
Declare Function FlushFileBuffers Lib "Kernel32" (ByVal hFile As Long) As Long
Declare Function FreeLibrary Lib "Kernel32" (ByVal hLibModule As Long) As Long
Declare Function GetComputerName Lib "Kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As Long, bufSize As Long) As Long
Declare Function GetCurrentDirectory Lib "Kernel32" Alias "GetCurrentDirectoryA" (ByVal bufSize As Long, ByVal lpBuffer As Long) As Long
Declare Function GetLastError Lib "Kernel32" () As Long
Declare Function GetCurrentProcess Lib "Kernel32" () As Long
Declare Function GetCurrentProcessId Lib "Kernel32" () As Long
Declare Function GetEnvironmentStrings Lib "Kernel32" () As Long
Declare Function GetEnvironmentVariable Lib "Kernel32" Alias "GetEnvironmentVariableA" (ByVal variableName As String, ByVal lpBuffer As Long, ByVal bufSize As Long) As Long
Declare Function GetMailslotInfo Lib "Kernel32" (ByVal hMailslot As Long, maxMsgSize As Long, nextMsgSize As Long, nMessages As Long, readTimeout As Long) As Long
Declare Function GetNamedPipeInfo Lib "Kernel32" (ByVal hPipe As Long, dwType As Long, cbOutBuf As Long, cbInBuf As Long, cMaxInstances As Long) As Long
Declare Function GetSystemDirectory Lib "Kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As Long, ByVal bufSize As Long) As Long
Declare Sub GetSystemInfo Lib "Kernel32" (ByVal lpSystemInfo As Long)
Declare Function GetTempFileName Lib "Kernel32" Alias "GetTempFileNameA" (ByVal szPath As String, ByVal szPrefix As String, ByVal uUnique As Long, ByVal lpszTempFile As Long) As Long
Declare Function GetTempPath Lib "Kernel32" Alias "GetTempPathA" (ByVal bufSize As Long, ByVal lpBuffer As Long) As Long
Declare Function GetTickCount Lib "Kernel32" () As Long
Declare Function GetVersionEx Lib "Kernel32" Alias "GetVersionExA" (ByVal lpOSVersionInfo As Long) As Long
Declare Function GetWindowsDirectory Lib "Kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As Long, ByVal bufSize As Long) As Long
Declare Function LoadLibrary Lib "Kernel32" Alias "LoadLibraryA" (ByVal libFile As String) As Long
Declare Function MoveFile Lib "Kernel32" Alias "MoveFileA" (ByVal existingPath As String, ByVal newPath As String) As Long
Declare Function MoveFileEx Lib "Kernel32" Alias "MoveFileExA" (ByVal existingPath As String, ByVal newPath As String, ByVal flags As Long) As Long
Declare Function OpenProcess Lib "Kernel32" (ByVal fAccess As Long, ByVal fInherit As Long, ByVal processID As Long) As Long
Declare Function PeekNamedPipe Lib "Kernel32" (ByVal hPipe As Long, ByVal buffer As Long, ByVal cbBuffer As Long, cbRead As Long, cbAvail As Long, cbMessage As Long) As Long
Declare Function ReadFile Lib "Kernel32" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal nBytesToRead As Long, nBytesRead As Long, ByVal lpOverlapped As Long) As Long
Declare Function RemoveDirectory Lib "Kernel32" Alias "RemoveDirectoryA" (ByVal dirPath As String) As Long
Declare Function SearchPath Lib "Kernel32" Alias "SearchPathA" (ByVal szPath As Long, ByVal filename As String, ByVal extension As String, ByVal cbBufSize As Long, ByVal pBuf As Long, szFilePartAddr As Long) As Long
Declare Function SetCurrentDirectory Lib "Kernel32" Alias "SetCurrentDirectoryA" (ByVal dirPath As String) As Long
Declare Function SetEnvironmentVariable Lib "Kernel32" Alias "SetEnvironmentVariableA" (ByVal variableName As String, ByVal szValue As Long) As Long
Declare Sub SetLastError Lib "Kernel32" (ByVal dwError As Long)
Declare Sub Sleep Lib "Kernel32" (ByVal cMilliseconds As Long)
Declare Function TransactNamedPipe Lib "Kernel32" (ByVal hPipe As Long, ByVal writeBuf As Long, ByVal cbWrite As Long, ByVal readBuf As Long, ByVal cbRead As Long, cbActual As Long, ByVal lpOverlapped As Long) As Long
Declare Function VirtualQuery Lib "Kernel32" (ByVal lpAddress As Long, ByVal lpMemoryBasicInformation As Long, ByVal length As Long) As Long
Declare Function VirtualQueryEx Lib "Kernel32" (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal lpMemoryBasicInformation As Long, ByVal length As Long) As Long
Declare Function WaitForSingleObject Lib "Kernel32" (ByVal hObject As Long, ByVal tmOut As Long) As Long
Declare Function WaitNamedPipe Lib "Kernel32" Alias "WaitNamedPipeA" (ByVal nm As String, ByVal tmOut As Long) As Long
Declare Function WriteFile Lib "Kernel32" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal nBytesToWrite As Long, nBytesWritten As Long, ByVal lpOverlapped As Long) As Long
Const MOVEFILE_REPLACE_EXISTING& = 1
Const MOVEFILE_COPY_ALLOWED& = 2
Const MOVEFILE_DELAY_UNTIL_REBOOT& = 4
Const VER_PLATFORM_WIN32s& = 0
Const VER_PLATFORM_WIN32_NT& = 2
Const GENERIC_READ& = -2147483648
Const GENERIC_WRITE& = 1073741824
Const GENERIC_EXECUTE& = 536870912
Const GENERIC_ALL& = 268435456
Const FILE_SHARE_READ& = 1
Const FILE_SHARE_WRITE& = 2
Const CREATE_NEW& = 1
Const CREATE_ALWAYS& = 2
Const OPEN_EXISTING& = 3
Const OPEN_ALWAYS& = 4
Const TRUNCATE_EXISTING& = 5
Const FILE_ATTRIBUTE_READONLY& = 1
Const FILE_ATTRIBUTE_HIDDEN& = 2
Const FILE_ATTRIBUTE_SYSTEM& = 4
Const FILE_ATTRIBUTE_DIRECTORY& = 16
Const FILE_ATTRIBUTE_ARCHIVE& = 32
Const FILE_ATTRIBUTE_NORMAL& = 128
Const FILE_ATTRIBUTE_TEMPORARY& = 256
Const FILE_ATTRIBUTE_ATOMIC_WRITE& = 512
Const FILE_ATTRIBUTE_XACTION_WRITE& = 1024
Const FILE_ATTRIBUTE_COMPRESSED& = 2048
Const FILE_ATTRIBUTE_HAS_EMBEDDING& = 4096
Const FILE_FLAG_WRITE_THROUGH& = -2147483648
Const FILE_FLAG_OVERLAPPED& = 1073741824
Const FILE_FLAG_NO_BUFFERING& = 536870912
Const FILE_FLAG_RANDOM_ACCESS& = 268435456
Const FILE_FLAG_SEQUENTIAL_SCAN& = 134217728
Const FILE_FLAG_DELETE_ON_CLOSE& = 67108864
Const FILE_FLAG_BACKUP_SEMANTICS& = 33554432
Const FILE_FLAG_POSIX_SEMANTICS& = 16777216
Const INVALID_HANDLE_VALUE& = -1
Const INVALID_FILE_SIZE& = -1
Const MAILSLOT_NO_MESSAGE& = -1
Const MAILSLOT_WAIT_FOREVER& = -1
Const PIPE_ACCESS_INBOUND& = 1
Const PIPE_ACCESS_OUTBOUND& = 2
Const PIPE_ACCESS_DUPLEX& = 3
Const PIPE_CLIENT_END& = 0
Const PIPE_SERVER_END& = 1
Const PIPE_WAIT& = 0
Const PIPE_NOWAIT& = 1
Const PIPE_READMODE_BYTE& = 0
Const PIPE_READMODE_MESSAGE& = 2
Const PIPE_TYPE_BYTE& = 0
Const PIPE_TYPE_MESSAGE& = 4
Const PIPE_UNLIMITED_INSTANCES& = 255
Const PAGE_NOACCESS& = 1
Const PAGE_READONLY& = 2
Const PAGE_READWRITE& = 4
Const PAGE_WRITECOPY& = 8
Const PAGE_EXECUTE& = 16
Const PAGE_EXECUTE_READ& = 32
Const PAGE_EXECUTE_READWRITE& = 64
Const PAGE_EXECUTE_WRITECOPY& = 128
Const PAGE_GUARD& = 256
Const PAGE_NOCACHE& = 512
Const MEM_COMMIT& = 4096
Const MEM_RESERVE& = 8192
Const MEM_DECOMMIT& = 16384
Const MEM_RELEASE& = 32768
Const MEM_FREE& = 65536
Const MEM_PRIVATE& = 131072
Const MEM_MAPPED& = 262144
Const MEM_TOP_DOWN& = 1048576
Const SEC_FILE& = 8388608
Const SEC_IMAGE& = 16777216
Const SEC_RESERVE& = 67108864
Const SEC_COMMIT& = 134217728
Const SEC_NOCACHE& = 268435456
Const MEM_IMAGE& = 16777216
Const DELETE& = 65536
Const READ_CONTROL& = 131072
Const WRITE_DAC& = 262144
Const WRITE_OWNER& = 524288
Const SYNCHRONIZE& = 1048576
Const STANDARD_RIGHTS_REQUIRED& = 983040
Const STANDARD_RIGHTS_READ& = 131072
Const STANDARD_RIGHTS_WRITE& = 131072
Const STANDARD_RIGHTS_EXECUTE& = 131072
Const STANDARD_RIGHTS_ALL& = 2031616
Const SPECIFIC_RIGHTS_ALL& = 65535
Const PROCESS_TERMINATE& = 1
Const PROCESS_CREATE_THREAD& = 2
Const PROCESS_VM_OPERATION& = 8
Const PROCESS_VM_READ& = 16
Const PROCESS_VM_WRITE& = 32
Const PROCESS_DUP_HANDLE& = 64
Const PROCESS_CREATE_PROCESS& = 128
Const PROCESS_SET_QUOTA& = 256
Const PROCESS_SET_INFORMATION& = 512
Const PROCESS_QUERY_INFORMATION& = 1024
Const PROCESS_ALL_ACCESS& = 2035711
End Type
Type VirtualKeyConstants From Globals
Const VK_LBUTTON% = 1
Const VK_RBUTTON% = 2
Const VK_CANCEL% = 3
Const VK_MBUTTON% = 4
Const VK_BACK% = 8
Const VK_TAB% = 9
Const VK_CLEAR% = 12
Const VK_RETURN% = 13
Const VK_SHIFT% = 16
Const VK_CONTROL% = 17
Const VK_MENU% = 18
Const VK_PAUSE% = 19
Const VK_CAPITAL% = 20
Const VK_ESCAPE% = 27
Const VK_SPACE% = 32
Const VK_PRIOR% = 33
Const VK_NEXT% = 34
Const VK_END% = 35
Const VK_HOME% = 36
Const VK_LEFT% = 37
Const VK_UP% = 38
Const VK_RIGHT% = 39
Const VK_DOWN% = 40
Const VK_SELECT% = 41
Const VK_PRINT% = 42
Const VK_EXECUTE% = 43
Const VK_SNAPSHOT% = 44
Const VK_INSERT% = 45
Const VK_DELETE% = 46
Const VK_HELP% = 47
Const VK_NUMPAD0% = 96
Const VK_NUMPAD1% = 97
Const VK_NUMPAD2% = 98
Const VK_NUMPAD3% = 99
Const VK_NUMPAD4% = 100
Const VK_NUMPAD5% = 101
Const VK_NUMPAD6% = 102
Const VK_NUMPAD7% = 103
Const VK_NUMPAD8% = 104
Const VK_NUMPAD9% = 105
Const VK_MULTIPLY% = 106
Const VK_ADD% = 107
Const VK_SEPARATOR% = 108
Const VK_SUBTRACT% = 109
Const VK_DECIMAL% = 110
Const VK_DIVIDE% = 111
Const VK_F1% = 112
Const VK_F2% = 113
Const VK_F3% = 114
Const VK_F4% = 115
Const VK_F5% = 116
Const VK_F6% = 117
Const VK_F7% = 118
Const VK_F8% = 119
Const VK_F9% = 120
Const VK_F10% = 121
Const VK_F11% = 122
Const VK_F12% = 123
Const VK_F13% = 124
Const VK_F14% = 125
Const VK_F15% = 126
Const VK_F16% = 127
Const VK_F17% = 128
Const VK_F18% = 129
Const VK_F19% = 130
Const VK_F20% = 131
Const VK_F21% = 132
Const VK_F22% = 133
Const VK_F23% = 134
Const VK_F24% = 135
Const VK_NUMLOCK% = 144
Const VK_SCROLL% = 145
End Type
Begin Code
' Reconstruction commands for object: User32
'
With User32
End With 'User32
' Reconstruction commands for object: Point
'
With Point
.x := 0
.y := 0
End With 'Point
' Reconstruction commands for object: RECT
'
With RECT
.left_ := 0
.top := 0
.right_ := 0
.bottom := 0
End With 'RECT
' Reconstruction commands for object: MSG
'
With MSG
.hwnd := 0
.message := 0
.wParam := 0
.lParam := 0
.time := 0
With .pt
End With 'MSG.pt
End With 'MSG
' Reconstruction commands for object: Kernel32
'
With Kernel32
End With 'Kernel32
' Reconstruction commands for object: VirtualKeyConstants