' ########################################################################################
' Microsoft Windows
' File: WinUser.inc
' Contents: USER procedure declarations, constant definitions and macros
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
' Note: windows.inc must be included before this file, but can't be done here.
' You must do it in your application.
#IF NOT %DEF(PBX_WinUser_PBI)
#DEFINE PBX_WinUser_PBI
%EQUATE `WINUSER_INC = 1
'//
'// Define API decoration for direct importing of DLL references.
'//
'#ifndef WINVER
'#define WINVER 0x0500 /* version 5.0 */
'#endif /* !WINVER */
'#include <stdarg.h>
'#IF NOT %DEF(%NOUSER) ' -------------------------------------------------------
'#ifndef NOUSER
'typedef HANDLE HDWP;
'typedef VOID MENUTEMPLATEA;
'typedef VOID MENUTEMPLATEW;
'typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
'typedef INT_PTR (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);
'typedef VOID (CALLBACK* TIMERPROC)(HWND, UINT, UINT_PTR, DWORD);
'typedef BOOL (CALLBACK* GRAYSTRINGPROC)(HDC, LPARAM, int);
'typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
'typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
'typedef VOID (CALLBACK* SENDASYNCPROC)(HWND, UINT, ULONG_PTR, LRESULT);
'typedef BOOL (CALLBACK* PROPENUMPROCA)(HWND, LPCSTR, HANDLE);
'typedef BOOL (CALLBACK* PROPENUMPROCW)(HWND, LPCWSTR, HANDLE);
'typedef BOOL (CALLBACK* PROPENUMPROCEXA)(HWND, LPSTR, HANDLE, ULONG_PTR);
'typedef BOOL (CALLBACK* PROPENUMPROCEXW)(HWND, LPWSTR, HANDLE, ULONG_PTR);
'typedef int (CALLBACK* EDITWORDBREAKPROCA)(LPSTR lpch, int ichCurrent, int cch, int code);
'typedef int (CALLBACK* EDITWORDBREAKPROCW)(LPWSTR lpch, int ichCurrent, int cch, int code);
'#if(WINVER >= 0x0400)
'typedef BOOL (CALLBACK* DRAWSTATEPROC)(HDC hdc, LPARAM lData, WPARAM wData, int cx, int cy);
'#endif /* WINVER >= 0x0400 */
'#else /* !STRICT */
'#define IS_INTRESOURCE(_r) ((((ULONG_PTR)(_r)) >> 16) == 0)
'#define MAKEINTRESOURCEA(i) ((LPSTR)((ULONG_PTR)((WORD)(i))))
'#define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i))))
FUNCTION IS_INTRESOURCE (BYVAL dwInteger AS DWORD) AS LONG
 SHIFT RIGHT dwInteger, 16
 FUNCTION = (dwInteger = 0)
END FUNCTION
FUNCTION MAKEINTRESOURCEA (BYVAL wInteger AS WORD) AS DWORD
 FUNCTION = MAK(DWORD, wInteger, 0)
END FUNCTION
FUNCTION MAKEINTRESOURCEW (BYVAL wInteger AS WORD) AS DWORD
 FUNCTION = MAK(DWORD, wInteger, 0)
END FUNCTION
#IF %DEF(%UNICODE)
 MACRO MAKEINTRESOURCE = MAKEINTRESOURCEW
#ELSE
 MACRO MAKEINTRESOURCE = MAKEINTRESOURCEA
#ENDIF
'/*
' * Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects()
' */
%EQUATE `QS_KEY = &H0001
%EQUATE `QS_MOUSEMOVE = &H0002
%EQUATE `QS_MOUSEBUTTON = &H0004
%EQUATE `QS_POSTMESSAGE = &H0008
%EQUATE `QS_TIMER = &H0010
%EQUATE `QS_PAINT = &H0020
%EQUATE `QS_SENDMESSAGE = &H0040
%EQUATE `QS_HOTKEY = &H0080
%EQUATE `QS_ALLPOSTMESSAGE = &H0100
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `QS_RAWINPUT = &H0400
'#endif /* _WIN32_WINNT >= 0x0501 */
%EQUATE `QS_MOUSE = %QS_MOUSEMOVE OR %QS_MOUSEBUTTON
'#if (_WIN32_WINNT >= 0x0501)
'#define QS_INPUT (QS_MOUSE | \
' QS_KEY | \
' QS_RAWINPUT)
'#else
'#define QS_INPUT (QS_MOUSE | \
' QS_KEY)
'#endif // (_WIN32_WINNT >= 0x0501)
#IF %WINVER >= &H0501
%EQUATE `QS_INPUT = %QS_MOUSE OR %QS_KEY OR %QS_RAWINPUT ' Windows XP and later
#ELSE
%EQUATE `QS_INPUT = %QS_MOUSE OR %QS_KEY
#ENDIF
%EQUATE `QS_ALLEVENTS = %QS_INPUT OR %QS_POSTMESSAGE OR %QS_TIMER OR %QS_PAINT OR %QS_HOTKEY
%EQUATE `QS_ALLINPUT = %QS_INPUT OR %QS_POSTMESSAGE OR %QS_TIMER OR %QS_PAINT OR %QS_HOTKEY OR %QS_SENDMESSAGE
%EQUATE `USER_TIMER_MAXIMUM = &H7FFFFFFF
%EQUATE `USER_TIMER_MINIMUM = &H0000000A
'#IF NOT %DEF(%NORESOURCE) ' ---------------------------------------------------
'#ifndef NORESOURCE
'/*
' * Predefined Resource Types
' */
'#define RT_CURSOR MAKEINTRESOURCE(1)
'#define RT_BITMAP MAKEINTRESOURCE(2)
'#define RT_ICON MAKEINTRESOURCE(3)
'#define RT_MENU MAKEINTRESOURCE(4)
'#define RT_DIALOG MAKEINTRESOURCE(5)
'#define RT_STRING MAKEINTRESOURCE(6)
'#define RT_FONTDIR MAKEINTRESOURCE(7)
'#define RT_FONT MAKEINTRESOURCE(8)
'#define RT_ACCELERATOR MAKEINTRESOURCE(9)
'#define RT_RCDATA MAKEINTRESOURCE(10)
'#define RT_MESSAGETABLE MAKEINTRESOURCE(11)
%EQUATE `RT_CURSOR = 1
%EQUATE `RT_BITMAP = 2
%EQUATE `RT_ICON = 3
%EQUATE `RT_MENU = 4
%EQUATE `RT_DIALOG = 5
%EQUATE `RT_STRING = 6
%EQUATE `RT_FONTDIR = 7
%EQUATE `RT_FONT = 8
%EQUATE `RT_ACCELERATOR = 9
%EQUATE `RT_RCDATA = 10
%EQUATE `RT_MESSAGETABLE = 11
'#define DIFFERENCE 11
'#define RT_GROUP_CURSOR MAKEINTRESOURCE((ULONG_PTR)RT_CURSOR + DIFFERENCE)
'#define RT_GROUP_ICON MAKEINTRESOURCE((ULONG_PTR)RT_ICON + DIFFERENCE)
'#define RT_VERSION MAKEINTRESOURCE(16)
'#define RT_DLGINCLUDE MAKEINTRESOURCE(17)
'#if(WINVER >= 0x0400)
'#define RT_PLUGPLAY MAKEINTRESOURCE(19)
'#define RT_VXD MAKEINTRESOURCE(20)
'#define RT_ANICURSOR MAKEINTRESOURCE(21)
'#define RT_ANIICON MAKEINTRESOURCE(22)
'#endif /* WINVER >= 0x0400 */
'#define RT_HTML MAKEINTRESOURCE(23)
'#ifdef RC_INVOKED
'#define RT_MANIFEST 24
'#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
'#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
'#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
'#define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID 1 /* inclusive */
'#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID 16 /* inclusive */
'#else /* RC_INVOKED */
'#define RT_MANIFEST MAKEINTRESOURCE(24)
'#define CREATEPROCESS_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1)
'#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(2)
'#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(3)
'#define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1 /*inclusive*/)
'#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(16 /*inclusive*/)
'#endif /* RC_INVOKED */
%EQUATE `DIFFERENCE = 11
%EQUATE `RT_GROUP_CURSOR = 12
%EQUATE `RT_GROUP_ICON = 14
%EQUATE `RT_VERSION = 16
%EQUATE `RT_DLGINCLUDE = 17
%EQUATE `RT_PLUGPLAY = 19
%EQUATE `RT_VXD = 20
%EQUATE `RT_ANICURSOR = 21
%EQUATE `RT_ANIICON = 22
%EQUATE `RT_HTML = 23
%EQUATE `RT_MANIFEST = 24
%EQUATE `CREATEPROCESS_MANIFEST_RESOURCE_ID = 1
%EQUATE `ISOLATIONAWARE_MANIFEST_RESOURCE_ID = 2
%EQUATE `ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID = 3
%EQUATE `MINIMUM_RESERVED_MANIFEST_RESOURCE_ID = 1 ' /* inclusive */
%EQUATE `MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID = 16 ' /* inclusive */
'#ENDIF ' #IF NOT %DEF(%NORESOURCE) --------------------------------------------
DECLARE FUNCTION wvsprintfA LIB "user32.dll" ALIAS "wvsprintfA" ( BYREF lpOutput AS ASCIIZ , BYREF lpFmt AS ASCIIZ , BYREF arglist AS ANY ) AS LONG ' int
' Usage example:
' DIM rgArgs(1) AS DWORD
' LOCAL wszOut AS WSTRINGZ * 1024
' LOCAL wszName AS WSTRINGZ * 260
' wszName = "John Doe"
' rgArgs(0) = VARPTR(wszName)
' rgArgs(1) = 23
' wvsprintfW(wszOut, "Hi, my mane is %s and I'm %lu years old", rgArgs(0))
' ? wszOut
DECLARE FUNCTION wvsprintfW LIB "user32.dll" ALIAS "wvsprintfW" ( BYREF lpOutput AS WSTRINGZ , BYREF lpFmt AS WSTRINGZ , BYREF arglist AS ANY ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO wvsprintf = wvsprintfW
#ELSE
 MACRO wvsprintf = wvsprintfA
#ENDIF
DECLARE FUNCTION wsprintfA CDECL LIB "user32.dll" ALIAS "wsprintfA" ( BYREF lpOut AS ASCIIZ , BYREF lpFmt AS ASCIIZ , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY ) AS LONG ' int
' Usage example:
' LOCAL wszOut AS WSTRINGZ * 1024
' LOCAL wszName AS WSTRINGZ * 260
' wszName = "John Doe"
' wsprintfW(wszOut, "Hi, my mane is %s and I'm %lu years old", wszName, BYVAL 23)
' ? wszOut
DECLARE FUNCTION wsprintfW CDECL LIB "user32.dll" ALIAS "wsprintfW" ( BYREF lpOut AS WSTRINGZ , BYREF lpFmt AS WSTRINGZ , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO wsprintf = wsprintfW
#ELSE
 MACRO wsprintf = wsprintfA
#ENDIF
'/*
' * SPI_SETDESKWALLPAPER defined constants
' */
'#define SETWALLPAPER_DEFAULT ((LPWSTR)-1)
%EQUATE `SETWALLPAPER_DEFAULT = &HFFFFFFFF
'#IF NOT %DEF(%NOSCROLL) '------------------------------------------------------
'#ifndef NOSCROLL
'/*
' * Scroll Bar Constants
' */
'%SB_HORZ = 0&
'%SB_VERT = 1&
'%SB_CTL = 2&
'%SB_BOTH = 3&
'/*
' * Scroll Bar Commands
' */
'%SB_LINEUP = 0&
'%SB_LINELEFT = 0&
'%SB_LINEDOWN = 1&
'%SB_LINERIGHT = 1&
'%SB_PAGEUP = 2&
'%SB_PAGELEFT = 2&
'%SB_PAGEDOWN = 3&
'%SB_PAGERIGHT = 3&
'%SB_THUMBPOSITION = 4&
'%SB_THUMBTRACK = 5&
'%SB_TOP = 6&
'%SB_LEFT = 6&
'%SB_BOTTOM = 7&
'%SB_RIGHT = 7&
'%SB_ENDSCROLL = 8&
'#endif /* !NOSCROLL */
'#ENDIF ' #IF NOT %DEF(%NOSCROLL) ----------------------------------------------
'#IF NOT %DEF(%NOSHOWWINDOW) '--------------------------------------------------
'#ifndef NOSHOWWINDOW
'/*
' * ShowWindow() Commands
' */
'%SW_HIDE = 0&
'%SW_SHOWNORMAL = 1&
'%SW_NORMAL = 1&
'%SW_SHOWMINIMIZED = 2&
'%SW_SHOWMAXIMIZED = 3&
'%SW_MAXIMIZE = 3&
'%SW_SHOWNOACTIVATE = 4&
'%SW_SHOW = 5&
'%SW_MINIMIZE = 6&
'%SW_SHOWMINNOACTIVE = 7&
'%SW_SHOWNA = 8&
'%SW_RESTORE = 9&
'%SW_SHOWDEFAULT = 10&
'%SW_FORCEMINIMIZE = 11&
'%SW_MAX = 11&
'/*
' * Old ShowWindow() Commands
' */
%EQUATE `HIDE_WINDOW = 0&
%EQUATE `SHOW_OPENWINDOW = 1&
%EQUATE `SHOW_ICONWINDOW = 2&
%EQUATE `SHOW_FULLSCREEN = 3&
%EQUATE `SHOW_OPENNOACTIVATE = 4&
'/*
' * Identifiers for the WM_SHOWWINDOW message
' */
%EQUATE `SW_PARENTCLOSING = 1&
%EQUATE `SW_OTHERZOOM = 2&
%EQUATE `SW_PARENTOPENING = 3&
%EQUATE `SW_OTHERUNZOOM = 4&
'#endif /* !NOSHOWWINDOW */
'#ENDIF '#IF NOT %DEF(%NOSHOWWINDOW) '------------------------------------------
'#if(WINVER >= 0x0500)
'/*
' * AnimateWindow() Commands
' */
%EQUATE `AW_HOR_POSITIVE = &H00000001
%EQUATE `AW_HOR_NEGATIVE = &H00000002
%EQUATE `AW_VER_POSITIVE = &H00000004
%EQUATE `AW_VER_NEGATIVE = &H00000008
%EQUATE `AW_CENTER = &H00000010
%EQUATE `AW_HIDE = &H00010000
%EQUATE `AW_ACTIVATE = &H00020000
%EQUATE `AW_SLIDE = &H00040000
%EQUATE `AW_BLEND = &H00080000
'#endif /* WINVER >= 0x0500 */
'/*
' * WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags
' */
%EQUATE `KF_EXTENDED = &H0100
%EQUATE `KF_DLGMODE = &H0800
%EQUATE `KF_MENUMODE = &H1000
%EQUATE `KF_ALTDOWN = &H2000
%EQUATE `KF_REPEAT = &H4000
%EQUATE `KF_UP = &H8000
'#IF NOT %DEF(%NOVIRTUALKEYCODES) '---------------------------------------------
'#ifndef NOVIRTUALKEYCODES
'/*
' * Virtual Keys, Standard Set
' */
%EQUATE `VK_LBUTTON = &H01&
%EQUATE `VK_RBUTTON = &H02&
%EQUATE `VK_CANCEL = &H03&
%EQUATE `VK_MBUTTON = &H04& ' NOT contiguous with L RBUTTON
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `VK_XBUTTON1 = &H05& ' NOT contiguous with L & RBUTTON
%EQUATE `VK_XBUTTON2 = &H06& ' NOT contiguous with L & RBUTTON
'#endif /* _WIN32_WINNT >= 0x0500 */
'/*
' * 0x07 : unassigned
' */
%EQUATE `VK_BACK = &H08&
%EQUATE `VK_TAB = &H09&
'/*
' * 0x0A - 0x0B : reserved
' */
%EQUATE `VK_LINEFEED = &H0A& ' Not defined in the Windows 7 SDK
%EQUATE `VK_CLEAR = &H0C&
%EQUATE `VK_RETURN = &H0D&
%EQUATE `VK_SHIFT = &H10&
%EQUATE `VK_CONTROL = &H11&
%EQUATE `VK_MENU = &H12&
%EQUATE `VK_PAUSE = &H13&
%EQUATE `VK_CAPITAL = &H14&
%EQUATE `VK_KANA = &H15&
%EQUATE `VK_HANGEUL = &H15& ' old name - should be here for compatibility
%EQUATE `VK_HANGUL = &H15&
%EQUATE `VK_JUNJA = &H17&
%EQUATE `VK_FINAL = &H18&
%EQUATE `VK_HANJA = &H19&
%EQUATE `VK_KANJI = &H19&
%EQUATE `VK_ESCAPE = &H1B&
%EQUATE `VK_CONVERT = &H1C&
%EQUATE `VK_NONCONVERT = &H1D&
%EQUATE `VK_ACCEPT = &H1E&
%EQUATE `VK_MODECHANGE = &H1F&
%EQUATE `VK_SPACE = &H20&
%EQUATE `VK_PGUP = &H21&
%EQUATE `VK_PRIOR = &H21&
%EQUATE `VK_NEXT = &H22&
%EQUATE `VK_PGDN = &H22&
%EQUATE `VK_END = &H23&
%EQUATE `VK_HOME = &H24&
%EQUATE `VK_LEFT = &H25&
%EQUATE `VK_UP = &H26&
%EQUATE `VK_RIGHT = &H27&
%EQUATE `VK_DOWN = &H28&
%EQUATE `VK_SELECT = &H29&
%EQUATE `VK_PRINT = &H2A&
%EQUATE `VK_EXECUTE = &H2B&
%EQUATE `VK_SNAPSHOT = &H2C&
%EQUATE `VK_INSERT = &H2D&
%EQUATE `VK_DELETE = &H2E&
%EQUATE `VK_HELP = &H2F&
'/*
' * VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
' * 0x40 : unassigned
' * VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
' */
%EQUATE `VK_0 = &H30&
%EQUATE `VK_1 = &H31&
%EQUATE `VK_2 = &H32&
%EQUATE `VK_3 = &H33&
%EQUATE `VK_4 = &H34&
%EQUATE `VK_5 = &H35&
%EQUATE `VK_6 = &H36&
%EQUATE `VK_7 = &H37&
%EQUATE `VK_8 = &H38&
%EQUATE `VK_9 = &H39&
%EQUATE `VK_A = &H41&
%EQUATE `VK_B = &H42&
%EQUATE `VK_C = &H43&
%EQUATE `VK_D = &H44&
%EQUATE `VK_E = &H45&
%EQUATE `VK_F = &H46&
%EQUATE `VK_G = &H47&
%EQUATE `VK_H = &H48&
%EQUATE `VK_I = &H49&
%EQUATE `VK_J = &H4A&
%EQUATE `VK_K = &H4B&
%EQUATE `VK_L = &H4C&
%EQUATE `VK_M = &H4D&
%EQUATE `VK_N = &H4E&
%EQUATE `VK_O = &H4F&
%EQUATE `VK_P = &H50&
%EQUATE `VK_Q = &H51&
%EQUATE `VK_R = &H52&
%EQUATE `VK_S = &H53&
%EQUATE `VK_T = &H54&
%EQUATE `VK_U = &H55&
%EQUATE `VK_V = &H56&
%EQUATE `VK_W = &H57&
%EQUATE `VK_X = &H58&
%EQUATE `VK_Y = &H59&
%EQUATE `VK_Z = &H5A&
%EQUATE `VK_LWIN = &H5B&
%EQUATE `VK_RWIN = &H5C&
%EQUATE `VK_APPS = &H5D&
'/*
' * 0x5E : reserved
' */
%EQUATE `VK_SLEEP = &H5F&
%EQUATE `VK_NUMPAD0 = &H60&
%EQUATE `VK_NUMPAD1 = &H61&
%EQUATE `VK_NUMPAD2 = &H62&
%EQUATE `VK_NUMPAD3 = &H63&
%EQUATE `VK_NUMPAD4 = &H64&
%EQUATE `VK_NUMPAD5 = &H65&
%EQUATE `VK_NUMPAD6 = &H66&
%EQUATE `VK_NUMPAD7 = &H67&
%EQUATE `VK_NUMPAD8 = &H68&
%EQUATE `VK_NUMPAD9 = &H69&
%EQUATE `VK_MULTIPLY = &H6A&
%EQUATE `VK_ADD = &H6B&
%EQUATE `VK_SEPARATOR = &H6C&
%EQUATE `VK_SUBTRACT = &H6D&
%EQUATE `VK_DECIMAL = &H6E&
%EQUATE `VK_DIVIDE = &H6F&
%EQUATE `VK_F1 = &H70&
%EQUATE `VK_F2 = &H71&
%EQUATE `VK_F3 = &H72&
%EQUATE `VK_F4 = &H73&
%EQUATE `VK_F5 = &H74&
%EQUATE `VK_F6 = &H75&
%EQUATE `VK_F7 = &H76&
%EQUATE `VK_F8 = &H77&
%EQUATE `VK_F9 = &H78&
%EQUATE `VK_F10 = &H79&
%EQUATE `VK_F11 = &H7A&
%EQUATE `VK_F12 = &H7B&
%EQUATE `VK_F13 = &H7C&
%EQUATE `VK_F14 = &H7D&
%EQUATE `VK_F15 = &H7E&
%EQUATE `VK_F16 = &H7F&
%EQUATE `VK_F17 = &H80&
%EQUATE `VK_F18 = &H81&
%EQUATE `VK_F19 = &H82&
%EQUATE `VK_F20 = &H83&
%EQUATE `VK_F21 = &H84&
%EQUATE `VK_F22 = &H85&
%EQUATE `VK_F23 = &H86&
%EQUATE `VK_F24 = &H87&
'/*
' * 0x88 - 0x8F : unassigned
' */
%EQUATE `VK_NUMLOCK = &H90&
%EQUATE `VK_SCROLL = &H91&
'/*
' * NEC PC-9800 kbd definitions
' */
%EQUATE `VK_OEM_NEC_EQUAL = &H92& ' "=" key on numpad
'/*
' * Fujitsu/OASYS kbd definitions
' */
%EQUATE `VK_OEM_FJ_JISHO = &H92& ' "Dictionary" key
%EQUATE `VK_OEM_FJ_MASSHOU = &H93& ' "Unregister word" key
%EQUATE `VK_OEM_FJ_TOUROKU = &H94& ' "Register word" key
%EQUATE `VK_OEM_FJ_LOYA = &H95& ' "Left OYAYUBI" key
%EQUATE `VK_OEM_FJ_ROYA = &H96& ' "Right OYAYUBI" key
'/*
' * 0x97 - 0x9F : unassigned
' */
'/*
' * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
' * Used only as parameters to GetAsyncKeyState() and GetKeyState().
' * No other API or message will distinguish left and right keys in this way.
' */
%EQUATE `VK_LSHIFT = &HA0&
%EQUATE `VK_RSHIFT = &HA1&
%EQUATE `VK_LCONTROL = &HA2&
%EQUATE `VK_RCONTROL = &HA3&
%EQUATE `VK_LMENU = &HA4&
%EQUATE `VK_RMENU = &HA5&
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `VK_BROWSER_BACK = &HA6&
%EQUATE `VK_BROWSER_FORWARD = &HA7&
%EQUATE `VK_BROWSER_REFRESH = &HA8&
%EQUATE `VK_BROWSER_STOP = &HA9&
%EQUATE `VK_BROWSER_SEARCH = &HAA&
%EQUATE `VK_BROWSER_FAVORITES = &HAB&
%EQUATE `VK_BROWSER_HOME = &HAC&
%EQUATE `VK_VOLUME_MUTE = &HAD&
%EQUATE `VK_VOLUME_DOWN = &HAE&
%EQUATE `VK_VOLUME_UP = &HAF&
%EQUATE `VK_MEDIA_NEXT_TRACK = &HB0&
%EQUATE `VK_MEDIA_PREV_TRACK = &HB1&
%EQUATE `VK_MEDIA_STOP = &HB2&
%EQUATE `VK_MEDIA_PLAY_PAUSE = &HB3&
%EQUATE `VK_LAUNCH_MAIL = &HB4&
%EQUATE `VK_LAUNCH_MEDIA_SELECT = &HB5&
%EQUATE `VK_LAUNCH_APP1 = &HB6&
%EQUATE `VK_LAUNCH_APP2 = &HB7&
'#endif /* _WIN32_WINNT >= 0x0500 */
'/*
' * 0xB8 - 0xB9 : reserved
' */
%EQUATE `VK_OEM_1 = &HBA& ' ";:" for US
%EQUATE `VK_OEM_PLUS = &HBB& ' "+" any country
%EQUATE `VK_OEM_COMMA = &HBC& ' "," any country
%EQUATE `VK_OEM_MINUS = &HBD& ' "-" any country
%EQUATE `VK_OEM_PERIOD = &HBE& ' "." any country
%EQUATE `VK_OEM_2 = &HBF& ' "/?" for US
%EQUATE `VK_OEM_3 = &HC0& ' "`~" for US
'/*
' * 0xC1 - 0xD7 : reserved
' */
'/*
' * 0xD8 - 0xDA : unassigned
' */
%EQUATE `VK_OEM_4 = &HDB& ' "[{" for US
%EQUATE `VK_OEM_5 = &HDC& ' "\|" for US
%EQUATE `VK_OEM_6 = &HDD& ' "]}" for US
%EQUATE `VK_OEM_7 = &HDE& ' """" for US
%EQUATE `VK_OEM_8 = &HDF&
'/*
' * 0xE0 : reserved
' */
'/*
' * Various extended or enhanced keyboards
' */
%EQUATE `VK_OEM_AX = &HE1& ' "AX" key on Japanese AX kbd
%EQUATE `VK_OEM_102 = &HE2& ' "<>" or "\|" on RT 102-key kbd.
%EQUATE `VK_ICO_HELP = &HE3& ' Help key on ICO
%EQUATE `VK_ICO_00 = &HE4& ' 00 key on ICO
'#if(WINVER >= 0x0400)
%EQUATE `VK_PROCESSKEY = &HE5&
'#endif /* WINVER >= 0x0400 */
%EQUATE `VK_ICO_CLEAR = &HE6
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `VK_PACKET = &HE7&
'#endif /* _WIN32_WINNT >= 0x0500 */
'/*
' * 0xE8 : unassigned
' */
'/*
' * Nokia/Ericsson definitions
' */
%EQUATE `VK_OEM_RESET = &HE9&
%EQUATE `VK_OEM_JUMP = &HEA&
%EQUATE `VK_OEM_PA1 = &HEB&
%EQUATE `VK_OEM_PA2 = &HEC&
%EQUATE `VK_OEM_PA3 = &HED&
%EQUATE `VK_OEM_WSCTRL = &HEE&
%EQUATE `VK_OEM_CUSEL = &HEF&
%EQUATE `VK_OEM_ATTN = &HF0&
%EQUATE `VK_OEM_FINISH = &HF1&
%EQUATE `VK_OEM_COPY = &HF2&
%EQUATE `VK_OEM_AUTO = &HF3&
%EQUATE `VK_OEM_ENLW = &HF4&
%EQUATE `VK_OEM_BACKTAB = &HF5&
%EQUATE `VK_ATTN = &HF6&
%EQUATE `VK_CRSEL = &HF7&
%EQUATE `VK_EXSEL = &HF8&
%EQUATE `VK_EREOF = &HF9&
%EQUATE `VK_PLAY = &HFA&
%EQUATE `VK_ZOOM = &HFB&
%EQUATE `VK_NONAME = &HFC&
%EQUATE `VK_PA1 = &HFD&
%EQUATE `VK_OEM_CLEAR = &HFE&
'/*
' * 0xFF : reserved
' */
'#endif /* !NOVIRTUALKEYCODES */
'#ENDIF '#IF NOT %DEF(%NOVIRTUALKEYCODES) '-------------------------------------
'#IF NOT %DEF(%NOWH) '---------------------------------------------
'#ifndef NOWH
'/*
' * SetWindowsHook() codes
' */
%EQUATE `WH_MIN = -1&
%EQUATE `WH_MSGFILTER = -1&
%EQUATE `WH_JOURNALRECORD = 0&
%EQUATE `WH_JOURNALPLAYBACK = 1&
%EQUATE `WH_KEYBOARD = 2&
%EQUATE `WH_GETMESSAGE = 3&
%EQUATE `WH_CALLWNDPROC = 4&
%EQUATE `WH_CBT = 5&
%EQUATE `WH_SYSMSGFILTER = 6&
%EQUATE `WH_MOUSE = 7&
'#if defined(_WIN32_WINDOWS)
%EQUATE `WH_HARDWARE = 8&
'#endif
%EQUATE `WH_DEBUG = 9&
%EQUATE `WH_SHELL = 10&
%EQUATE `WH_FOREGROUNDIDLE = 11&
'#if(WINVER >= 0x0400)
%EQUATE `WH_CALLWNDPROCRET = 12&
'#endif /* WINVER >= 0x0400 */
'#if (_WIN32_WINNT >= 0x0400)
%EQUATE `WH_KEYBOARD_LL = 13&
%EQUATE `WH_MOUSE_LL = 14&
'#endif // (_WIN32_WINNT >= 0x0400)
'#if(WINVER >= 0x0400)
'#if (_WIN32_WINNT >= 0x0400)
'#define WH_MAX 14
'#else
'#define WH_MAX 12
'#endif // (_WIN32_WINNT >= 0x0400)
'#else
'#define WH_MAX 11
'#endif
%EQUATE `WH_MAX = 14& ' depending on Windows version
%EQUATE `WH_MINHOOK = %WH_MIN
%EQUATE `WH_MAXHOOK = %WH_MAX
'/*
' * Hook Codes
' */
%EQUATE `HC_ACTION = 0&
%EQUATE `HC_GETNEXT = 1&
%EQUATE `HC_SKIP = 2&
%EQUATE `HC_NOREMOVE = 3&
%EQUATE `HC_NOREM = %HC_NOREMOVE
%EQUATE `HC_SYSMODALON = 4&
%EQUATE `HC_SYSMODALOFF = 5&
'/*
' * CBT Hook Codes
' */
%EQUATE `HCBT_MOVESIZE = 0&
%EQUATE `HCBT_MINMAX = 1&
%EQUATE `HCBT_QS = 2&
%EQUATE `HCBT_CREATEWND = 3&
%EQUATE `HCBT_DESTROYWND = 4&
%EQUATE `HCBT_ACTIVATE = 5&
%EQUATE `HCBT_CLICKSKIPPED = 6&
%EQUATE `HCBT_KEYSKIPPED = 7&
%EQUATE `HCBT_SYSCOMMAND = 8&
%EQUATE `HCBT_SETFOCUS = 9&
'/*
' * HCBT_ACTIVATE structure pointed to by lParam
' */
' // Size = 8 bytes
TYPE CBTACTIVATESTRUCT DWORD
 fMouse AS LONG
 hWndActive AS DWORD
END TYPE
'#if(_WIN32_WINNT >= 0x0501)
'/*
' * WTSSESSION_NOTIFICATION struct pointed by lParam, for WM_WTSSESSION_CHANGE
' */
' // Size = 8 bytes
TYPE WTSSESSION_NOTIFICATION DWORD
 cbSize AS DWORD
 dwSessionId AS DWORD
END TYPE
'/*
' * codes passed in WPARAM for WM_WTSSESSION_CHANGE
' */
%EQUATE `WTS_CONSOLE_CONNECT = 1&
%EQUATE `WTS_CONSOLE_DISCONNECT = 2&
%EQUATE `WTS_REMOTE_CONNECT = 3&
%EQUATE `WTS_REMOTE_DISCONNECT = 4&
%EQUATE `WTS_SESSION_LOGON = 5&
%EQUATE `WTS_SESSION_LOGOFF = 6&
%EQUATE `WTS_SESSION_LOCK = 7&
%EQUATE `WTS_SESSION_UNLOCK = 8&
%EQUATE `WTS_SESSION_REMOTE_CONTROL = 9&
'#endif /* _WIN32_WINNT >= 0x0501 */
'/*
' * WH_MSGFILTER Filter Proc Codes
' */
%EQUATE `MSGF_DIALOGBOX = 0&
%EQUATE `MSGF_MESSAGEBOX = 1&
%EQUATE `MSGF_MENU = 2&
%EQUATE `MSGF_MOVE = 3&
%EQUATE `MSGF_SIZE = 4&
%EQUATE `MSGF_SCROLLBAR = 5&
%EQUATE `MSGF_NEXTWINDOW = 6&
%EQUATE `MSGF_MAX = 8&
%EQUATE `MSGF_USER = 4096&
'/*
' * Shell support
' */
%EQUATE `HSHELL_WINDOWCREATED = 1&
%EQUATE `HSHELL_WINDOWDESTROYED = 2&
%EQUATE `HSHELL_ACTIVATESHELLWINDOW = 3&
'#if(WINVER >= 0x0400)
%EQUATE `HSHELL_WINDOWACTIVATED = 4&
%EQUATE `HSHELL_GETMINRECT = 5&
%EQUATE `HSHELL_REDRAW = 6&
%EQUATE `HSHELL_TASKMAN = 7&
%EQUATE `HSHELL_LANGUAGE = 8&
%EQUATE `HSHELL_SYSMENU = 9&
%EQUATE `HSHELL_ENDTASK = 10&
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `HSHELL_ACCESSIBILITYSTATE = 11&
%EQUATE `HSHELL_APPCOMMAND = 12&
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `HSHELL_WINDOWREPLACED = 13&
%EQUATE `HSHELL_WINDOWREPLACING = 14&
'#endif /* _WIN32_WINNT >= 0x0501 */
%EQUATE `HSHELL_HIGHBIT = &H8000
%EQUATE `HSHELL_FLASH = %HSHELL_REDRAW OR %HSHELL_HIGHBIT
%EQUATE `HSHELL_RUDEAPPACTIVATED = %HSHELL_WINDOWACTIVATED OR %HSHELL_HIGHBIT
'#if(_WIN32_WINNT >= 0x0500)
'/* wparam for HSHELL_ACCESSIBILITYSTATE */
%EQUATE `ACCESS_STICKYKEYS = &H0001
%EQUATE `ACCESS_FILTERKEYS = &H0002
%EQUATE `ACCESS_MOUSEKEYS = &H0003
%EQUATE `APPCOMMAND_BROWSER_BACKWARD = 1&
%EQUATE `APPCOMMAND_BROWSER_FORWARD = 2&
%EQUATE `APPCOMMAND_BROWSER_REFRESH = 3&
%EQUATE `APPCOMMAND_BROWSER_STOP = 4&
%EQUATE `APPCOMMAND_BROWSER_SEARCH = 5&
%EQUATE `APPCOMMAND_BROWSER_FAVORITES = 6&
%EQUATE `APPCOMMAND_BROWSER_HOME = 7&
%EQUATE `APPCOMMAND_VOLUME_MUTE = 8&
%EQUATE `APPCOMMAND_VOLUME_DOWN = 9&
%EQUATE `APPCOMMAND_VOLUME_UP = 10&
%EQUATE `APPCOMMAND_MEDIA_NEXTTRACK = 11&
%EQUATE `APPCOMMAND_MEDIA_PREVIOUSTRACK = 12&
%EQUATE `APPCOMMAND_MEDIA_STOP = 13&
%EQUATE `APPCOMMAND_MEDIA_PLAY_PAUSE = 14&
%EQUATE `APPCOMMAND_LAUNCH_MAIL = 15&
%EQUATE `APPCOMMAND_LAUNCH_MEDIA_SELECT = 16&
%EQUATE `APPCOMMAND_LAUNCH_APP1 = 17&
%EQUATE `APPCOMMAND_LAUNCH_APP2 = 18&
%EQUATE `APPCOMMAND_BASS_DOWN = 19&
%EQUATE `APPCOMMAND_BASS_BOOST = 20&
%EQUATE `APPCOMMAND_BASS_UP = 21&
%EQUATE `APPCOMMAND_TREBLE_DOWN = 22&
%EQUATE `APPCOMMAND_TREBLE_UP = 23&
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `APPCOMMAND_MICROPHONE_VOLUME_MUTE = 24&
%EQUATE `APPCOMMAND_MICROPHONE_VOLUME_DOWN = 25&
%EQUATE `APPCOMMAND_MICROPHONE_VOLUME_UP = 26&
%EQUATE `APPCOMMAND_HELP = 27&
%EQUATE `APPCOMMAND_FIND = 28&
%EQUATE `APPCOMMAND_NEW = 29&
%EQUATE `APPCOMMAND_OPEN = 30&
%EQUATE `APPCOMMAND_CLOSE = 31&
%EQUATE `APPCOMMAND_SAVE = 32&
%EQUATE `APPCOMMAND_PRINT = 33&
%EQUATE `APPCOMMAND_UNDO = 34&
%EQUATE `APPCOMMAND_REDO = 35&
%EQUATE `APPCOMMAND_COPY = 36&
%EQUATE `APPCOMMAND_CUT = 37&
%EQUATE `APPCOMMAND_PASTE = 38&
%EQUATE `APPCOMMAND_REPLY_TO_MAIL = 39&
%EQUATE `APPCOMMAND_FORWARD_MAIL = 40&
%EQUATE `APPCOMMAND_SEND_MAIL = 41&
%EQUATE `APPCOMMAND_SPELL_CHECK = 42&
%EQUATE `APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE = 43&
%EQUATE `APPCOMMAND_MIC_ON_OFF_TOGGLE = 44&
%EQUATE `APPCOMMAND_CORRECTION_LIST = 45&
%EQUATE `APPCOMMAND_MEDIA_PLAY = 46&
%EQUATE `APPCOMMAND_MEDIA_PAUSE = 47&
%EQUATE `APPCOMMAND_MEDIA_RECORD = 48&
%EQUATE `APPCOMMAND_MEDIA_FAST_FORWARD = 49&
%EQUATE `APPCOMMAND_MEDIA_REWIND = 50&
%EQUATE `APPCOMMAND_MEDIA_CHANNEL_UP = 51&
%EQUATE `APPCOMMAND_MEDIA_CHANNEL_DOWN = 52&
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `APPCOMMAND_DELETE = 53&
%EQUATE `APPCOMMAND_DWM_FLIP3D = 54&
'#endif /* _WIN32_WINNT >= 0x0600 */
%EQUATE `FAPPCOMMAND_MOUSE = &H8000
%EQUATE `FAPPCOMMAND_KEY = 0
%EQUATE `FAPPCOMMAND_OEM = &H1000
%EQUATE `FAPPCOMMAND_MASK = &HF000
'#define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
'#define GET_DEVICE_LPARAM(lParam) ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))
'#define GET_MOUSEORKEY_LPARAM GET_DEVICE_LPARAM
'#define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
'#define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
MACRO GET_APPCOMMAND_LPARAM(lParam) = BITS%(HI(WORD, lParam) AND (NOT %FAPPCOMMAND_MASK))
MACRO GET_DEVICE_LPARAM(lParam) = BITS??(HI(WORD, lParam) AND %FAPPCOMMAND_MASK))
MACRO GET_MOUSEORKEY_LPARAM = GET_DEVICE_LPARAM
MACRO GET_FLAGS_LPARAM(lParam) = LO(WORD, lParam)
MACRO GET_KEYSTATE_LPARAM(lParam) = GET_FLAGS_LPARAM(lParam)
'#endif /* _WIN32_WINNT >= 0x0500 */
' // Size = 20 bytes
TYPE SHELLHOOKINFO DWORD
 hwnd AS DWORD
 rc AS RECT ' RECT
END TYPE
'/*
' * Message Structure used in Journaling
' */
UNION EVENTMSG_TIME_UNION
 time AS DWORD
 ' // For compatibility with the PB includes
 dtime AS DWORD
END UNION
' // Size = 20 bytes
TYPE EVENTMSG DWORD
 message AS DWORD ' UINT
 paramL AS DWORD ' UINT
 paramH AS DWORD ' UINT
 EVENTMSG_TIME_UNION
 hwnd AS DWORD
END TYPE
'/*
' * Message structure used by WH_CALLWNDPROC
' */
' // Size = 16 bytes
TYPE CWPSTRUCT DWORD
 lParam AS LONG
 wParam AS LONG ' WPARAM
 message AS DWORD ' UINT
 hwnd AS DWORD
END TYPE
'#if(WINVER >= 0x0400)
'/*
' * Message structure used by WH_CALLWNDPROCRET
' */
' // Size = 20 bytes
TYPE CWPRETSTRUCT DWORD
 lResult AS LONG ' LRESULT
 lParam AS LONG
 wParam AS DWORD ' WPARAM
 message AS DWORD ' UINT
 hwnd AS DWORD
END TYPE
'#endif /* WINVER >= 0x0400 */
'#if (_WIN32_WINNT >= 0x0400)
'/*
' * Low level hook flags
' */
'#define LLKHF_EXTENDED (KF_EXTENDED >> 8)
'#define LLKHF_INJECTED 0x00000010
'#define LLKHF_ALTDOWN (KF_ALTDOWN >> 8)
'#define LLKHF_UP (KF_UP >> 8)
%EQUATE `LLKHF_EXTENDED = &H00000001
%EQUATE `LLKHF_INJECTED = &H00000010
%EQUATE `LLKHF_ALTDOWN = &H00000020
%EQUATE `LLKHF_UP = &H00000080
%EQUATE `LLMHF_INJECTED = &H00000001
'/*
' * Structure used by WH_KEYBOARD_LL
' */
' // Size = 20 bytes
TYPE KBDLLHOOKSTRUCT DWORD
 vkCode AS DWORD
 scanCode AS DWORD
 flags AS DWORD
 time AS DWORD
 dwExtraInfo AS DWORD ' ULONG_PTR
END TYPE
'/*
' * Structure used by WH_MOUSE_LL
' */
' // Size = 24 bytes
TYPE MSLLHOOKSTRUCT DWORD
 pt AS POINT ' POINT pt
 mouseData AS DWORD ' DWORD mouseData
 flags AS DWORD ' DWORD flags
 time AS DWORD ' DWORD time
 dwExtraInfo AS DWORD ' ULONG_PTR dwExtraInfo
END TYPE
'#endif // (_WIN32_WINNT >= 0x0400)
'/*
' * Structure used by WH_DEBUG
' */
' // Size = 20 bytes
TYPE DEBUGHOOKINFO DWORD
 idThread AS DWORD
 idThreadInstaller AS DWORD
 lParam AS LONG
 wParam AS DWORD ' WPARAM
 code AS LONG ' int
END TYPE
'/*
' * Structure used by WH_MOUSE
' */
' // Size = 20 bytes
TYPE MOUSEHOOKSTRUCT DWORD
 pt AS POINT
 hwnd AS DWORD
 wHitTestCode AS DWORD ' UINT
 dwExtraInfo AS DWORD ' ULONG_PTR
END TYPE
' // Size = 24 bytes
TYPE MOUSEHOOKSTRUCTEX DWORD
 MOUSEHOOKSTRUCT
 mouseData AS DWORD ' DWORD mouseData
END TYPE
'#endif
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(WINVER >= 0x0400)
'/*
' * Structure used by WH_HARDWARE
' */
' // Size = 16 bytes
TYPE HARDWAREHOOKSTRUCT DWORD
 hwnd AS DWORD
 message AS DWORD ' UINT
 wParam AS DWORD ' WPARAM
 lParam AS LONG
END TYPE
'#endif /* WINVER >= 0x0400 */
'#endif /* !NOWH */
'#ENDIF '#IF NOT %DEF(%NOWH) '-------------------------------------
'/*
' * Keyboard Layout API
' */
%EQUATE `HKL_PREV = 0
%EQUATE `HKL_NEXT = 1
%EQUATE `KLF_ACTIVATE = &H00000001
%EQUATE `KLF_SUBSTITUTE_OK = &H00000002
%EQUATE `KLF_UNLOADPREVIOUS = &H00000004
%EQUATE `KLF_REORDER = &H00000008
'#if(WINVER >= 0x0400)
%EQUATE `KLF_REPLACELANG = &H00000010
%EQUATE `KLF_NOTELLSHELL = &H00000080
'#endif /* WINVER >= 0x0400 */
'#endif /* WINVER >= 0x0400 */
%EQUATE `KLF_SETFORPROCESS = &H00000100
%EQUATE `KLF_SHIFTLOCK = &H00010000
%EQUATE `KLF_RESET = &H40000000
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(WINVER >= 0x0500)
'/*
' * Bits in wParam of WM_INPUTLANGCHANGEREQUEST message
' */
%EQUATE `INPUTLANGCHANGE_SYSCHARSET = &H0001
%EQUATE `INPUTLANGCHANGE_FORWARD = &H0002
%EQUATE `INPUTLANGCHANGE_BACKWARD = &H0004
'#endif /* WINVER >= 0x0500 */
'/*
' * Size of KeyboardLayoutName (number of characters), including nul terminator
' */
%EQUATE `KL_NAMELENGTH = 9
DECLARE FUNCTION LoadKeyboardLayoutA LIB "user32.dll" ALIAS "LoadKeyboardLayoutA" ( BYREF pwszKLID AS ASCIIZ , BYVAL Flags AS QUAD ) AS QUAD ' HKL
DECLARE FUNCTION LoadKeyboardLayoutW LIB "user32.dll" ALIAS "LoadKeyboardLayoutW" ( BYREF pwszKLID AS WSTRINGZ , BYVAL Flags AS QUAD ) AS QUAD ' HKL
#IF %DEF(%UNICODE)
 MACRO LoadKeyboardLayout = LoadKeyboardLayoutW
#ELSE
 MACRO LoadKeyboardLayout = LoadKeyboardLayoutA
#ENDIF
DECLARE FUNCTION ActivateKeyboardLayout LIB "user32.dll" ALIAS "ActivateKeyboardLayout" ( BYVAL hkl AS QUAD , BYVAL Flags AS QUAD ) AS QUAD ' HKL
'#if(WINVER >= 0x0400)
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION ToUnicodeEx LIB "User32.dll" ALIAS "ToUnicodeEx" (BYVAL uVirtKey AS QUAD, BYVAL uScanCode AS QUAD, BYVAL lpKeyState AS BYTE PTR, pwszBuff AS WSTRINGZ, BYVAL cchBuff AS LONG, BYVAL uFlags AS QUAD, OPTIONAL BYVAL dwhkl AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION ToUnicodeEx LIB "user32.dll" ALIAS "ToUnicodeEx" ( BYVAL wVirtKey AS QUAD , BYVAL wScanCode AS QUAD , BYREF lpKeyState AS BYTE , BYREF pwszBuff AS WSTRINGZ , BYVAL cchBuff AS LONG , BYVAL wFlags AS QUAD , OPTIONAL BYVAL dwhkl AS QUAD ) AS LONG ' int
#ENDIF
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION UnloadKeyboardLayout LIB "user32.dll" ALIAS "UnloadKeyboardLayout" ( BYVAL hkl AS QUAD ) AS LONG
DECLARE FUNCTION GetKeyboardLayoutNameA LIB "user32.dll" ALIAS "GetKeyboardLayoutNameA" ( BYREF pwszKLID AS ASCIIZ
 ) AS LONG
DECLARE FUNCTION GetKeyboardLayoutNameW LIB "user32.dll" ALIAS "GetKeyboardLayoutNameW" ( BYREF pwszKLID AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetKeyboardLayoutName = GetKeyboardLayoutNameW
#ELSE
 MACRO GetKeyboardLayoutName = GetKeyboardLayoutNameA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetKeyboardLayoutList LIB "User32.dll" ALIAS "GetKeyboardLayoutList" (BYVAL nBuff AS LONG, BYVAL lpList AS QUAD PTR) AS LONG
#ELSE
DECLARE FUNCTION GetKeyboardLayoutList LIB "user32.dll" ALIAS "GetKeyboardLayoutList" ( BYVAL nBuff AS LONG , BYREF lpList AS QUAD ) AS LONG ' int
#ENDIF
DECLARE FUNCTION GetKeyboardLayout LIB "user32.dll" ALIAS "GetKeyboardLayout" ( BYVAL idThread AS QUAD ) AS QUAD ' HKL
'#if(WINVER >= 0x0500)
UNION MOUSEMOVEPOINT_TIME_UNION
 time AS DWORD
 ' // For compatibility with the PB includes
 dtime AS DWORD
END UNION
' // Size = 16 bytes
TYPE MOUSEMOVEPOINT DWORD
 x AS LONG ' int
 y AS LONG ' int
 MOUSEMOVEPOINT_TIME_UNION
 dwExtraInfo AS DWORD ' ULONG_PTR
END TYPE
'/*
' * Values for resolution parameter of GetMouseMovePointsEx
' */
%EQUATE `GMMP_USE_DISPLAY_POINTS = 1&
%EQUATE `GMMP_USE_HIGH_RESOLUTION_POINTS = 2&
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetMouseMovePointsEx LIB "User32.dll" ALIAS "GetMouseMovePointsEx" (BYVAL cbSize AS QUAD, lppt AS MOUSEMOVEPOINT, BYVAL lpptBuf AS MOUSEMOVEPOINT PTR, BYVAL nBufPoints AS LONG, BYVAL resolution AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION GetMouseMovePointsEx LIB "user32.dll" ALIAS "GetMouseMovePointsEx" ( BYVAL cbSize AS QUAD , BYREF lppt AS MOUSEMOVEPOINT , BYREF lpptBuf AS MOUSEMOVEPOINT , BYVAL nBufPoints AS LONG , BYVAL resolution AS QUAD ) AS LONG ' int
#ENDIF
'#endif /* WINVER >= 0x0500 */
'#IF NOT %DEF(%NODESKTOP) '----------------------------
'#ifndef NODESKTOP
'/*
' * Desktop-specific access flags
' */
%EQUATE `DESKTOP_READOBJECTS = &H0001
%EQUATE `DESKTOP_CREATEWINDOW = &H0002
%EQUATE `DESKTOP_CREATEMENU = &H0004
%EQUATE `DESKTOP_HOOKCONTROL = &H0008
%EQUATE `DESKTOP_JOURNALRECORD = &H0010
%EQUATE `DESKTOP_JOURNALPLAYBACK = &H0020
%EQUATE `DESKTOP_ENUMERATE = &H0040
%EQUATE `DESKTOP_WRITEOBJECTS = &H0080
%EQUATE `DESKTOP_SWITCHDESKTOP = &H0100
'/*
' * Desktop-specific control flags
' */
%EQUATE `DF_ALLOWOTHERACCOUNTHOOK = &H0001
'#IF %DEF (%WINGDI_INC)
'#IF NOT %DEF(%NOGDI)
'#ifdef _WINGDI_
'#ifndef NOGDI
DECLARE FUNCTION CreateDesktopA LIB "user32.dll" ALIAS "CreateDesktopA" ( BYREF lpszDesktop AS ASCIIZ , BYREF lpszDevice AS ASCIIZ , BYREF pDevmode AS DEVMODEA , BYVAL dwFlags AS QUAD , BYVAL dwDesiredAccess AS QUAD , OPTIONAL BYREF lpsa AS SECURITY_ATTRIBUTES ) AS QUAD ' HDESK
DECLARE FUNCTION CreateDesktopW LIB "user32.dll" ALIAS "CreateDesktopW" ( BYREF lpszDesktop AS WSTRINGZ , BYREF lpszDevice AS WSTRINGZ , BYREF pDevmode AS DEVMODEW , BYVAL dwFlags AS QUAD , BYVAL dwDesiredAccess AS QUAD , OPTIONAL BYREF lpsa AS SECURITY_ATTRIBUTES ) AS QUAD ' HDESK
#IF %DEF(%UNICODE)
 MACRO CreateDesktop = CreateDesktopW
#ELSE
 MACRO CreateDesktop = CreateDesktopA
#ENDIF
DECLARE FUNCTION CreateDesktopExA LIB "user32.dll" ALIAS "CreateDesktopExA" ( BYREF lpszDesktop AS ASCIIZ , BYREF lpszDevice AS ASCIIZ , BYREF pDevmode AS DEVMODEA , BYVAL dwFlags AS QUAD , BYVAL dwDesiredAccess AS QUAD , BYREF lpsa AS SECURITY_ATTRIBUTES , BYVAL ulHeapSize AS QUAD , BYVAL pvoid AS QUAD ) AS QUAD ' HDESK
DECLARE FUNCTION CreateDesktopExW LIB "user32.dll" ALIAS "CreateDesktopExW" ( BYREF lpszDesktop AS WSTRINGZ , BYREF lpszDevice AS WSTRINGZ , BYREF pDevmode AS DEVMODEW , BYVAL dwFlags AS QUAD , BYVAL dwDesiredAccess AS QUAD , BYREF lpsa AS SECURITY_ATTRIBUTES , BYVAL ulHeapSize AS QUAD , BYVAL pvoid AS QUAD ) AS QUAD ' HDESK
#IF %DEF(%UNICODE)
 MACRO CreateDesktopEx = CreateDesktopExW
#ELSE
 MACRO CreateDesktopEx = CreateDesktopExA
#ENDIF
'#endif /* NOGDI */
'#endif /* _WINGDI_ */
'#ENDIF ' /* %NOGDI */
'#ENDIF ' /* %WINGDI_INC */
DECLARE FUNCTION OpenDesktopA LIB "user32.dll" ALIAS "OpenDesktopA" ( BYREF lpszDesktop AS ASCIIZ , BYVAL dwFlags AS QUAD , BYVAL fInherit AS LONG , BYVAL dwDesiredAccess AS QUAD ) AS QUAD ' HDESK
DECLARE FUNCTION OpenDesktopW LIB "user32.dll" ALIAS "OpenDesktopW" ( BYREF lpszDesktop AS WSTRINGZ , BYVAL dwFlags AS QUAD , BYVAL fInherit AS LONG , BYVAL dwDesiredAccess AS QUAD ) AS QUAD ' HDESK
#IF %DEF(%UNICODE)
 MACRO OpenDesktop = OpenDesktopW
#ELSE
 MACRO OpenDesktop = OpenDesktopA
#ENDIF
DECLARE FUNCTION OpenInputDesktop LIB "user32.dll" ALIAS "OpenInputDesktop" ( BYVAL dwFlags AS QUAD , BYVAL fInherit AS LONG , BYVAL dwDesiredAccess AS QUAD ) AS QUAD ' HDESK
DECLARE FUNCTION EnumDesktopsA LIB "user32.dll" ALIAS "EnumDesktopsA" ( BYVAL hwinsta AS QUAD , BYVAL lpEnumFunc AS QUAD , BYVAL lParam AS LONG ) AS LONG
DECLARE FUNCTION EnumDesktopsW LIB "user32.dll" ALIAS "EnumDesktopsW" ( BYVAL hwinsta AS QUAD
 , BYVAL lpEnumFunc AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO EnumDesktops = EnumDesktopsW
#ELSE
 MACRO EnumDesktops = EnumDesktopsA
#ENDIF
DECLARE FUNCTION EnumDesktopWindows LIB "user32.dll" ALIAS "EnumDesktopWindows" ( BYVAL hDesktop AS QUAD , BYVAL lpfn AS QUAD , BYVAL lParam AS LONG ) AS LONG
DECLARE FUNCTION SwitchDesktop LIB "user32.dll" ALIAS "SwitchDesktop" ( BYVAL hDesktop AS QUAD
 ) AS LONG
DECLARE FUNCTION SetThreadDesktop LIB "user32.dll" ALIAS "SetThreadDesktop" ( BYVAL hDesktop AS DWORD
 ) AS LONG
DECLARE FUNCTION CloseDesktop LIB "user32.dll" ALIAS "CloseDesktop" ( BYVAL hDesktop AS DWORD
 ) AS LONG
DECLARE FUNCTION GetThreadDesktop LIB "user32.dll" ALIAS "GetThreadDesktop" ( BYVAL dwThreadId AS DWORD
 ) AS DWORD ' HDESK
'#endif /* !NODESKTOP */
'#ENDIF ' #IF NOT %DEF(%NODESKTOP) '-------------------
'#IF NOT %DEF(%NOWINDOWSTATION) '----------------------
'#ifndef NOWINDOWSTATION
'/*
' * Windowstation-specific access flags
' */
%EQUATE `WINSTA_ENUMDESKTOPS = &H0001
%EQUATE `WINSTA_READATTRIBUTES = &H0002
%EQUATE `WINSTA_ACCESSCLIPBOARD = &H0004
%EQUATE `WINSTA_CREATEDESKTOP = &H0008
%EQUATE `WINSTA_WRITEATTRIBUTES = &H0010
%EQUATE `WINSTA_ACCESSGLOBALATOMS = &H0020
%EQUATE `WINSTA_EXITWINDOWS = &H0040
%EQUATE `WINSTA_ENUMERATE = &H0100
%EQUATE `WINSTA_READSCREEN = &H0200
%EQUATE `WINSTA_ALL_ACCESS = %WINSTA_ENUMDESKTOPS OR %WINSTA_READATTRIBUTES OR %WINSTA_ACCESSCLIPBOARD OR %WINSTA_CREATEDESKTOP OR %WINSTA_WRITEATTRIBUTES OR %WINSTA_ACCESSGLOBALATOMS OR %WINSTA_EXITWINDOWS OR %WINSTA_ENUMERATE OR %WINSTA_READSCREEN
'/*
' * Windowstation creation flags.
' */
%EQUATE `CWF_CREATE_ONLY = &H00000001
'/*
' * Windowstation-specific attribute flags
' */
%EQUATE `WSF_VISIBLE = &H0001
DECLARE FUNCTION CreateWindowStationA LIB "user32.dll" ALIAS "CreateWindowStationA" ( BYREF lpwinsta AS ASCIIZ , BYVAL dwFlags AS QUAD , BYVAL dwDesiredAccess AS QUAD , OPTIONAL BYREF lpsa AS SECURITY_ATTRIBUTES ) AS QUAD ' HWINSTA
DECLARE FUNCTION CreateWindowStationW LIB "user32.dll" ALIAS "CreateWindowStationW" ( BYREF lpwinsta AS WSTRINGZ , BYVAL dwFlags AS QUAD , BYVAL dwDesiredAccess AS QUAD , OPTIONAL BYREF lpsa AS SECURITY_ATTRIBUTES ) AS QUAD ' HWINSTA
#IF %DEF(%UNICODE)
 MACRO CreateWindowStation = CreateWindowStationW
#ELSE
 MACRO CreateWindowStation = CreateWindowStationA
#ENDIF
DECLARE FUNCTION OpenWindowStationA LIB "user32.dll" ALIAS "OpenWindowStationA" ( BYREF lpszWinSta AS ASCIIZ , BYVAL fInherit AS LONG , BYVAL dwDesiredAccess AS QUAD ) AS QUAD ' HWINSTA
DECLARE FUNCTION OpenWindowStationW LIB "user32.dll" ALIAS "OpenWindowStationW" ( BYREF lpszWinSta AS WSTRINGZ , BYVAL fInherit AS LONG , BYVAL dwDesiredAccess AS QUAD ) AS QUAD ' HWINSTA
#IF %DEF(%UNICODE)
 MACRO OpenWindowStation = OpenWindowStationW
#ELSE
 MACRO OpenWindowStation = OpenWindowStationA
#ENDIF
DECLARE FUNCTION EnumWindowStationsA LIB "user32.dll" ALIAS "EnumWindowStationsA" ( BYVAL lpEnumFunc AS QUAD , BYVAL lParam AS LONG ) AS LONG
DECLARE FUNCTION EnumWindowStationsW LIB "user32.dll" ALIAS "EnumWindowStationsW" ( BYVAL lpEnumFunc AS QUAD
 , BYVAL lParam AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO EnumWindowStations = EnumWindowStationsW
#ELSE
 MACRO EnumWindowStations = EnumWindowStationsA
#ENDIF
DECLARE FUNCTION CloseWindowStation LIB "user32.dll" ALIAS "CloseWindowStation" ( BYVAL hWinSta AS QUAD ) AS LONG
DECLARE FUNCTION SetProcessWindowStation LIB "user32.dll" ALIAS "SetProcessWindowStation" ( BYVAL hWinSta AS QUAD
 ) AS LONG
DECLARE FUNCTION GetProcessWindowStation LIB "user32.dll" ALIAS "GetProcessWindowStation" ( ) AS DWORD ' HWINSTA
'#endif /* !NOWINDOWSTATION */
'#ENDIF ' #IF NOT %DEF(%NOWINDOWSTATION) '-------------
'#IF NOT %DEF(%NOSECURITY) ' -----------------------------------
'#ifndef NOSECURITY
DECLARE FUNCTION SetUserObjectSecurity LIB "user32.dll" ALIAS "SetUserObjectSecurity" ( BYVAL hObj AS QUAD , BYREF pSIRequested AS SECURITY_INFORMATION , BYREF pSID AS SECURITY_DESCRIPTOR ) AS LONG
DECLARE FUNCTION GetUserObjectSecurity LIB "user32.dll" ALIAS "GetUserObjectSecurity" ( BYVAL hObj AS QUAD
 , BYREF pSIRequested AS SECURITY_INFORMATION
 , BYREF pSID AS SECURITY_DESCRIPTOR
 , BYVAL nLength AS DWORD
 , BYREF lpnLengthNeeded AS DWORD
 ) AS LONG
%EQUATE `UOI_FLAGS = 1&
%EQUATE `UOI_NAME = 2&
%EQUATE `UOI_TYPE = 3&
%EQUATE `UOI_USER_SID = 4&
'#if(WINVER >= 0x0600)
%EQUATE `UOI_HEAPSIZE = 5&
%EQUATE `UOI_IO = 6&
'#endif /* WINVER >= 0x0600 */
' // Size = 12 bytes
TYPE USEROBJECTFLAGS DWORD
 fInherit AS LONG
 fReserved AS LONG
 dwFlags AS DWORD
END TYPE
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetUserObjectInformationA LIB "User32.dll" ALIAS "GetUserObjectInformationA" (BYVAL hObj AS QUAD, BYVAL nIndex AS LONG, BYVAL pvInfo AS QUAD, BYVAL nLength AS QUAD, lpnLengthNeeded AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION GetUserObjectInformationA LIB "user32.dll" ALIAS "GetUserObjectInformationA" ( BYVAL hObj AS QUAD , BYVAL nIndex AS LONG , BYREF pvInfo AS ANY , BYVAL nLength AS QUAD , OPTIONAL BYREF lpnLengthNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetUserObjectInformationW LIB "User32.dll" ALIAS "GetUserObjectInformationW" (BYVAL hObj AS QUAD, BYVAL nIndex AS LONG, BYVAL pvInfo AS QUAD, BYVAL nLength AS QUAD, lpnLengthNeeded AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION GetUserObjectInformationW LIB "user32.dll" ALIAS "GetUserObjectInformationW" ( BYVAL hObj AS QUAD , BYVAL nIndex AS LONG , BYREF pvInfo AS ANY , BYVAL nLength AS QUAD , OPTIONAL BYREF lpnLengthNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetUserObjectInformation = GetUserObjectInformationW
#ELSE
 MACRO GetUserObjectInformation = GetUserObjectInformationA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetUserObjectInformationA LIB "User32.dll" ALIAS "SetUserObjectInformationA" (BYVAL hObj AS QUAD, BYVAL nIndex AS LONG, BYVAL pvInfo AS QUAD, BYVAL nLength AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION SetUserObjectInformationA LIB "user32.dll" ALIAS "SetUserObjectInformationA" ( BYVAL hObj AS QUAD , BYVAL nIndex AS LONG , BYREF pvInfo AS ANY , BYVAL nLength AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetUserObjectInformationW LIB "User32.dll" ALIAS "SetUserObjectInformationW" (BYVAL hObj AS QUAD, BYVAL nIndex AS LONG, BYVAL pvInfo AS QUAD, BYVAL nLength AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION SetUserObjectInformationW LIB "user32.dll" ALIAS "SetUserObjectInformationW" ( BYVAL hObj AS QUAD , BYVAL nIndex AS LONG , BYREF pvInfo AS ANY , BYVAL nLength AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO SetUserObjectInformation = SetUserObjectInformationW
#ELSE
 MACRO SetUserObjectInformation = SetUserObjectInformationA
#ENDIF
'#endif /* !NOSECURITY */
'#ENDIF ' #IF NOT %DEF(%NOSECURITY) '-------------------------------
'#if(WINVER >= 0x0400)
' // Size = 48 bytes
TYPE WNDCLASSEXA BYTE
 cbSize AS DWORD ' UINT
 ' /* Win 3.x */
 style AS DWORD ' UINT
 lpfnWndProc AS DWORD ' WNDPROC
 cbClsExtra AS LONG ' int
 cbWndExtra AS LONG ' int
 hInstance AS DWORD ' HINSTANCE
 hIcon AS DWORD ' HICON
 hCursor AS DWORD ' HCURSOR
 hbrBackground AS DWORD ' HBRUSH
 lpszMenuName AS ASCIIZ PTR
 lpszClassName AS ASCIIZ PTR
 ' /* Win 4.0 */
 hIconSm AS DWORD ' HICON
END TYPE
' // Size = 48 bytes
' // Predefined as of PBWIN 10
TYPE WNDCLASSEXW BYTE
 cbSize AS DWORD ' UINT
 ' /* Win 3.x */
 style AS DWORD ' UINT
 lpfnWndProc AS DWORD ' WNDPROC
 cbClsExtra AS LONG ' int
 cbWndExtra AS LONG ' int
 hInstance AS DWORD ' HINSTANCE
 hIcon AS DWORD ' HICON
 hCursor AS DWORD ' HCURSOR
 hbrBackground AS DWORD ' HBRUSH
 lpszMenuName AS WSTRINGZ PTR
 lpszClassName AS WSTRINGZ PTR
 ' /* Win 4.0 */
 hIconSm AS DWORD ' HICON
END TYPE
#IF %DEF(%UNICODE)
MACRO WNDCLASSEX = WNDCLASSEXW
#ELSE
MACRO WNDCLASSEX = WNDCLASSEXA
#ENDIF ' UNICODE
'#endif /* WINVER >= 0x0400 */
' // Size = 40 bytes
TYPE WNDCLASSA BYTE
 style AS DWORD ' UINT
 lpfnwndproc AS DWORD ' WNDPROC
 cbClsextra AS LONG ' int
 cbWndExtra AS LONG ' int
 hInstance AS DWORD ' HINSTANCE
 hIcon AS DWORD ' HICON
 hCursor AS DWORD ' HCURSOR
 hbrBackground AS DWORD ' HBRUSH
 lpszMenuName AS ASCIIZ PTR
 lpszClassName AS ASCIIZ PTR
END TYPE
' // Size = 40 bytes
TYPE WNDCLASSW BYTE
 style AS DWORD ' UINT
 lpfnwndproc AS DWORD ' WNDPROC
 cbClsextra AS LONG ' int
 cbWndExtra AS LONG ' int
 hInstance AS DWORD ' HINSTANCE
 hIcon AS DWORD ' HICON
 hCursor AS DWORD ' HCURSOR
 hbrBackground AS DWORD ' HBRUSH
 lpszMenuName AS WSTRINGZ PTR
 lpszClassName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
MACRO WNDCLASS = WNDCLASSW
#ELSE
MACRO WNDCLASS = WNDCLASSA
#ENDIF ' UNICODE
DECLARE FUNCTION IsHungAppWindow LIB "user32.dll" ALIAS "IsHungAppWindow" ( BYVAL hwnd AS QUAD ) AS LONG
'#if(WINVER >= 0x0501)
DECLARE SUB DisableProcessWindowsGhosting LIB "user32.dll" ALIAS "DisableProcessWindowsGhosting" ( )
'#endif /* WINVER >= 0x0501 */
'#IF NOT %DEF(%NOMSG) '---------------------------------------------------------
'#ifndef NOMSG
'/*
' * Message structure
' */
#IF NOT %DEF(%MSG_DEFINED)
%EQUATE `MSG_DEFINED = 1
' // Size = 28 bytes
TYPE tagMSG DWORD
 hwnd AS DWORD
 message AS DWORD ' UINT
 wParam AS DWORD ' WPARAM
 lParam AS LONG
 time AS DWORD
 pt AS POINT
END TYPE
#ENDIF
'#define POINTSTOPOINT(pt, pts) \
' { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts); \
' (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); }
SUB POINTSTOPOINT(BYREF pt AS POINT, BYREF pts AS POINTS)
 pt.x = LO(WORD, pts.x)
 pt.y = HI(WORD, pts.y)
END SUB
'#define POINTTOPOINTS(pt) (MAKELONG((short)((pt).x), (short)((pt).y)))
MACRO POINTTOPOINTS(pt, pts)
 pts.x = BITS(INTEGER, pt.x)
 pts.y = BITS(INTEGER, pt.y)
END MACRO
'#define MAKEWPARAM(l, h) ((WPARAM)(DWORD)MAKELONG(l, h))
'#define MAKELPARAM(l, h) ((LPARAM)(DWORD)MAKELONG(l, h))
'#define MAKELRESULT(l, h) ((LRESULT)(DWORD)MAKELONG(l, h))
MACRO MAKEWPARAM(l, h) = MAK(DWORD, l, h)
MACRO MAKELPARAM(l, h) = BITS(LONG, MAK(DWORD, l, h))
MACRO MAKELRESULT(l, h) = BITS(LONG, MAK(DWORD, l, h))
'#endif /* !NOMSG */
'#ENDIF ' #IF NOT %DEF(%NOMSG) '---------------------------------------------
'#IF NOT %DEF(%NOWINOFFSETS) '--------------------------------------------------
'#ifndef NOWINOFFSETS
'/*
' * Window field offsets for GetWindowLong()
' */
%EQUATE `GWL_WNDPROC = -4&
%EQUATE `GWL_HINSTANCE = -6&
%EQUATE `GWL_hwndParent = -8&
%EQUATE `GWL_STYLE = -16&
%EQUATE `GWL_EXSTYLE = -20&
%EQUATE `GWL_USERDATA = -21&
%EQUATE `GWL_ID = -12&
%EQUATE `GWLP_WNDPROC = -4&
%EQUATE `GWLP_HINSTANCE = -6&
%EQUATE `GWLP_hwndParent = -8&
%EQUATE `GWLP_USERDATA = -21&
%EQUATE `GWLP_ID = -12&
'/*
' * Class field offsets for GetClassLong()
' */
%EQUATE `GCL_MENUNAME = -8&
%EQUATE `GCL_HBRBACKGROUND = -10&
%EQUATE `GCL_HCURSOR = -12&
%EQUATE `GCL_HICON = -14&
%EQUATE `GCL_HMODULE = -16&
%EQUATE `GCL_CBWNDEXTRA = -18&
%EQUATE `GCL_CBCLSEXTRA = -20&
%EQUATE `GCL_WNDPROC = -24&
%EQUATE `GCL_STYLE = -26&
%EQUATE `GCW_ATOM = -32&
'#if(WINVER >= 0x0400)
%EQUATE `GCL_HICONSM = -34&
'#endif /* WINVER >= 0x0400 */
%EQUATE `GCLP_MENUNAME = -8&
%EQUATE `GCLP_HBRBACKGROUND = -10&
%EQUATE `GCLP_HCURSOR = -12&
%EQUATE `GCLP_HICON = -14&
%EQUATE `GCLP_HMODULE = -16&
%EQUATE `GCLP_WNDPROC = -24&
%EQUATE `GCLP_HICONSM = -34&
'#endif /* !NOWINOFFSETS */
'#ENDIF ' #IF NOT %DEF(%NOWINOFFSETS) '-----------------------------------------
'#IF NOT %DEF(%NOWINMESSAGES) '-------------------------------------------------
'#ifndef NOWINMESSAGES
'/*
' * Window Messages
' */
'%WM_NULL = &H0000
'%WM_CREATE = &H0001
'%WM_DESTROY = &H0002
'%WM_MOVE = &H0003
'%WM_SIZE = &H0005
'%WM_ACTIVATE = &H0006
'/*
' * WM_ACTIVATE state values
' */
%EQUATE `WA_INACTIVE = 0&
%EQUATE `WA_ACTIVE = 1&
%EQUATE `WA_CLICKACTIVE = 2&
'%WM_SETFOCUS = &H0007
'%WM_KILLFOCUS = &H0008
%EQUATE `WM_ENABLE = &H000A
%EQUATE `WM_SETREDRAW = &H000B
%EQUATE `WM_SETTEXT = &H000C
%EQUATE `WM_GETTEXT = &H000D
%EQUATE `WM_GETTEXTLENGTH = &H000E
'%WM_PAINT = &H000F
'%WM_CLOSE = &H0010
'#ifndef _WIN32_WCE
%EQUATE `WM_QUERYENDSESSION = &H0011
%EQUATE `WM_QUERYOPEN = &H0013
%EQUATE `WM_ENDSESSION = &H0016
'#endif
'%WM_QUIT = &H0012
%EQUATE `WM_ERASEBKGND = &H0014
%EQUATE `WM_SYSCOLORCHANGE = &H0015
%EQUATE `WM_SHOWWINDOW = &H0018
%EQUATE `WM_WININICHANGE = &H001A
%EQUATE `WM_SETTINGCHANGE = %WM_WININICHANGE
'#endif /* WINVER >= 0x0400 */
%EQUATE `WM_DEVMODECHANGE = &H001B
'%WM_ACTIVATEAPP = &H001C
%EQUATE `WM_FONTCHANGE = &H001D
%EQUATE `WM_TIMECHANGE = &H001E
'%WM_CANCELMODE = &H001F
%EQUATE `WM_SETCURSOR = &H0020
'%WM_MOUSEACTIVATE = &H0021
%EQUATE `WM_CHILDACTIVATE = &H0022
%EQUATE `WM_QUEUESYNC = &H0023
%EQUATE `WM_GETMINMAXINFO = &H0024
'/*
' * Struct pointed to by WM_GETMINMAXINFO lParam
' */
' // Size = 40 bytes
TYPE MINMAXINFO DWORD
 ptReserved AS POINT
 ptMaxSize AS POINT
 ptMaxPosition AS POINT
 ptMinTrackSize AS POINT
 ptMaxTrackSize AS POINT
END TYPE
%EQUATE `WM_PAINTICON = &H0026
%EQUATE `WM_ICONERASEBKGND = &H0027
%EQUATE `WM_NEXTDLGCTL = &H0028
%EQUATE `WM_SPOOLERSTATUS = &H002A
'%WM_DRAWITEM = &H002B
%EQUATE `WM_MEASUREITEM = &H002C
%EQUATE `WM_DELETEITEM = &H002D
%EQUATE `WM_VKEYTOITEM = &H002E
%EQUATE `WM_CHARTOITEM = &H002F
%EQUATE `WM_SETFONT = &H0030
%EQUATE `WM_GETFONT = &H0031
%EQUATE `WM_SETHOTKEY = &H0032
%EQUATE `WM_GETHOTKEY = &H0033
%EQUATE `WM_QUERYDRAGICON = &H0037
%EQUATE `WM_COMPAREITEM = &H0039
'#if(WINVER >= 0x0500)
'#ifndef _WIN32_WCE
%EQUATE `WM_GETOBJECT = &H003D
'#endif
'#endif /* WINVER >= 0x0500 */
%EQUATE `WM_COMPACTING = &H0041
%EQUATE `WM_OTHERWINDOWCREATED = &H0042 ' no longer suported
%EQUATE `WM_OTHERWINDOWDESTROYED = &H0043 ' no longer suported
%EQUATE `WM_COMMNOTIFY = &H0044 ' no longer suported
%EQUATE `WM_WINDOWPOSCHANGING = &H0046
%EQUATE `WM_WINDOWPOSCHANGED = &H0047
'#define WM_POWER 0x0048
%EQUATE `WM_POWER = &H0048
'/*
' * wParam for WM_POWER window message and DRV_POWER driver notification
' */
%EQUATE `PWR_OK = 1&
%EQUATE `PWR_FAIL = -1&
%EQUATE `PWR_SUSPENDREQUEST = 1&
%EQUATE `PWR_SUSPENDRESUME = 2&
%EQUATE `PWR_CRITICALRESUME = 3&
%EQUATE `WM_COPYDATA = &H004A
%EQUATE `WM_CANCELJOURNAL = &H004B
'/*
' * lParam of WM_COPYDATA message points to...
' */
' // Size = 12 bytes
TYPE COPYDATASTRUCT DWORD
 dwData AS DWORD ' ULONG_PTR
 cbData AS DWORD
 lpData AS DWORD
END TYPE
'#if(WINVER >= 0x0400)
' // Size = 12 bytes
TYPE MDINEXTMENU DWORD
 hmenuIn AS DWORD ' HMENU
 hmenuNext AS DWORD ' HMENU
 hwndNext AS DWORD
END TYPE
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0400)
'%WM_NOTIFY = &H004E
%EQUATE `WM_INPUTLANGUAGECHANGEREQUEST = &H0050
%EQUATE `WM_INPUTLANGCHANGEREQUEST = &H0050
%EQUATE `WM_INPUTLANGUAGECHANGE = &H0051
%EQUATE `WM_INPUTLANGCHANGE = &H0051
%EQUATE `WM_TCARD = &H0052
'%WM_HELP = &H0053
%EQUATE `WM_USERCHANGED = &H0054
%EQUATE `WM_NOTIFYFORMAT = &H0055
%EQUATE `NFR_ANSI = 1&
%EQUATE `NFR_UNICODE = 2&
%EQUATE `NF_QUERY = 3&
%EQUATE `NF_REQUERY = 4&
%EQUATE `WM_CONTEXTMENU = &H007B
%EQUATE `WM_STYLECHANGING = &H007C
%EQUATE `WM_STYLECHANGED = &H007D
%EQUATE `WM_DISPLAYCHANGE = &H007E
%EQUATE `WM_GETICON = &H007F
%EQUATE `WM_SETICON = &H0080
'%WM_NCCREATE = &H0081
'%WM_NCDESTROY = &H0082
'%WM_NCCALCSIZE = &H0083
'%WM_NCHITTEST = &H0084
'%WM_NCPAINT = &H0085
'%WM_NCACTIVATE = &H0086
%EQUATE `WM_GETDLGCODE = &H0087
'#ifndef _WIN32_WCE
%EQUATE `WM_SYNCPAINT = &H0088
'#endif
'%WM_NCMOUSEMOVE = &H00A0
'%WM_NCLBUTTONDOWN = &H00A1
'%WM_NCLBUTTONUP = &H00A2
'%WM_NCLBUTTONDBLCLK = &H00A3
'%WM_NCRBUTTONDOWN = &H00A4
'%WM_NCRBUTTONUP = &H00A5
'%WM_NCRBUTTONDBLCLK = &H00A6
'%WM_NCMBUTTONDOWN = &H00A7
'%WM_NCMBUTTONUP = &H00A8
'%WM_NCMBUTTONDBLCLK = &H00A9
'#if(_WIN32_WINNT >= 0x0500)
'%WM_NCXBUTTONDOWN = &H00AB
'%WM_NCXBUTTONUP = &H00AC
'%WM_NCXBUTTONDBLCLK = &H00AD
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `WM_INPUT_DEVICE_CHANGE = &H00FE
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `WM_INPUT = &H00FF
'#endif /* _WIN32_WINNT >= 0x0501 */
%EQUATE `WM_KEYFIRST = &H0100
'%WM_KEYDOWN = &H0100
'%WM_KEYUP = &H0101
'%WM_CHAR = &H0102
%EQUATE `WM_DEADCHAR = &H0103
'%WM_SYSKEYDOWN = &H0104
'%WM_SYSKEYUP = &H0105
%EQUATE `WM_SYSCHAR = &H0106
%EQUATE `WM_SYSDEADCHAR = &H0107
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `WM_UNICHAR = &H0109
%EQUATE `WM_KEYLAST = &H0109
%EQUATE `UNICODE_NOCHAR = &HFFFF
'#else
'#define WM_KEYLAST 0x0108
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(WINVER >= 0x0400)
%EQUATE `WM_IME_STARTCOMPOSITION = &H010D
%EQUATE `WM_IME_ENDCOMPOSITION = &H010E
%EQUATE `WM_IME_COMPOSITION = &H010F
%EQUATE `WM_IME_KEYLAST = &H010F
'#endif /* WINVER >= 0x0400 */
'%WM_INITDIALOG = &H0110
'%WM_COMMAND = &H0111
%EQUATE `WM_SYSCOMMAND = &H0112
'%WM_TIMER = &H0113
'%WM_HSCROLL = &H0114
'%WM_VSCROLL = &H0115
%EQUATE `WM_INITMENU = &H0116
%EQUATE `WM_INITMENUPOPUP = &H0117
'#if(WINVER >= 0x0601)
%EQUATE `WM_GESTURE = &H0119
%EQUATE `WM_GESTURENOTIFY = &H011A
'#endif /* WINVER >= 0x0601 */
%EQUATE `WM_MENUSELECT = &H011F
%EQUATE `WM_MENUCHAR = &H0120
%EQUATE `WM_ENTERIDLE = &H0121
'#if(WINVER >= 0x0500)
'#ifndef _WIN32_WCE
%EQUATE `WM_MENURBUTTONUP = &H0122
%EQUATE `WM_MENUDRAG = &H0123
%EQUATE `WM_MENUGETOBJECT = &H0124
%EQUATE `WM_UNINITMENUPOPUP = &H0125
%EQUATE `WM_MENUCOMMAND = &H0126
'#ifndef _WIN32_WCE
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `WM_CHANGEUISTATE = &H0127
%EQUATE `WM_UPDATEUISTATE = &H0128
%EQUATE `WM_QUERYUISTATE = &H0129
'/*
' * LOWORD(wParam) values in WM_*UISTATE*
' */
%EQUATE `UIS_SET = 1&
%EQUATE `UIS_CLEAR = 2&
%EQUATE `UIS_INITIALIZE = 3&
'/*
' * HIWORD(wParam) values in WM_*UISTATE*
' */
%EQUATE `UISF_HIDEFOCUS = &H1&
%EQUATE `UISF_HIDEACCEL = &H2&
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `UISF_ACTIVE = &H4&
'#endif /* _WIN32_WINNT >= 0x0501 */
'#endif /* _WIN32_WINNT >= 0x0500 */
'#endif
'#endif
'#endif /* WINVER >= 0x0500 */
%EQUATE `WM_CTLCOLORMSGBOX = &H0132
%EQUATE `WM_CTLCOLOREDIT = &H0133
%EQUATE `WM_CTLCOLORLISTBOX = &H0134
%EQUATE `WM_CTLCOLORBTN = &H0135
%EQUATE `WM_CTLCOLORDLG = &H0136
%EQUATE `WM_CTLCOLORSCROLLBAR = &H0137
%EQUATE `WM_CTLCOLORSTATIC = &H0138
%EQUATE `MN_GETHMENU = &H01E1
'%WM_MOUSEFIRST = &H0200
'%WM_MOUSEMOVE = &H0200
'%WM_LBUTTONDOWN = &H0201
'%WM_LBUTTONUP = &H0202
'%WM_LBUTTONDBLCLK = &H0203
'%WM_RBUTTONDOWN = &H0204
'%WM_RBUTTONUP = &H0205
'%WM_RBUTTONDBLCLK = &H0206
'%WM_MBUTTONDOWN = &H0207
'%WM_MBUTTONUP = &H0208
'%WM_MBUTTONDBLCLK = &H0209
'#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
'%WM_MOUSEWHEEL = &H020A
'#endif
'#if (_WIN32_WINNT >= 0x0500)
%EQUATE `WM_XBUTTONDOWN = &H020B
%EQUATE `WM_XBUTTONUP = &H020C
%EQUATE `WM_XBUTTONDBLCLK = &H020D
'#endif
'#if (_WIN32_WINNT >= 0x0600)
'#define WM_MOUSEHWHEEL 0x020E
%EQUATE `WM_MOUSEHWHEEL = &H020E ' Windows Vista
'#endif
'#if (_WIN32_WINNT >= 0x0600)
'#IF %WINVER >= &H0600
'%WM_MOUSELAST = &H020E ' // Predefined as &H020D in PBWin 10
%EQUATE `WM_MOUSELAST_VISTA = &H020E ' to avoid namimg conlfict
'#elif (_WIN32_WINNT >= 0x0500)
'#ELSEIF %WINVER >= &H0500
'%WM_MOUSELAST = &H020D
'#elif (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
'#ELSEIF %WINVER >= &H0400 OR %WINVER > &H0400
'%WM_MOUSELAST = &H020A
'#ELSE
'%WM_MOUSELAST = &H0209
'#ENDIF ' /* (_WIN32_WINNT >= 0x0600) */
'#if(_WIN32_WINNT >= 0x0400)
'/* Value for rolling one detent */
%EQUATE `WHEEL_DELTA = 120%
'#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
MACRO GET_WHEEL_DELTA_WPARAM(wParam) = BITS%(HI(WORD, wParam))
'/* Setting to scroll one page for SPI_GET/SETWHEELSCROLLLINES */
'#define WHEEL_PAGESCROLL (UINT_MAX)
%EQUATE `WHEEL_PAGESCROLL = &HFFFFFFFF ' %UINT_MAX
'#endif /* _WIN32_WINNT >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0500)
'#define GET_KEYSTATE_WPARAM(wParam) (LOWORD(wParam))
'#define GET_NCHITTEST_WPARAM(wParam) ((short)LOWORD(wParam))
'#define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
MACRO GET_KEYSTATE_WPARAM(wParam) = LO(WORD, wParam)
MACRO GET_NCHITTEST_WPARAM(wParam) = BITS%(LO(WORD, wParam))
MACRO GET_XBUTTON_WPARAM(wParam) = HI(WORD, wParam)
'/* XButton values are WORD flags */
%EQUATE `XBUTTON1 = &H0001
%EQUATE `XBUTTON2 = &H0002
'/* Were there to be an XBUTTON3, its value would be 0x0004 */
'#endif /* _WIN32_WINNT >= 0x0500 */
%EQUATE `WM_PARENTNOTIFY = &H0210
%EQUATE `WM_ENTERMENULOOP = &H0211
%EQUATE `WM_EXITMENULOOP = &H0212
'#if(WINVER >= 0x0400)
%EQUATE `WM_NEXTMENU = &H0213
%EQUATE `WM_SIZING = &H0214
'%WM_CAPTURECHANGED = &H0215
%EQUATE `WM_MOVING = &H0216
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0400)
%EQUATE `WM_POWERBROADCAST = &H0218
'#ifndef _WIN32_WCE
%EQUATE `PBT_APMQUERYSUSPEND = &H0000
%EQUATE `PBT_APMQUERYSTANDBY = &H0001
%EQUATE `PBT_APMQUERYSUSPENDFAILED = &H0002
%EQUATE `PBT_APMQUERYSTANDBYFAILED = &H0003
%EQUATE `PBT_APMSUSPEND = &H0004
%EQUATE `PBT_APMSTANDBY = &H0005
%EQUATE `PBT_APMRESUMECRITICAL = &H0006
%EQUATE `PBT_APMRESUMESUSPEND = &H0007
%EQUATE `PBT_APMRESUMESTANDBY = &H0008
%EQUATE `PBTF_APMRESUMEFROMFAILURE = &H00000001
%EQUATE `PBT_APMBATTERYLOW = &H0009
%EQUATE `PBT_APMPOWERSTATUSCHANGE = &H000A
%EQUATE `PBT_APMOEMEVENT = &H000B
%EQUATE `PBT_APMRESUMEAUTOMATIC = &H0012
'#if (_WIN32_WINNT >= 0x0502)
#IF NOT %DEF(%PBT_POWERSETTINGCHANGE)
%EQUATE `PBT_POWERSETTINGCHANGE = &H8013
' // Size = 24 bytes
TYPE POWERBROADCAST_SETTING DWORD
 PowerSetting AS GUID ' GUID
 DataLength AS DWORD
 Data(0) AS BYTE ' UCHAR
END TYPE
#ENDIF ' // PBT_POWERSETTINGCHANGE
'#endif // (_WIN32_WINNT >= 0x0502)
'#endif
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0400)
%EQUATE `WM_DEVICECHANGE = &H0219
'#endif /* WINVER >= 0x0400 */
%EQUATE `WM_MDICREATE = &H0220
%EQUATE `WM_MDIDESTROY = &H0221
%EQUATE `WM_MDIACTIVATE = &H0222
%EQUATE `WM_MDIRESTORE = &H0223
%EQUATE `WM_MDINEXT = &H0224
%EQUATE `WM_MDIMAXIMIZE = &H0225
%EQUATE `WM_MDITILE = &H0226
%EQUATE `WM_MDICASCADE = &H0227
%EQUATE `WM_MDIICONARRANGE = &H0228
%EQUATE `WM_MDIGETACTIVE = &H0229
%EQUATE `WM_MDISETMENU = &H0230
%EQUATE `WM_ENTERSIZEMOVE = &H0231
%EQUATE `WM_EXITSIZEMOVE = &H0232
%EQUATE `WM_DROPFILES = &H0233
%EQUATE `WM_MDIREFRESHMENU = &H0234
'#if(WINVER >= 0x0601)
%EQUATE `WM_TOUCH = &H0240
'#endif /* WINVER >= 0x0601 */
'#if(WINVER >= 0x0400)
%EQUATE `WM_IME_SETCONTEXT = &H0281
%EQUATE `WM_IME_NOTIFY = &H0282
%EQUATE `WM_IME_CONTROL = &H0283
%EQUATE `WM_IME_COMPOSITIONFULL = &H0284
%EQUATE `WM_IME_SELECT = &H0285
%EQUATE `WM_IME_CHAR = &H0286
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
%EQUATE `WM_IME_REQUEST = &H0288
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0400)
%EQUATE `WM_IME_KEYDOWN = &H0290
%EQUATE `WM_IME_KEYUP = &H0291
'#endif /* WINVER >= 0x0400 */
'#if((_WIN32_WINNT >= 0x0400) || (WINVER >= 0x0500))
'%WM_MOUSEHOVER = &H02A1
'%WM_MOUSELEAVE = &H02A3
'#endif
'#if(WINVER >= 0x0500)
%EQUATE `WM_NCMOUSEHOVER = &H02A0
%EQUATE `WM_NCMOUSELEAVE = &H02A2
'#endif /* WINVER >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `WM_WTSSESSION_CHANGE = &H02B1
%EQUATE `WM_TABLET_FIRST = &H02c0
%EQUATE `WM_TABLET_LAST = &H02df
'#endif /* _WIN32_WINNT >= 0x0501 */
%EQUATE `WM_CUT = &H0300
%EQUATE `WM_COPY = &H0301
%EQUATE `WM_PASTE = &H0302
%EQUATE `WM_CLEAR = &H0303
%EQUATE `WM_UNDO = &H0304
%EQUATE `WM_RENDERFORMAT = &H0305
%EQUATE `WM_RENDERALLFORMATS = &H0306
%EQUATE `WM_DESTROYCLIPBOARD = &H0307
%EQUATE `WM_DRAWCLIPBOARD = &H0308
%EQUATE `WM_PAINTCLIPBOARD = &H0309
%EQUATE `WM_VSCROLLCLIPBOARD = &H030A
%EQUATE `WM_SIZECLIPBOARD = &H030B
%EQUATE `WM_ASKCBFORMATNAME = &H030C
%EQUATE `WM_CHANGECBCHAIN = &H030D
%EQUATE `WM_HSCROLLCLIPBOARD = &H030E
%EQUATE `WM_QUERYNEWPALETTE = &H030F
%EQUATE `WM_PALETTEISCHANGING = &H0310
%EQUATE `WM_PALETTECHANGED = &H0311
%EQUATE `WM_HOTKEY = &H0312
'#if(WINVER >= 0x0400)
%EQUATE `WM_PRINT = &H0317
%EQUATE `WM_PRINTCLIENT = &H0318
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `WM_APPCOMMAND = &H0319
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `WM_THEMECHANGED = &H031A
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `WM_CLIPBOARDUPDATE = &H031D
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `WM_DWMCOMPOSITIONCHANGED = &H031E
%EQUATE `WM_DWMNCRENDERINGCHANGED = &H031F
%EQUATE `WM_DWMCOLORIZATIONCOLORCHANGED = &H0320
%EQUATE `WM_DWMWINDOWMAXIMIZEDCHANGE = &H0321
'#endif /* _WIN32_WINNT >= 0x0600 */
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `WM_DWMSENDICONICTHUMBNAIL = &H0323
%EQUATE `WM_DWMSENDICONICLIVEPREVIEWBITMAP = &H0326
'#endif /* _WIN32_WINNT >= 0x0601 */
'#if(WINVER >= 0x0600)
%EQUATE `WM_GETTITLEBARINFOEX = &H033F
'#endif /* WINVER >= 0x0600 */
'#if(WINVER >= 0x0400)
%EQUATE `WM_HANDHELDFIRST = &H0358
%EQUATE `WM_HANDHELDLAST = &H035F
%EQUATE `WM_AFXFIRST = &H0360
%EQUATE `WM_AFXLAST = &H037F
'#endif /* WINVER >= 0x0400 */
%EQUATE `WM_PENWINFIRST = &H0380
%EQUATE `WM_PENWINLAST = &H038F
'#if(WINVER >= 0x0400)
%EQUATE `WM_APP = &H8000
'#endif /* WINVER >= 0x0400 */
'/*
' * NOTE: All Message Numbers below 0x0400 are RESERVED.
' *
' * Private Window Messages Start Here:
' */
'%WM_USER = &H0400
'#if(WINVER >= 0x0400)
'/* wParam for WM_SIZING message */
%EQUATE `WMSZ_LEFT = 1&
%EQUATE `WMSZ_RIGHT = 2&
%EQUATE `WMSZ_TOP = 3&
%EQUATE `WMSZ_TOPLEFT = 4&
%EQUATE `WMSZ_TOPRIGHT = 5&
%EQUATE `WMSZ_BOTTOM = 6&
%EQUATE `WMSZ_BOTTOMLEFT = 7&
%EQUATE `WMSZ_BOTTOMRIGHT = 8&
'#IF NOT %DEF(%NONCMESSAGES) ' -------------------------------------------------
'#ifndef NONCMESSAGES
'/*
' * WM_NCHITTEST and MOUSEHOOKSTRUCT Mouse Position Codes
' */
%EQUATE `HTERROR = -2&
%EQUATE `HTTRANSPARENT = -1&
%EQUATE `HTNOWHERE = 0&
%EQUATE `HTCLIENT = 1&
%EQUATE `HTCAPTION = 2&
%EQUATE `HTSYSMENU = 3&
%EQUATE `HTGROWBOX = 4&
%EQUATE `HTSIZE = %HTGROWBOX
%EQUATE `HTMENU = 5&
%EQUATE `HTHSCROLL = 6&
%EQUATE `HTVSCROLL = 7&
%EQUATE `HTMINBUTTON = 8&
%EQUATE `HTMAXBUTTON = 9&
%EQUATE `HTLEFT = 10&
%EQUATE `HTRIGHT = 11&
%EQUATE `HTTOP = 12&
%EQUATE `HTTOPLEFT = 13&
%EQUATE `HTTOPRIGHT = 14&
%EQUATE `HTBOTTOM = 15&
%EQUATE `HTBOTTOMLEFT = 16&
%EQUATE `HTBOTTOMRIGHT = 17&
%EQUATE `HTBORDER = 18&
%EQUATE `HTREDUCE = %HTMINBUTTON
%EQUATE `HTZOOM = %HTMAXBUTTON
%EQUATE `HTSIZEFIRST = %HTLEFT
%EQUATE `HTSIZELAST = %HTBOTTOMRIGHT
'#if(WINVER >= 0x0400)
%EQUATE `HTOBJECT = 19&
%EQUATE `HTCLOSE = 20&
%EQUATE `HTHELP = 21&
'#endif /* WINVER >= 0x0400 */
'/*
' * SendMessageTimeout values
' */
%EQUATE `SMTO_NORMAL = &H0000
%EQUATE `SMTO_BLOCK = &H0001
%EQUATE `SMTO_ABORTIFHUNG = &H0002
'#if(WINVER >= 0x0500)
%EQUATE `SMTO_NOTIMEOUTIFNOTHUNG = &H0008
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0600)
%EQUATE `SMTO_ERRORONEXIT = &H0020
'#endif /* WINVER >= 0x0600 */
'#endif /* !NONCMESSAGES */
'#ENDIF ' #IF NOT %DEF(%NONCMESSAGES) ' --------------------------------------
'/*
' * WM_MOUSEACTIVATE Return Codes
' */
%EQUATE `MA_ACTIVATE = 1&
%EQUATE `MA_ACTIVATEANDEAT = 2&
%EQUATE `MA_NOACTIVATE = 3&
%EQUATE `MA_NOACTIVATEANDEAT = 4&
'/*
' * WM_SETICON / WM_GETICON Type Codes
' */
%EQUATE `ICON_SMALL = 0&
%EQUATE `ICON_BIG = 1&
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `ICON_SMALL2 = 2&
'#endif /* _WIN32_WINNT >= 0x0501 */
DECLARE FUNCTION RegisterWindowMessageA LIB "user32.dll" ALIAS "RegisterWindowMessageA" ( BYREF lpString AS ASCIIZ ) AS QUAD ' UINT
DECLARE FUNCTION RegisterWindowMessageW LIB "user32.dll" ALIAS "RegisterWindowMessageW" ( BYREF lpString AS WSTRINGZ ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO RegisterWindowMessage = RegisterWindowMessageW
#ELSE
 MACRO RegisterWindowMessage = RegisterWindowMessageA
#ENDIF
'/*
' * WM_SIZE message wParam values
' */
%EQUATE `SIZE_RESTORED = 0&
%EQUATE `SIZE_MINIMIZED = 1&
%EQUATE `SIZE_MAXIMIZED = 2&
%EQUATE `SIZE_MAXSHOW = 3&
%EQUATE `SIZE_MAXHIDE = 4&
'/*
' * Obsolete constant names
' */
%EQUATE `SIZENORMAL = %SIZE_RESTORED
%EQUATE `SIZEICONIC = %SIZE_MINIMIZED
%EQUATE `SIZEFULLSCREEN = %SIZE_MAXIMIZED
%EQUATE `SIZEZOOMSHOW = %SIZE_MAXSHOW
%EQUATE `SIZEZOOMHIDE = %SIZE_MAXHIDE
'/*
' * WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam
' */
' // Size = 28 bytes
TYPE WINDOWPOS DWORD
 hWnd AS DWORD
 hWndInsertAfter AS DWORD
 x AS LONG ' int
 y AS LONG ' int
 cx AS LONG ' int
 cy AS LONG ' int
 flags AS DWORD ' UINT
END TYPE
'/*
' * WM_NCCALCSIZE parameter structure
' */
' // Size = 52 bytes
TYPE NCCALCSIZE_PARAMS DWORD
 rgrc(2) AS RECT ' RECT rgrc[3]
 lppos AS WINDOWPOS PTR
END TYPE
'/*
' * WM_NCCALCSIZE "window valid rect" return values
' */
%EQUATE `WVR_ALIGNTOP = &H0010&
%EQUATE `WVR_ALIGNLEFT = &H0020&
%EQUATE `WVR_ALIGNBOTTOM = &H0040&
%EQUATE `WVR_ALIGNRIGHT = &H0080&
%EQUATE `WVR_HREDRAW = &H0100&
%EQUATE `WVR_VREDRAW = &H0200&
%EQUATE `WVR_REDRAW = %WVR_HREDRAW OR %WVR_VREDRAW
%EQUATE `WVR_VALIDRECTS = &H0400&
'#IF NOT %DEF(%NOKEYSTATES) ' --------------------------------------------------
'#ifndef NOKEYSTATES
'/*
' * Key State Masks for Mouse Messages
' */
%EQUATE `MK_LBUTTON = &H0001
%EQUATE `MK_RBUTTON = &H0002
%EQUATE `MK_SHIFT = &H0004
%EQUATE `MK_CONTROL = &H0008
%EQUATE `MK_MBUTTON = &H0010
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `MK_XBUTTON1 = &H0020
%EQUATE `MK_XBUTTON2 = &H0040
'#endif /* _WIN32_WINNT >= 0x0500 */
'#endif /* !NOKEYSTATES */
'#ENDIF ' #IF NOT %DEF(%NOKEYSTATES) ' ---------------------------------------
'#if(_WIN32_WINNT >= 0x0400)
'#IF NOT %DEF(%NOTRACKMOUSEEVENT) ' --------------------------------------------
'#ifndef NOTRACKMOUSEEVENT
%EQUATE `TME_HOVER = &H00000001
%EQUATE `TME_LEAVE = &H00000002
'#if(WINVER >= 0x0500)
%EQUATE `TME_NONCLIENT = &H00000010
'#endif /* WINVER >= 0x0500 */
%EQUATE `TME_QUERY = &H40000000
%EQUATE `TME_CANCEL = &H80000000
%EQUATE `HOVER_DEFAULT = &HFFFFFFFF
'#endif /* _WIN32_WINNT >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0400)
#IF NOT %DEF(%TRACKMOUSEEVENT_DEFINED)
%EQUATE `TRACKMOUSEEVENT_DEFINED = 1
' // Size = 16 bytes
TYPE tagTRACKMOUSEEVENT DWORD
 cbSize AS DWORD
 dwFlags AS DWORD
 hwndTrack AS DWORD
 dwHoverTime AS DWORD
END TYPE
' The TRACKMOUSEEVENTAPI name is used in the old PB's win32api.inc instead of tagTRACKMOUSEVENT
MACRO TRACKMOUSEEVENTAPI = tagTRACKMOUSEEVENT
' // For compatibility with the PB includes
MACRO TRACKMOUSEEVENT_type = tagTRACKMOUSEEVENT
' The EVENTTRACK name is used in the old PB's commctrl.inc instead of tagTRACKMOUSEVENT
MACRO EVENTTRACK = tagTRACKMOUSEEVENT
#ENDIF
DECLARE FUNCTION TrackMouseEvent LIB "user32.dll" ALIAS "TrackMouseEvent" ( BYREF lpEventTrack AS tagTRACKMOUSEEVENT ) AS LONG ' LPTRACKMOUSEEVENT lpEventTrack
'#endif /* _WIN32_WINNT >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0400)
'#endif /* !NOTRACKMOUSEEVENT */
'#ENDIF ' #IF NOT %DEF(%NOTRACKMOUSEEVENT) ' ---------------------------------
'#endif /* _WIN32_WINNT >= 0x0400 */
'#endif /* !NOWINMESSAGES */
'#ENDIF ' #IF NOT %DEF(%NOWINMESSAGES) '----------------------------------------
'#IF NOT %DEF(%NOWINSTYLES) ' --------------------------------------------------
'#ifndef NOWINSTYLES
' // Note: The remed WS_XXX styles are predefined in the compiler.
'/*
' * Window Styles
' */
'%WS_OVERLAPPED = &H00000000&
'%WS_POPUP = &H80000000&
'%WS_CHILD = &H40000000&
'%WS_MINIMIZE = &H20000000&
'%WS_VISIBLE = &H10000000&
'%WS_DISABLED = &H08000000&
'%WS_CLIPSIBLINGS = &H04000000&
'%WS_CLIPCHILDREN = &H02000000&
'%WS_MAXIMIZE = &H01000000&
'%WS_CAPTION = &H00C00000& ' WS_BORDER OR WS_DLGFRAME
'%WS_BORDER = &H00800000&
'%WS_DLGFRAME = &H00400000&
'%WS_VSCROLL = &H00200000&
'%WS_HSCROLL = &H00100000&
'%WS_SYSMENU = &H00080000&
'%WS_THICKFRAME = &H00040000&
'%WS_GROUP = &H00020000&
'%WS_TABSTOP = &H00010000&
'%WS_MINIMIZEBOX = &H00020000&
'%WS_MAXIMIZEBOX = &H00010000&
'%WS_TILED = %WS_OVERLAPPED
'%WS_ICONIC = %WS_MINIMIZE
'%WS_SIZEBOX = %WS_THICKFRAME
'/*
' * Common Window Styles
' */
'%WS_OVERLAPPEDWINDOW = %WS_OVERLAPPED OR %WS_CAPTION OR %WS_SYSMENU OR %WS_THICKFRAME OR %WS_MINIMIZEBOX OR %WS_MAXIMIZEBOX
'%WS_TILEDWINDOW = %WS_OVERLAPPEDWINDOW
'%WS_POPUPWINDOW = %WS_POPUP OR %WS_BORDER OR %WS_SYSMENU
'%WS_CHILDWINDOW = %WS_CHILD
'/*
' * Extended Window Styles
' */
'%WS_EX_DLGMODALFRAME = &H00000001&
'%WS_EX_NOPARENTNOTIFY = &H00000004&
'%WS_EX_TOPMOST = &H00000008&
'%WS_EX_ACCEPTFILES = &H00000010&
'%WS_EX_TRANSPARENT = &H00000020&
'#if(WINVER >= 0x0400)
'%WS_EX_MDICHILD = &H00000040&
'%WS_EX_TOOLWINDOW = &H00000080&
'%WS_EX_SMCAPTION = &H00000080&
'%WS_EX_WINDOWEDGE = &H00000100&
'%WS_EX_CLIENTEDGE = &H00000200&
'%WS_EX_CONTEXTHELP = &H00000400&
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0400)
'%WS_EX_RIGHT = &H00001000&
'%WS_EX_LEFT = &H00000000&
'%WS_EX_RTLREADING = &H00002000&
'%WS_EX_LTRREADING = &H00000000&
'%WS_EX_LEFTSCROLLBAR = &H00004000&
'%WS_EX_RIGHTSCROLLBAR = &H00000000&
'%WS_EX_CONTROLPARENT = &H00010000&
'%WS_EX_STATICEDGE = &H00020000&
'%WS_EX_APPWINDOW = &H00040000&
'%WS_EX_OVERLAPPEDWINDOW = %WS_EX_WINDOWEDGE OR %WS_EX_CLIENTEDGE
'%WS_EX_PALETTEWINDOW = %WS_EX_WINDOWEDGE OR %WS_EX_TOOLWINDOW OR %WS_EX_TOPMOST
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0500)
'%WS_EX_LAYERED = &H00080000&
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(WINVER >= 0x0500)
'%WS_EX_NOINHERITLAYOUT = &H00100000&
'%WS_EX_LAYOUTRTL = &H00400000&
'#endif /* WINVER >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
'%WS_EX_COMPOSITED = &H02000000&
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0500)
'%WS_EX_NOACTIVATE = &H08000000&
'#endif /* _WIN32_WINNT >= 0x0500 */
' // Note: The remed CS_XXX styles are predefined in the compiler.
'/*
' * Class styles
' */
'%CS_VREDRAW = &H0001
'%CS_HREDRAW = &H0002
'%CS_KEYCVTWINDOW = &H0004
'%CS_DBLCLKS = &H0008
'%CS_OWNDC = &H0020
'%CS_CLASSDC = &H0040
'%CS_PARENTDC = &H0080
'%CS_NOKEYCVT = &H0100
'%CS_NOCLOSE = &H0200
'%CS_SAVEBITS = &H0800
'%CS_BYTEALIGNCLIENT = &H1000
'%CS_BYTEALIGNWINDOW = &H2000
%EQUATE `CS_PUBLICCLASS = &H4000
%EQUATE `CS_GLOBALCLASS = %CS_PUBLICCLASS
'%CS_IME = &H00010000
'#if(_WIN32_WINNT >= 0x0501)
'%CS_DROPSHADOW = &H00020000
'#endif /* _WIN32_WINNT >= 0x0501 */
'#endif /* !NOWINSTYLES */
'#ENDIF ' #IF NOT %DEF(%NOWINSTYLES) '------------------------------------------
'#if(WINVER >= 0x0400)
'/* WM_PRINT flags */
%EQUATE `PRF_CHECKVISIBLE = &H00000001
%EQUATE `PRF_NONCLIENT = &H00000002
%EQUATE `PRF_CLIENT = &H00000004
%EQUATE `PRF_ERASEBKGND = &H00000008
%EQUATE `PRF_CHILDREN = &H00000010
%EQUATE `PRF_OWNED = &H00000020
'/* 3D border styles */
%EQUATE `BDR_RAISEDOUTER = &H0001
%EQUATE `BDR_SUNKENOUTER = &H0002
%EQUATE `BDR_RAISEDINNER = &H0004
%EQUATE `BDR_SUNKENINNER = &H0008
%EQUATE `BDR_OUTER = %BDR_RAISEDOUTER OR %BDR_SUNKENOUTER
%EQUATE `BDR_INNER = %BDR_RAISEDINNER OR %BDR_SUNKENINNER
%EQUATE `BDR_RAISED = %BDR_RAISEDOUTER OR %BDR_RAISEDINNER
%EQUATE `BDR_SUNKEN = %BDR_SUNKENOUTER OR %BDR_SUNKENINNER
%EQUATE `EDGE_RAISED = %BDR_RAISEDOUTER OR %BDR_RAISEDINNER
%EQUATE `EDGE_SUNKEN = %BDR_SUNKENOUTER OR %BDR_SUNKENINNER
%EQUATE `EDGE_ETCHED = %BDR_SUNKENOUTER OR %BDR_RAISEDINNER
%EQUATE `EDGE_BUMP = %BDR_RAISEDOUTER OR %BDR_SUNKENINNER
'/* Border flags */
%EQUATE `BF_LEFT = &H0001
%EQUATE `BF_TOP = &H0002
%EQUATE `BF_RIGHT = &H0004
%EQUATE `BF_BOTTOM = &H0008
%EQUATE `BF_TOPLEFT = %BF_TOP OR %BF_LEFT
%EQUATE `BF_TOPRIGHT = %BF_TOP OR %BF_RIGHT
%EQUATE `BF_BOTTOMLEFT = %BF_BOTTOM OR %BF_LEFT
%EQUATE `BF_BOTTOMRIGHT = %BF_BOTTOM OR %BF_RIGHT
%EQUATE `BF_RECT = %BF_LEFT OR %BF_TOP OR %BF_RIGHT OR %BF_BOTTOM
%EQUATE `BF_DIAGONAL = &H0010
'// For diagonal lines, the BF_RECT flags specify the end point of the
'// vector bounded by the rectangle parameter.
%EQUATE `BF_DIAGONAL_ENDTOPRIGHT = %BF_DIAGONAL OR %BF_TOP OR %BF_RIGHT
%EQUATE `BF_DIAGONAL_ENDTOPLEFT = %BF_DIAGONAL OR %BF_TOP OR %BF_LEFT
%EQUATE `BF_DIAGONAL_ENDBOTTOMLEFT = %BF_DIAGONAL OR %BF_BOTTOM OR %BF_LEFT
%EQUATE `BF_DIAGONAL_ENDBOTTOMRIGHT = %BF_DIAGONAL OR %BF_BOTTOM OR %BF_RIGHT
%EQUATE `BF_MIDDLE = &H0800 '* Fill in the middle
%EQUATE `BF_SOFT = &H1000 '* For softer buttons
%EQUATE `BF_ADJUST = &H2000 '* Calculate the space left over
%EQUATE `BF_FLAT = &H4000 '* For flat rather than 3D borders
%EQUATE `BF_MONO = &H8000 '* For monochrome borders
DECLARE FUNCTION DrawEdge LIB "user32.dll" ALIAS "DrawEdge" ( BYVAL hdc AS QUAD , BYREF qrc AS RECT , BYVAL edge AS QUAD , BYVAL grfFlags AS QUAD ) AS LONG
'/* flags for DrawFrameControl */
%EQUATE `DFC_CAPTION = 1&
%EQUATE `DFC_MENU = 2&
%EQUATE `DFC_SCROLL = 3&
%EQUATE `DFC_BUTTON = 4&
'#if(WINVER >= 0x0500)
%EQUATE `DFC_POPUPMENU = 5&
'#endif /* WINVER >= 0x0500 */
%EQUATE `DFCS_CAPTIONCLOSE = &H0000
%EQUATE `DFCS_CAPTIONMIN = &H0001
%EQUATE `DFCS_CAPTIONMAX = &H0002
%EQUATE `DFCS_CAPTIONRESTORE = &H0003
%EQUATE `DFCS_CAPTIONHELP = &H0004
%EQUATE `DFCS_MENUARROW = &H0000
%EQUATE `DFCS_MENUCHECK = &H0001
%EQUATE `DFCS_MENUBULLET = &H0002
%EQUATE `DFCS_MENUARROWRIGHT = &H0004
%EQUATE `DFCS_SCROLLUP = &H0000
%EQUATE `DFCS_SCROLLDOWN = &H0001
%EQUATE `DFCS_SCROLLLEFT = &H0002
%EQUATE `DFCS_SCROLLRIGHT = &H0003
%EQUATE `DFCS_SCROLLCOMBOBOX = &H0005
%EQUATE `DFCS_SCROLLSIZEGRIP = &H0008
%EQUATE `DFCS_SCROLLSIZEGRIPRIGHT = &H0010
%EQUATE `DFCS_BUTTONCHECK = &H0000
%EQUATE `DFCS_BUTTONRADIOIMAGE = &H0001
%EQUATE `DFCS_BUTTONRADIOMASK = &H0002
%EQUATE `DFCS_BUTTONRADIO = &H0004
%EQUATE `DFCS_BUTTON3STATE = &H0008
%EQUATE `DFCS_BUTTONPUSH = &H0010
%EQUATE `DFCS_INACTIVE = &H0100
%EQUATE `DFCS_PUSHED = &H0200
%EQUATE `DFCS_CHECKED = &H0400
'#if(WINVER >= 0x0500)
%EQUATE `DFCS_TRANSPARENT = &H0800
%EQUATE `DFCS_HOT = &H1000
'#endif /* WINVER >= 0x0500 */
%EQUATE `DFCS_ADJUSTRECT = &H2000
%EQUATE `DFCS_FLAT = &H4000
%EQUATE `DFCS_MONO = &H8000
DECLARE FUNCTION DrawFrameControl LIB "user32.dll" ALIAS "DrawFrameControl" ( BYVAL hdc AS QUAD , BYREF lprc AS RECT , BYVAL uType AS QUAD , BYVAL uState AS QUAD ) AS LONG
'/* flags for DrawCaption */
%EQUATE `DC_ACTIVE = &H0001
%EQUATE `DC_SMALLCAP = &H0002
%EQUATE `DC_ICON = &H0004
%EQUATE `DC_TEXT = &H0008
%EQUATE `DC_INBUTTON = &H0010
'#if(WINVER >= 0x0500)
%EQUATE `DC_GRADIENT = &H0020
'#endif /* WINVER >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `DC_BUTTONS = &H1000
'#endif /* _WIN32_WINNT >= 0x0501 */
DECLARE FUNCTION DrawCaption LIB "user32.dll" ALIAS "DrawCaption" ( BYVAL hwnd AS QUAD , BYVAL hdc AS QUAD , BYREF lprect AS RECT , BYVAL Flags AS QUAD ) AS LONG
'#define IDANI_OPEN 1
'#define IDANI_CAPTION 3
%EQUATE `IDANI_OPEN = 1&
%EQUATE `IDANI_CAPTION = 3&
DECLARE FUNCTION DrawAnimatedRects LIB "user32.dll" ALIAS "DrawAnimatedRects" ( BYVAL hwnd AS QUAD , BYVAL idAni AS LONG , BYREF lprcFrom AS RECT , BYREF lprcTo AS RECT ) AS LONG
'#endif /* WINVER >= 0x0400 */
'#IF NOT %DEF(%NOCLIPBOARD) ' --------------------------------------------------
'#ifndef NOCLIPBOARD
'/*
' * Predefined Clipboard Formats
' */
%EQUATE `CF_TEXT = 1
%EQUATE `CF_BITMAP = 2
%EQUATE `CF_METAFILEPICT = 3
%EQUATE `CF_SYLK = 4
%EQUATE `CF_DIF = 5
%EQUATE `CF_TIFF = 6
%EQUATE `CF_OEMTEXT = 7
%EQUATE `CF_DIB = 8
%EQUATE `CF_PALETTE = 9
%EQUATE `CF_PENDATA = 10
%EQUATE `CF_RIFF = 11
%EQUATE `CF_WAVE = 12
%EQUATE `CF_UNICODETEXT = 13
%EQUATE `CF_ENHMETAFILE = 14
'#if(WINVER >= 0x0400)
%EQUATE `CF_HDROP = 15
%EQUATE `CF_LOCALE = 16
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
%EQUATE `CF_DIBV5 = 17
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0500)
%EQUATE `CF_MAX = 18 ' varies by Windows version
'#elif(WINVER >= 0x0400)
'#define CF_MAX 17
'#else
'#define CF_MAX 15
'#endif
%EQUATE `CF_OWNERDISPLAY = &H0080
%EQUATE `CF_DSPTEXT = &H0081
%EQUATE `CF_DSPBITMAP = &H0082
%EQUATE `CF_DSPMETAFILEPICT = &H0083
%EQUATE `CF_DSPENHMETAFILE = &H008E
'/*
' * "Private" formats don't get GlobalFree()'d
' */
%EQUATE `CF_PRIVATEFIRST = &H0200
%EQUATE `CF_PRIVATELAST = &H02FF
'/*
' * "GDIOBJ" formats do get DeleteObject()'d
' */
%EQUATE `CF_GDIOBJFIRST = &H0300
%EQUATE `CF_GDIOBJLAST = &H03FF
'#endif /* !NOCLIPBOARD */
'#ENDIF ' #IF NOT %DEF(%NOCLIPBOARD) ' ---------------------------------------
'/*
' * Defines for the fVirt field of the Accelerator table structure.
' */
%EQUATE `FVIRTKEY = &H01 ' Assumed to be == TRUE
%EQUATE `FNOINVERT = &H02
%EQUATE `FSHIFT = &H04
%EQUATE `FCONTROL = &H08
%EQUATE `FALT = &H10
' // Size = 6 bytes
TYPE ACCELAPI WORD
 fVirt AS BYTE ' BYTE
 key AS WORD ' WORD
 cmd AS WORD ' WORD
END TYPE
MACRO tagACCEL = ACCELAPI
' // Size = 64 bytes
TYPE PAINTSTRUCT DWORD
 hDC AS DWORD ' HDC
 fErase AS LONG
 rcPaint AS RECT ' RECT
 fRestore AS LONG
 fIncUpdate AS LONG
 rgbReserved(31) AS BYTE ' BYTE rgbReserved[32]
END TYPE
' // Size = 48 bytes
TYPE CREATESTRUCTA DWORD
 lpCreateParams AS LONG
 hInstance AS DWORD ' HINSTANCE
 hMenu AS DWORD ' HMENU
 hwndParent AS DWORD
 cy AS LONG ' int
 cx AS LONG ' int
 y AS LONG ' int
 x AS LONG ' int
 style AS LONG
 lpszName AS ASCIIZ PTR
 lpszClass AS ASCIIZ PTR
 dwExStyle AS DWORD
END TYPE
' // Size = 48 bytes
TYPE CREATESTRUCTW DWORD
 lpCreateParams AS LONG
 hInstance AS DWORD ' HINSTANCE
 hMenu AS DWORD ' HMENU
 hwndParent AS DWORD
 cy AS LONG ' int
 cx AS LONG ' int
 y AS LONG ' int
 x AS LONG ' int
 style AS LONG
 lpszName AS WSTRINGZ PTR
 lpszClass AS WSTRINGZ PTR
 dwExStyle AS DWORD
END TYPE
#IF %DEF(%UNICODE)
MACRO CREATESTRUCT = CREATESTRUCTW
#ELSE
MACRO CREATESTRUCT = CREATESTRUCTA
#ENDIF ' UNICODE
'/*
' * HCBT_CREATEWND parameters pointed to by lParam
' */
' // Size = 8 bytes
TYPE CBT_CREATEWNDA DWORD
 lpcs AS CREATESTRUCTA PTR ' struct tagCREATESTRUCTA*
 hWndInsertAfter AS DWORD
END TYPE
' // Size = 8 bytes
TYPE CBT_CREATEWNDW DWORD
 lpcs AS CREATESTRUCTW PTR ' struct tagCREATESTRUCTW*
 hWndInsertAfter AS DWORD
END TYPE
#IF %DEF(%UNICODE)
MACRO CBT_CREATEWND = CBT_CREATEWNDW
#ELSE
MACRO CBT_CREATEWND = CBT_CREATEWNDA
#ENDIF ' UNICODE
' // Size = 8 bytes
TYPE WINDOWPLACEMENT DWORD
 length AS DWORD ' UINT
 flags AS DWORD ' UINT
 showCmd AS DWORD ' UINT
 ptMinPosition AS POINT
 ptMaxPosition AS POINT
 rcNormalPosition AS RECT ' RECT
END TYPE
%EQUATE `WPF_SETMINPOSITION = &H0001
%EQUATE `WPF_RESTORETOMAXIMIZED = &H0002
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `WPF_ASYNCWINDOWPLACEMENT = &H0004
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(WINVER >= 0x0400)
' // Size = 12 bytes
' // Note: NMHDR is built-in in PB
' // code should be DWORD, but it is defined as LONG in PBWin 9 built-in structure
TYPE NMHDR
 hwndFrom AS DWORD
 idfrom AS DWORD ' UINT_PTR
 code AS LONG ' UINT // NM_ code
END TYPE
' // Size = 8 bytes
TYPE STYLESTRUCT DWORD
 styleOld AS DWORD
 styleNew AS DWORD
END TYPE
'#endif /* WINVER >= 0x0400 */
'/*
' * Owner draw control types
' */
%EQUATE `ODT_MENU = 1&
%EQUATE `ODT_LISTBOX = 2&
%EQUATE `ODT_COMBOBOX = 3&
%EQUATE `ODT_BUTTON = 4&
'#endif /* WINVER >= 0x0400 */
%EQUATE `ODT_STATIC = 5&
'/*
' * Owner draw actions
' */
%EQUATE `ODA_DRAWENTIRE = &H0001
%EQUATE `ODA_SELECT = &H0002
%EQUATE `ODA_FOCUS = &H0004
'/*
' * Owner draw state
' */
%EQUATE `ODS_SELECTED = &H0001
%EQUATE `ODS_GRAYED = &H0002
%EQUATE `ODS_DISABLED = &H0004
%EQUATE `ODS_CHECKED = &H0008
%EQUATE `ODS_FOCUS = &H0010
'#if(WINVER >= = &H0400)
%EQUATE `ODS_DEFAULT = &H0020
%EQUATE `ODS_COMBOBOXEDIT = &H1000
'#endif /* WINVER >= = &H0400 */
'#if(WINVER >= = &H0500)
%EQUATE `ODS_HOTLIGHT = &H0040
%EQUATE `ODS_INACTIVE = &H0080
'#if(_WIN32_WINNT >= = &H0500)
%EQUATE `ODS_NOACCEL = &H0100
%EQUATE `ODS_NOFOCUSRECT = &H0200
'#endif /* _WIN32_WINNT >= 0x0500 */
'#endif /* WINVER >= 0x0500 */
'/*
' * MEASUREITEMSTRUCT for ownerdraw
' */
' // Size = 24 bytes
TYPE MEASUREITEMSTRUCT DWORD
 CtlType AS DWORD ' UINT
 CtlID AS DWORD ' UINT
 itemID AS DWORD ' UINT
 itemWidth AS DWORD ' UINT
 itemHeight AS DWORD ' UINT
 itemData AS DWORD ' ULONG_PTR
END TYPE
'/*
' * DRAWITEMSTRUCT for ownerdraw
' */
' // Size = 48 bytes
TYPE DRAWITEMSTRUCT DWORD
 CtlType AS DWORD ' UINT
 CtlID AS DWORD ' UINT
 itemID AS DWORD ' UINT
 itemAction AS DWORD ' UINT
 itemState AS DWORD ' UINT
 hwndItem AS DWORD
 hDC AS DWORD ' HDC
 rcItem AS RECT ' RECT
 itemData AS DWORD ' ULONG_PTR
END TYPE
'/*
' * DELETEITEMSTRUCT for ownerdraw
' */
' // Size = 20 bytes
TYPE DELETEITEMSTRUCT DWORD
 CtlType AS DWORD ' UINT
 CtlID AS DWORD ' UINT
 itemID AS DWORD ' UINT
 hwndItem AS LONG
 itemData AS DWORD ' ULONG_PTR
END TYPE
'/*
' * COMPAREITEMSTUCT for ownerdraw sorting
' */
' // Size = 32 bytes
TYPE COMPAREITEMSTRUCT DWORD
 CtlType AS DWORD ' UINT
 CtlID AS DWORD ' UINT
 hwndItem AS DWORD
 itemID1 AS DWORD ' UINT
 itemData1 AS DWORD ' ULONG_PTR
 itemID2 AS DWORD ' UINT
 itemData2 AS DWORD ' ULONG_PTR
 dwLocaleId AS DWORD
END TYPE
'#IF NOT %DEF(%NOMSG) '---------------------------------------------------------
'#ifndef NOMSG
'/*
' * Message Function Templates
' */
DECLARE FUNCTION GetMessageA LIB "user32.dll" ALIAS "GetMessageA" ( BYREF lpMsg AS tagMSG , BYVAL hWnd AS QUAD , BYVAL wMsgFilterMin AS QUAD , BYVAL wMsgFilterMax AS QUAD ) AS LONG
DECLARE FUNCTION GetMessageW LIB "user32.dll" ALIAS "GetMessageW" ( BYREF lpMsg AS tagMSG
 , BYVAL hWnd AS DWORD
 , BYVAL wMsgFilterMin AS DWORD
 , BYVAL wMsgFilterMax AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetMessage = GetMessageW
#ELSE
 MACRO GetMessage = GetMessageA
#ENDIF
DECLARE FUNCTION TranslateMessage LIB "user32.dll" ALIAS "TranslateMessage" ( BYREF lpMsg AS tagMSG ) AS LONG
DECLARE FUNCTION DispatchMessageA LIB "user32.dll" ALIAS "DispatchMessageA" ( BYREF lpMsg AS tagMSG
 ) AS LONG ' LRESULT
DECLARE FUNCTION DispatchMessageW LIB "user32.dll" ALIAS "DispatchMessageW" ( BYREF lpMsg AS tagMSG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO DispatchMessage = DispatchMessageW
#ELSE
 MACRO DispatchMessage = DispatchMessageA
#ENDIF
DECLARE FUNCTION SetMessageQueue LIB "user32.dll" ALIAS "SetMessageQueue" ( BYVAL cMessagesMax AS LONG ) AS LONG
DECLARE FUNCTION PeekMessageA LIB "user32.dll" ALIAS "PeekMessageA" ( BYREF lpMsg AS tagMSG
 , BYVAL hWnd AS DWORD
 , BYVAL wMsgFilterMin AS DWORD
 , BYVAL wMsgFilterMax AS DWORD
 , BYVAL wRemoveMsg AS DWORD
 ) AS LONG
DECLARE FUNCTION PeekMessageW LIB "user32.dll" ALIAS "PeekMessageW" ( BYREF lpMsg AS tagMSG
 , BYVAL hWnd AS DWORD
 , BYVAL wMsgFilterMin AS DWORD
 , BYVAL wMsgFilterMax AS DWORD
 , BYVAL wRemoveMsg AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO PeekMessage = PeekMessageW
#ELSE
 MACRO PeekMessage = PeekMessageA
#ENDIF
'/*
' * PeekMessage() Options
' */
%EQUATE `PM_NOREMOVE = &H0000
%EQUATE `PM_REMOVE = &H0001
%EQUATE `PM_NOYIELD = &H0002
'#if(WINVER >= 0x0500)
%EQUATE `PM_QS_INPUT = %QS_INPUT * 256
%EQUATE `PM_QS_POSTMESSAGE = (%QS_POSTMESSAGE OR %QS_HOTKEY OR %QS_TIMER) * 256
%EQUATE `PM_QS_PAINT = %QS_PAINT * 256
%EQUATE `PM_QS_SENDMESSAGE = %QS_SENDMESSAGE * 256
'#endif /* WINVER >= 0x0500 */
'#endif /* !NOMSG */
'#ENDIF ' #IF NOT %DEF(%NOMSG) '----------------------------------------------
DECLARE FUNCTION RegisterHotKey LIB "user32.dll" ALIAS "RegisterHotKey" ( BYVAL hWnd AS QUAD , BYVAL id AS LONG , BYVAL fsModifiers AS LONG , BYVAL vk AS LONG ) AS LONG
DECLARE FUNCTION UnregisterHotKey LIB "user32.dll" ALIAS "UnregisterHotKey" ( BYVAL hWnd AS QUAD
 , BYVAL id AS LONG
 ) AS LONG
%EQUATE `MOD_ALT = &H0001
%EQUATE `MOD_CONTROL = &H0002
%EQUATE `MOD_SHIFT = &H0004
%EQUATE `MOD_WIN = &H0008
'#if(WINVER >= 0x0601)
%EQUATE `MOD_NOREPEAT = &H4000
'#endif /* WINVER >= 0x0601 */
%EQUATE `IDHOT_SNAPWINDOW = -1& ' SHIFT-PRINTSCRN
%EQUATE `IDHOT_SNAPDESKTOP = -2&
'#ifdef WIN_INTERNAL
' #ifndef LSTRING
' #define NOLSTRING
' #endif /* LSTRING */
' #ifndef LFILEIO
' #define NOLFILEIO
' #endif /* LFILEIO */
'#endif /* WIN_INTERNAL */
'#if(WINVER >= 0x0400)
%EQUATE `ENDSESSION_LOGOFF = &H80000000
%EQUATE `ENDSESSION_CRITICAL = &H40000000
%EQUATE `ENDSESSION_CLOSEAPP = &H00000001
'#endif /* WINVER >= 0x0400 */
%EQUATE `EWX_LOGOFF = 0
%EQUATE `EWX_SHUTDOWN = &H00000001
%EQUATE `EWX_REBOOT = &H00000002
%EQUATE `EWX_FORCE = &H00000004
%EQUATE `EWX_POWEROFF = &H00000008
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `EWX_FORCEIFHUNG = &H00000010
'#endif /* _WIN32_WINNT >= 0x0500 */
%EQUATE `EWX_QUICKRESOLVE = &H00000020
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `EWX_RESTARTAPPS = &H00000040
'#endif /* _WIN32_WINNT >= 0x0600 */
DECLARE FUNCTION ExitWindowsEx LIB "user32.dll" ALIAS "ExitWindowsEx" ( BYVAL uFlags AS QUAD , BYVAL dwReason AS QUAD ) AS LONG
'#define ExitWindows(dwReserved, Code) ExitWindowsEx(EWX_LOGOFF, 0xFFFFFFFF)
FUNCTION ExitWindows (OPTIONAL BYVAL dwReserved AS DWORD, BYVAL uReserved AS DWORD) AS LONG
 FUNCTION = ExitWindowsEx(%EWX_LOGOFF, &HFFFFFFFF)
END FUNCTION
DECLARE FUNCTION SwapMouseButton LIB "user32.dll" ALIAS "SwapMouseButton" ( BYVAL fSwap AS LONG ) AS LONG
DECLARE FUNCTION GetMessagePos LIB "user32.dll" ALIAS "GetMessagePos" ( ) AS QUAD
DECLARE FUNCTION GetMessageTime LIB "user32.dll" ALIAS "GetMessageTime" ( ) AS LONG
DECLARE FUNCTION GetMessageExtraInfo LIB "user32.dll" ALIAS "GetMessageExtraInfo" ( ) AS LONG
'#if(_WIN32_WINNT >= 0x0501)
DECLARE FUNCTION IsWow64Message LIB "user32.dll" ALIAS "IsWow64Message" ( ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(WINVER >= 0x0400)
DECLARE FUNCTION SetMessageExtraInfo LIB "user32.dll" ALIAS "SetMessageExtraInfo" ( BYVAL lParam AS LONG ) AS LONG
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION SendMessageA LIB "user32.dll" ALIAS "SendMessageA" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
DECLARE FUNCTION SendMessageW LIB "user32.dll" ALIAS "SendMessageW" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO SendMessage = SendMessageW
#ELSE
 MACRO SendMessage = SendMessageA
#ENDIF
DECLARE FUNCTION SendMessageTimeoutA LIB "user32.dll" ALIAS "SendMessageTimeoutA" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG , BYVAL fuFlags AS QUAD , BYVAL uTimeout AS QUAD , OPTIONAL BYREF lpdwResult AS QUAD ) AS LONG ' LRESULT
DECLARE FUNCTION SendMessageTimeoutW LIB "user32.dll" ALIAS "SendMessageTimeoutW" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG , BYVAL fuFlags AS QUAD , BYVAL uTimeout AS QUAD , OPTIONAL BYREF lpdwResult AS QUAD ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO SendMessageTimeout = SendMessageTimeoutW
#ELSE
 MACRO SendMessageTimeout = SendMessageTimeoutA
#ENDIF
DECLARE FUNCTION SendNotifyMessageA LIB "user32.dll" ALIAS "SendNotifyMessageA" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG
DECLARE FUNCTION SendNotifyMessageW LIB "user32.dll" ALIAS "SendNotifyMessageW" ( BYVAL hWnd AS QUAD
 , BYVAL Msg AS DWORD
 , BYVAL wParam AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SendNotifyMessage = SendNotifyMessageW
#ELSE
 MACRO SendNotifyMessage = SendNotifyMessageA
#ENDIF
DECLARE FUNCTION SendMessageCallbackA LIB "user32.dll" ALIAS "SendMessageCallbackA" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG , BYVAL lpResultCallBack AS QUAD , BYVAL dwData AS QUAD ) AS LONG
DECLARE FUNCTION SendMessageCallbackW LIB "user32.dll" ALIAS "SendMessageCallbackW" ( BYVAL hWnd AS QUAD
 , BYVAL Msg AS DWORD
 , BYVAL wParam AS DWORD
 , BYVAL lParam AS LONG
 , BYVAL lpResultCallBack AS DWORD
 , BYVAL dwData AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SendMessageCallback = SendMessageCallbackW
#ELSE
 MACRO SendMessageCallback = SendMessageCallbackA
#ENDIF
'#if(_WIN32_WINNT >= 0x0501)
' // Size = 20 bytes
TYPE BSMINFO DWORD
 cbSize AS DWORD ' UINT
 hdesk AS DWORD ' HDESK
 hwnd AS DWORD
 luid AS QUAD ' LUID
END TYPE
DECLARE FUNCTION BroadcastSystemMessageExA LIB "user32.dll" ALIAS "BroadcastSystemMessageExA" ( BYVAL flags AS QUAD , BYREF lpInfo AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG , OPTIONAL BYREF pbsmInfo AS BSMINFO ) AS LONG ' long
DECLARE FUNCTION BroadcastSystemMessageExW LIB "user32.dll" ALIAS "BroadcastSystemMessageExW" ( BYVAL flags AS QUAD , BYREF lpInfo AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG , OPTIONAL BYREF pbsmInfo AS BSMINFO ) AS LONG ' long
#IF %DEF(%UNICODE)
 MACRO BroadcastSystemMessageEx = BroadcastSystemMessageExW
#ELSE
 MACRO BroadcastSystemMessageEx = BroadcastSystemMessageExA
#ENDIF
'#if(WINVER >= 0x0400)
'#if defined(_WIN32_WINNT)
DECLARE FUNCTION BroadcastSystemMessageA LIB "user32.dll" ALIAS "BroadcastSystemMessageA" ( BYVAL flags AS QUAD , BYREF lpInfo AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' long
DECLARE FUNCTION BroadcastSystemMessageW LIB "user32.dll" ALIAS "BroadcastSystemMessageW" ( BYVAL flags AS QUAD , BYREF lpInfo AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' long
#IF %DEF(%UNICODE)
 MACRO BroadcastSystemMessage = BroadcastSystemMessageW
#ELSE
 MACRO BroadcastSystemMessage = BroadcastSystemMessageA
#ENDIF
'// The Win95 version isn't A/W decorated
DECLARE FUNCTION BroadcastSystemMessage LIB "user32.dll" ALIAS "BroadcastSystemMessage" ( BYVAL flags AS QUAD , BYREF lpInfo AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' long
'#endif
'//Broadcast Special Message Recipient list
%EQUATE `BSM_ALLCOMPONENTS = &H00000000
%EQUATE `BSM_VXDS = &H00000001
%EQUATE `BSM_NETDRIVER = &H00000002
%EQUATE `BSM_INSTALLABLEDRIVERS = &H00000004
%EQUATE `BSM_APPLICATIONS = &H00000008
%EQUATE `BSM_ALLDESKTOPS = &H00000010
'//Broadcast Special Message Flags
%EQUATE `BSF_QUERY = &H00000001
%EQUATE `BSF_IGNORECURRENTTASK = &H00000002
%EQUATE `BSF_FLUSHDISK = &H00000004
%EQUATE `BSF_NOHANG = &H00000008
%EQUATE `BSF_POSTMESSAGE = &H00000010
%EQUATE `BSF_FORCEIFHUNG = &H00000020
%EQUATE `BSF_NOTIMEOUTIFNOTHUNG = &H00000040
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `BSF_ALLOWSFW = &H00000080
%EQUATE `BSF_SENDNOTIFYMESSAGE = &H00000100
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `BSF_RETURNHDESK = &H00000200
%EQUATE `BSF_LUID = &H00000400
'#endif /* _WIN32_WINNT >= 0x0501 */
'#define BROADCAST_QUERY_DENY 0x424D5144 // Return this value to deny a query.
%EQUATE `BROADCAST_QUERY_DENY = &H424D5144 ' Return this value to deny a query.
'#endif /* WINVER >= 0x0400 */
'// RegisterDeviceNotification
'#if(WINVER >= 0x0500)
'typedef PVOID HDEVNOTIFY;
'typedef HDEVNOTIFY *PHDEVNOTIFY;
%EQUATE `DEVICE_NOTIFY_WINDOW_HANDLE = &H00000000
%EQUATE `DEVICE_NOTIFY_SERVICE_HANDLE = &H00000001
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `DEVICE_NOTIFY_ALL_INTERFACE_CLASSES = &H00000004
'#endif /* _WIN32_WINNT >= 0x0501 */
DECLARE FUNCTION RegisterDeviceNotificationA LIB "user32.dll" ALIAS "RegisterDeviceNotificationA" ( BYVAL hRecipient AS QUAD , BYREF NotificationFilter AS ANY , BYVAL Flags AS QUAD ) AS QUAD ' HDEVNOTIFY
DECLARE FUNCTION RegisterDeviceNotificationW LIB "user32.dll" ALIAS "RegisterDeviceNotificationW" ( BYVAL hRecipient AS QUAD , BYREF NotificationFilter AS ANY , BYVAL Flags AS QUAD ) AS QUAD ' HDEVNOTIFY
#IF %DEF(%UNICODE)
 MACRO RegisterDeviceNotification = RegisterDeviceNotificationW
#ELSE
 MACRO RegisterDeviceNotification = RegisterDeviceNotificationA
#ENDIF
DECLARE FUNCTION UnregisterDeviceNotification LIB "user32.dll" ALIAS "UnregisterDeviceNotification" ( BYVAL Handle AS QUAD ) AS LONG
'#if (_WIN32_WINNT >= 0x0502)
'#if !defined(_HPOWERNOTIFY_DEF_)
'#define _HPOWERNOTIFY_DEF_
'typedef PVOID HPOWERNOTIFY;
'typedef HPOWERNOTIFY *PHPOWERNOTIFY;
'#endif
DECLARE FUNCTION RegisterPowerSettingNotification LIB "user32.dll" ALIAS "RegisterPowerSettingNotification" ( BYVAL hRecipient AS QUAD , BYREF PowerSettingGuid AS GUID , BYVAL Flags AS QUAD ) AS QUAD ' HPOWERNOTIFY
DECLARE FUNCTION UnregisterPowerSettingNotification LIB "user32.dll" ALIAS "UnregisterPowerSettingNotification" ( BYVAL Handle AS QUAD ) AS LONG
'#endif // (_WIN32_WINNT >= 0x0502)
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION PostMessageA LIB "user32.dll" ALIAS "PostMessageA" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG
DECLARE FUNCTION PostMessageW LIB "user32.dll" ALIAS "PostMessageW" ( BYVAL hWnd AS QUAD
 , BYVAL Msg AS DWORD
 , BYVAL wParam AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO PostMessage = PostMessageW
#ELSE
 MACRO PostMessage = PostMessageA
#ENDIF
DECLARE FUNCTION PostThreadMessageA LIB "user32.dll" ALIAS "PostThreadMessageA" ( BYVAL idThread AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG
DECLARE FUNCTION PostThreadMessageW LIB "user32.dll" ALIAS "PostThreadMessageW" ( BYVAL idThread AS QUAD
 , BYVAL Msg AS DWORD
 , BYVAL wParam AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO PostThreadMessage = PostThreadMessageW
#ELSE
 MACRO PostThreadMessage = PostThreadMessageA
#ENDIF
'#define PostAppMessageA(idThread, wMsg, wParam, lParam)\
' PostThreadMessageA((DWORD)idThread, wMsg, wParam, lParam)
'MACRO PostAppMessage(idThread, wMsg, wParam, lParam) = PostThreadMessage(idThread, wMsg, wParam, lParam)
'#define PostAppMessageW(idThread, wMsg, wParam, lParam)\
' PostThreadMessageW((DWORD)idThread, wMsg, wParam, lParam)
'MACRO PostAppMessageW(idThread, wMsg, wParam, lParam) = PostThreadMessageW(idThread, wMsg, wParam, lParam)
#IF %DEF(%UNICODE)
 MACRO PostAppMessage = PostThreadMessageW
#ELSE
 MACRO PostAppMessage = PostThreadMessageA
#ENDIF
'/*
' * Special HWND value for use with PostMessage() and SendMessage()
' */
'#define HWND_BROADCAST ((HWND)0xffff)
%EQUATE `HWND_BROADCAST = &HFFFFFFFF
'#if(WINVER >= 0x0500)
'#define HWND_MESSAGE ((HWND)-3)
%EQUATE `HWND_MESSAGE = &HFFFFFFFD
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION AttachThreadInput LIB "user32.dll" ALIAS "AttachThreadInput" ( BYVAL idAttach AS QUAD , BYVAL idAttachTo AS QUAD , BYVAL fAttach AS LONG ) AS LONG
DECLARE FUNCTION ReplyMessage LIB "user32.dll" ALIAS "ReplyMessage" ( BYVAL lResult AS LONG
 ) AS LONG
DECLARE FUNCTION WaitMessage LIB "user32.dll" ALIAS "WaitMessage" ( ) AS LONG
DECLARE FUNCTION WaitForInputIdle LIB "user32.dll" ALIAS "WaitForInputIdle" ( BYVAL hProcess AS DWORD
 , BYVAL dwMilliseconds AS DWORD
 ) AS DWORD
DECLARE FUNCTION DefWindowProcA LIB "user32.dll" ALIAS "DefWindowProcA" ( BYVAL hWnd AS DWORD
 , BYVAL Msg AS DWORD
 , BYVAL wParam AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG ' LRESULT
DECLARE FUNCTION DefWindowProcW LIB "user32.dll" ALIAS "DefWindowProcW" ( BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO DefWindowProc = DefWindowProcW
#ELSE
 MACRO DefWindowProc = DefWindowProcA
#ENDIF
DECLARE SUB PostQuitMessage LIB "user32.dll" ALIAS "PostQuitMessage" ( BYVAL nExitCode AS LONG )
DECLARE FUNCTION CallWindowProcA LIB "user32.dll" ALIAS "CallWindowProcA" ( BYVAL lpPrevWndFunc AS QUAD , BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
DECLARE FUNCTION CallWindowProcW LIB "user32.dll" ALIAS "CallWindowProcW" ( BYVAL lpPrevWndFunc AS QUAD , BYVAL hWnd AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO CallWindowProc = CallWindowProcW
#ELSE
 MACRO CallWindowProc = CallWindowProcA
#ENDIF
DECLARE FUNCTION InSendMessage LIB "user32.dll" ALIAS "InSendMessage" ( ) AS LONG
'#if(WINVER >= 0x0500)
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION InSendMessageEx LIB "User32.dll" ALIAS "InSendMessageEx" (lpReserved AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION InSendMessageEx LIB "user32.dll" ALIAS "InSendMessageEx" ( BYVAL lpReserved AS QUAD ) AS QUAD
#ENDIF
'/*
' * InSendMessageEx return value
' */
%EQUATE `ISMEX_NOSEND = &H00000000
%EQUATE `ISMEX_SEND = &H00000001
%EQUATE `ISMEX_NOTIFY = &H00000002
%EQUATE `ISMEX_CALLBACK = &H00000004
%EQUATE `ISMEX_REPLIED = &H00000008
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION GetDoubleClickTime LIB "user32.dll" ALIAS "GetDoubleClickTime" ( ) AS QUAD ' UINT
DECLARE FUNCTION SetDoubleClickTime LIB "user32.dll" ALIAS "SetDoubleClickTime" ( BYVAL uInterval AS QUAD ) AS LONG
DECLARE FUNCTION RegisterClassA LIB "user32.dll" ALIAS "RegisterClassA" ( BYREF lpWndClass AS WNDCLASSA
 ) AS WORD ' ATOM
DECLARE FUNCTION RegisterClassW LIB "user32.dll" ALIAS "RegisterClassW" ( BYREF lpWndClass AS WNDCLASSW ) AS WORD ' ATOM
#IF %DEF(%UNICODE)
 MACRO RegisterClass = RegisterClassW
#ELSE
 MACRO RegisterClass = RegisterClassA
#ENDIF
DECLARE FUNCTION UnregisterClassA LIB "user32.dll" ALIAS "UnregisterClassA" ( BYREF lpClassName AS ASCIIZ , OPTIONAL BYVAL hInstance AS QUAD ) AS LONG
DECLARE FUNCTION UnregisterClassW LIB "user32.dll" ALIAS "UnregisterClassW" ( BYREF lpClassName AS WSTRINGZ
 , OPTIONAL BYVAL hInstance AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO UnregisterClass = UnregisterClassW
#ELSE
 MACRO UnregisterClass = UnregisterClassA
#ENDIF
DECLARE FUNCTION GetClassInfoA LIB "user32.dll" ALIAS "GetClassInfoA" ( BYVAL hInstance AS QUAD , BYREF lpClassName AS ASCIIZ , BYREF lpWndClass AS WNDCLASSA ) AS LONG
DECLARE FUNCTION GetClassInfoW LIB "user32.dll" ALIAS "GetClassInfoW" ( BYVAL hInstance AS QUAD
 , BYREF lpClassName AS WSTRINGZ
 , BYREF lpWndClass AS WNDCLASSW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetClassInfo = GetClassInfoW
#ELSE
 MACRO GetClassInfo = GetClassInfoA
#ENDIF
'#if(WINVER >= 0x0400)
DECLARE FUNCTION RegisterClassExA LIB "user32.dll" ALIAS "RegisterClassExA" ( BYREF lpwcx AS WNDCLASSEXA ) AS WORD ' ATOM
DECLARE FUNCTION RegisterClassExW LIB "user32.dll" ALIAS "RegisterClassExW" ( BYREF lpwcx AS WNDCLASSEXW ) AS WORD ' ATOM
#IF %DEF(%UNICODE)
 MACRO RegisterClassEx = RegisterClassExW
#ELSE
 MACRO RegisterClassEx = RegisterClassExA
#ENDIF
DECLARE FUNCTION GetClassInfoExA LIB "user32.dll" ALIAS "GetClassInfoExA" ( BYVAL hInstance AS QUAD , BYREF lpszClass AS ASCIIZ , BYREF lpwcx AS WNDCLASSEXA ) AS LONG
DECLARE FUNCTION GetClassInfoExW LIB "user32.dll" ALIAS "GetClassInfoExW" ( BYVAL hInstance AS QUAD
 , BYREF lpszClass AS WSTRINGZ
 , BYREF lpwcx AS WNDCLASSEXW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetClassInfoEx = GetClassInfoExW
#ELSE
 MACRO GetClassInfoEx = GetClassInfoExA
#ENDIF
'#endif /* WINVER >= 0x0400 */
'#define CW_USEDEFAULT ((int)0x80000000)
%EQUATE `CW_USEDEFAULT = &H80000000&
'/*
' * Special value for CreateWindow, et al.
' */
'#define HWND_DESKTOP ((HWND)0)
'%HWND_DESKTOP = 0
'#if(_WIN32_WINNT >= 0x0501)
'typedef BOOLEAN (WINAPI * PREGISTERCLASSNAMEW)(LPCWSTR);
'#endif /* _WIN32_WINNT >= 0x0501 */
' ========================================================================================
' Creates an overlapped, pop-up, or child window with an extended window style; otherwise,
' this function is identical to the CreateWindow function. For more information about
' creating a window and for full descriptions of the other parameters of CreateWindowEx,
' see CreateWindow.
' ========================================================================================
DECLARE FUNCTION CreateWindowExA LIB "user32.dll" ALIAS "CreateWindowExA" ( BYVAL dwExStyle AS QUAD , BYREF lpClassName AS ASCIIZ , BYREF lpWindowName AS ASCIIZ , BYVAL dwStyle AS QUAD , BYVAL X AS LONG , BYVAL Y AS LONG , BYVAL nWidth AS LONG , BYVAL nHeight AS LONG , OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL hMenu AS QUAD , OPTIONAL BYVAL hInstance AS QUAD , OPTIONAL BYREF lpParam AS ANY ) AS QUAD
DECLARE FUNCTION CreateWindowExW LIB "user32.dll" ALIAS "CreateWindowExW" ( BYVAL dwExStyle AS QUAD
 , BYREF lpClassName AS WSTRINGZ
 , BYREF lpWindowName AS WSTRINGZ
 , BYVAL dwStyle AS DWORD
 , BYVAL X AS LONG
 , BYVAL Y AS LONG
 , BYVAL nWidth AS LONG
 , BYVAL nHeight AS LONG
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL hMenu AS DWORD
 , OPTIONAL BYVAL hInstance AS DWORD
 , OPTIONAL BYREF lpParam AS ANY
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CreateWindowEx = CreateWindowExW
#ELSE
 MACRO CreateWindowEx = CreateWindowExA
#ENDIF
' ========================================================================================
'#define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y,\
'nWidth, nHeight, hwndParent, hMenu, hInstance, lpParam)\
'CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,\
'nWidth, nHeight, hwndParent, hMenu, hInstance, lpParam)
'#define CreateWindowW(lpClassName, lpWindowName, dwStyle, x, y,\
'nWidth, nHeight, hwndParent, hMenu, hInstance, lpParam)\
'CreateWindowExW(0L, lpClassName, lpWindowName, dwStyle, x, y,\
'nWidth, nHeight, hwndParent, hMenu, hInstance, lpParam)
' ========================================================================================
' Creates an overlapped, pop-up, or child window. It specifies the window class, window
' title, window style, and (optionally) the initial position and size of the window. The
' function also specifies the window's parent or owner, if any, and the window's menu.
' To use extended window styles in addition to the styles supported by CreateWindow, use
' the CreateWindowEx function.
' ========================================================================================
' // Note: Implemented as functions instead of macros because, otherwise, conflict with
' // the CreateWindow method of the CWindow class.
FUNCTION CreateWindowA (BYREF lpClassName AS ASCIIZ, BYREF lpWindowName AS ASCIIZ, BYVAL dwStyle AS DWORD, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, BYVAL hwndParent AS DWORD, BYVAL hMenu AS DWORD, BYVAL hInstance AS DWORD, BYVAL lpParam AS DWORD) AS LONG
 FUNCTION = CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, BYVAL lpParam)
END FUNCTION
FUNCTION CreateWindowW (BYREF lpClassName AS WSTRINGZ, BYREF lpWindowName AS WSTRINGZ, BYVAL dwStyle AS DWORD, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, BYVAL hwndParent AS DWORD, BYVAL hMenu AS DWORD, BYVAL hInstance AS DWORD, BYVAL lpParam AS DWORD) AS LONG
 FUNCTION = CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, BYVAL lpParam)
END FUNCTION
#IF %DEF(%UNICODE)
 MACRO CreateWindow = CreateWindowW
#ELSE
 MACRO CreateWindow = CreateWindowA
#ENDIF
' ========================================================================================
DECLARE FUNCTION IsWindow LIB "user32.dll" ALIAS "IsWindow" ( BYVAL hWnd AS QUAD ) AS LONG
DECLARE FUNCTION IsMenu LIB "user32.dll" ALIAS "IsMenu" ( BYVAL hMenu AS QUAD
 ) AS LONG
DECLARE FUNCTION IsChild LIB "user32.dll" ALIAS "IsChild" ( BYVAL hwndParent AS DWORD
 , BYVAL hWnd AS DWORD
 ) AS LONG
DECLARE FUNCTION DestroyWindow LIB "user32.dll" ALIAS "DestroyWindow" ( BYVAL hWnd AS DWORD
 ) AS LONG
DECLARE FUNCTION ShowWindow LIB "user32.dll" ALIAS "ShowWindow" ( BYVAL hWnd AS DWORD
 , BYVAL nCmdShow AS LONG
 ) AS LONG
'#if(WINVER >= 0x0500)
DECLARE FUNCTION AnimateWindow LIB "user32.dll" ALIAS "AnimateWindow" ( BYVAL hWnd AS QUAD , BYVAL dwTime AS QUAD , BYVAL dwFlags AS QUAD ) AS LONG
'#endif /* WINVER >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0500)
'#if defined(_WINGDI_) && !defined(NOGDI)
DECLARE FUNCTION UpdateLayeredWindow LIB "user32.dll" ALIAS "UpdateLayeredWindow" ( BYVAL hWnd AS QUAD , BYVAL hdcDst AS QUAD , BYREF pptDst AS POINT , BYREF psize AS SIZE , BYVAL hdcSrc AS QUAD , BYREF pptSrc AS POINT , BYVAL crKey AS QUAD , BYREF pblend AS BLENDFUNCTION , BYVAL dwFlags AS QUAD ) AS LONG
'/*
' * Layered Window Update information
' */
' // Size = 40 bytes
TYPE UPDATELAYEREDWINDOWINFO DWORD
 cbSize AS DWORD
 hdcDst AS DWORD ' HDC
 pptDst AS POINT PTR ' POINT CONST
 psize AS SIZE PTR ' SIZE CONST
 hdcSrc AS DWORD ' HDC
 pptSrc AS POINT PTR ' POINT CONST
 crKey AS DWORD ' COLORREF
 pblend AS BLENDFUNCTION PTR ' BLENDFUNCTION CONST *
 dwFlags AS DWORD
 prcDirty AS RECT PTR ' RECT CONST
END TYPE
DECLARE FUNCTION UpdateLayeredWindowIndirect LIB "user32,dll" ALIAS "UpdateLayeredWindowIndirect" ( BYVAL hWnd AS QUAD , BYREF pULWInfo AS UPDATELAYEREDWINDOWINFO ) AS LONG
'#endif
'#if(_WIN32_WINNT >= 0x0501)
DECLARE FUNCTION GetLayeredWindowAttributes LIB "user32.dll" ALIAS "GetLayeredWindowAttributes" ( BYVAL hwnd AS QUAD , OPTIONAL BYREF pcrKey AS QUAD , OPTIONAL BYREF pbAlpha AS BYTE , OPTIONAL BYREF pdwFlags AS QUAD ) AS LONG
%EQUATE `PW_CLIENTONLY = &H00000001
DECLARE FUNCTION PrintWindow LIB "user32.dll" ALIAS "PrintWindow" ( BYVAL hwnd AS QUAD , BYVAL hdcBlt AS QUAD , BYVAL nFlags AS QUAD ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0501 */
DECLARE FUNCTION SetLayeredWindowAttributes LIB "user32.dll" ALIAS "SetLayeredWindowAttributes" ( BYVAL hwnd AS QUAD , BYVAL crKey AS QUAD , BYVAL bAlpha AS BYTE , BYVAL dwFlags AS QUAD ) AS LONG
%EQUATE `LWA_COLORKEY = &H00000001
%EQUATE `LWA_ALPHA = &H00000002
%EQUATE `ULW_COLORKEY = &H00000001
%EQUATE `ULW_ALPHA = &H00000002
%EQUATE `ULW_OPAQUE = &H00000004
%EQUATE `ULW_EX_NORESIZE = &H00000008
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(WINVER >= 0x0400)
DECLARE FUNCTION ShowWindowAsync LIB "user32.dll" ALIAS "ShowWindowAsync" ( BYVAL hWnd AS QUAD , BYVAL nCmdShow AS LONG ) AS LONG
DECLARE FUNCTION FlashWindow LIB "user32.dll" ALIAS "FlashWindow" ( BYVAL hWnd AS QUAD
 , BYVAL bInvert AS LONG
 ) AS LONG
'#if(WINVER >= 0x0500)
' // Size = 20 bytes
TYPE FLASHWINFO DWORD
 cbSize AS DWORD ' UINT
 hwnd AS DWORD
 dwFlags AS DWORD
 uCount AS DWORD ' UINT
 dwTimeout AS DWORD
END TYPE
DECLARE FUNCTION FlashWindowEx LIB "user32.dll" ALIAS "FlashWindowEx" ( BYREF pfwi AS FLASHWINFO ) AS LONG
%EQUATE `FLASHW_STOP = 0
%EQUATE `FLASHW_CAPTION = &H00000001
%EQUATE `FLASHW_TRAY = &H00000002
%EQUATE `FLASHW_ALL = %FLASHW_CAPTION OR %FLASHW_TRAY
%EQUATE `FLASHW_TIMER = &H00000004
%EQUATE `FLASHW_TIMERNOFG = &H0000000C
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION ShowOwnedPopups LIB "user32.dll" ALIAS "ShowOwnedPopups" ( BYVAL hWnd AS QUAD , BYVAL fShow AS LONG ) AS LONG
DECLARE FUNCTION OpenIcon LIB "user32.dll" ALIAS "OpenIcon" ( BYVAL hWnd AS QUAD
 ) AS LONG
DECLARE FUNCTION CloseWindow LIB "user32.dll" ALIAS "CloseWindow" ( BYVAL hWnd AS DWORD
 ) AS LONG
DECLARE FUNCTION MoveWindow LIB "user32.dll" ALIAS "MoveWindow" ( BYVAL hWnd AS DWORD
 , BYVAL X AS LONG
 , BYVAL Y AS LONG
 , BYVAL nWidth AS LONG
 , BYVAL nHeight AS LONG
 , BYVAL bRepaint AS LONG
 ) AS LONG
DECLARE FUNCTION SetWindowPos LIB "user32.dll" ALIAS "SetWindowPos" ( BYVAL hWnd AS DWORD
 , BYVAL hWndInsertAfter AS DWORD
 , BYVAL X AS LONG
 , BYVAL Y AS LONG
 , BYVAL cx AS LONG
 , BYVAL cy AS LONG
 , BYVAL uFlags AS DWORD
 ) AS LONG
DECLARE FUNCTION GetWindowPlacement LIB "user32.dll" ALIAS "GetWindowPlacement" ( BYVAL hWnd AS DWORD
 , BYREF lpwndpl AS WINDOWPLACEMENT
 ) AS LONG
DECLARE FUNCTION SetWindowPlacement LIB "user32.dll" ALIAS "SetWindowPlacement" ( BYVAL hWnd AS DWORD
 , BYREF lpwndpl AS WINDOWPLACEMENT
 ) AS LONG
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `WDA_NONE = &H00000000
%EQUATE `WDA_MONITOR = &H00000001
DECLARE FUNCTION GetWindowDisplayAffinity LIB "user32.dll" ALIAS "GetWindowDisplayAffinity" ( BYVAL hWnd AS QUAD , BYREF pdwAffinity AS QUAD ) AS LONG
DECLARE FUNCTION SetWindowDisplayAffinity LIB "user32.dll" ALIAS "SetWindowDisplayAffinity" ( BYVAL hWnd AS QUAD
 , BYVAL dwAffinity AS DWORD
 ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0601 */
'#IF NOT %DEF(%NODEFERWINDOWPOS) ' ---------------------------------------------
'#ifndef NODEFERWINDOWPOS
DECLARE FUNCTION BeginDeferWindowPos LIB "user32.dll" ALIAS "BeginDeferWindowPos" ( BYVAL nNumWindows AS LONG ) AS QUAD ' HDWP
DECLARE FUNCTION DeferWindowPos LIB "user32.dll" ALIAS "DeferWindowPos" ( BYVAL hWinPosInfo AS QUAD , BYVAL hWnd AS QUAD , BYVAL hWndInsertAfter AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG , BYVAL cx AS LONG , BYVAL cy AS LONG , BYVAL uFlags AS QUAD ) AS QUAD ' HDWP
DECLARE FUNCTION EndDeferWindowPos LIB "user32.dll" ALIAS "EndDeferWindowPos" ( BYVAL hWinPosInfo AS QUAD ) AS LONG
'#endif /* !NODEFERWINDOWPOS */
'#ENDIF ' #IF NOT %DEF(%NODEFERWINDOWPOS) ' ----------------------------------
DECLARE FUNCTION IsWindowVisible LIB "user32.dll" ALIAS "IsWindowVisible" ( BYVAL hWnd AS QUAD ) AS LONG
DECLARE FUNCTION IsIconic LIB "user32.dll" ALIAS "IsIconic" ( BYVAL hWnd AS QUAD
 ) AS LONG
DECLARE FUNCTION AnyPopup LIB "user32.dll" ALIAS "AnyPopup" ( ) AS LONG
DECLARE FUNCTION BringWindowToTop LIB "user32.dll" ALIAS "BringWindowToTop" ( BYVAL hWnd AS DWORD
 ) AS LONG
DECLARE FUNCTION IsZoomed LIB "user32.dll" ALIAS "IsZoomed" ( BYVAL hWnd AS DWORD
 ) AS LONG
'/*
' * SetWindowPos Flags
' */
%EQUATE `SWP_NOSIZE = &H0001
%EQUATE `SWP_NOMOVE = &H0002
%EQUATE `SWP_NOZORDER = &H0004
%EQUATE `SWP_NOREDRAW = &H0008
%EQUATE `SWP_NOACTIVATE = &H0010
%EQUATE `SWP_FRAMECHANGED = &H0020 ' The frame changed: send WM_NCCALCSIZE
%EQUATE `SWP_SHOWWINDOW = &H0040
%EQUATE `SWP_HIDEWINDOW = &H0080
%EQUATE `SWP_NOCOPYBITS = &H0100
%EQUATE `SWP_NOOWNERZORDER = &H0200 ' Don't do owner Z ordering
%EQUATE `SWP_NOSENDCHANGING = &H0400 ' Don't send WM_WINDOWPOSCHANGING
%EQUATE `SWP_DRAWFRAME = %SWP_FRAMECHANGED
%EQUATE `SWP_NOREPOSITION = %SWP_NOOWNERZORDER
'#if(WINVER >= 0x0400)
%EQUATE `SWP_DEFERERASE = &H2000
%EQUATE `SWP_ASYNCWINDOWPOS = &H4000
'#endif /* WINVER >= 0x0400 */
%EQUATE `HWND_TOP = 0 ' ((HWND)0)
%EQUATE `HWND_BOTTOM = 1 ' ((HWND)1)
%EQUATE `HWND_TOPMOST = &HFFFFFFFF ' ((HWND)-1)
%EQUATE `HWND_NOTOPMOST = &HFFFFFFFE ' ((HWND)-2)
'#IF NOT %DEF(%NOCTLMGR) ' -----------------------------------------------------
'#ifndef NOCTLMGR
'/*
' * WARNING:
' * The following structures must NOT be DWORD padded because they are
' * followed by strings, etc. that do not have to be DWORD aligned.
' */
'#include <pshpack2.h>
'/*
' * original NT 32 bit dialog template:
' */
' // Size = 18 bytes
TYPE DLGTEMPLATEA BYTE
 style AS DWORD
 dwExtendedStyle AS DWORD
 cdit AS WORD
 x AS INTEGER
 y AS INTEGER
 cx AS INTEGER
 cy AS INTEGER
END TYPE
' // Size = 18 bytes
TYPE DLGTEMPLATEW BYTE
 style AS DWORD
 dwExtendedStyle AS DWORD
 cdit AS WORD
 x AS INTEGER
 y AS INTEGER
 cx AS INTEGER
 cy AS INTEGER
END TYPE
#IF %DEF(%UNICODE)
MACRO DLGTEMPLATE = DLGTEMPLATEW
#ELSE
MACRO DLGTEMPLATE = DLGTEMPLATEA
#ENDIF
'/*
' * 32 bit Dialog item template.
' */
' // Size = 18 bytes
TYPE DLGITEMTEMPLATEA BYTE
 style AS DWORD
 ExtendedStyle AS DWORD
 x AS INTEGER ' short
 y AS INTEGER ' short
 cx AS INTEGER ' short
 cy AS INTEGER ' short
 id AS WORD ' WORD
END TYPE
' // Size = 18 bytes
TYPE DLGITEMTEMPLATEW BYTE
 style AS DWORD
 ExtendedStyle AS DWORD
 x AS INTEGER ' short
 y AS INTEGER ' short
 cx AS INTEGER ' short
 cy AS INTEGER ' short
 id AS WORD ' WORD
END TYPE
#IF %DEF(%UNICODE)
MACRO DLGITEMTEMPLATE = DLGITEMTEMPLATEW
#ELSE
MACRO DLGITEMTEMPLATE = DLGITEMTEMPLATEA
#ENDIF
'#include <poppack.h> /* Resume normal packing */
DECLARE FUNCTION CreateDialogParamA LIB "user32.dll" ALIAS "CreateDialogParamA" ( BYVAL hInstance AS QUAD , BYREF lpTemplateName AS ASCIIZ , OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL lpDialogFunc AS QUAD , OPTIONAL BYVAL lInitParam AS LONG ) AS QUAD
DECLARE FUNCTION CreateDialogParamW LIB "user32.dll" ALIAS "CreateDialogParamW" ( BYVAL hInstance AS QUAD
 , BYREF lpTemplateName AS WSTRINGZ
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 , OPTIONAL BYVAL lInitParam AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CreateDialogParam = CreateDialogParamW
#ELSE
 MACRO CreateDialogParam = CreateDialogParamA
#ENDIF
DECLARE FUNCTION CreateDialogIndirectParamA LIB "user32.dll" ALIAS "CreateDialogIndirectParamA" ( BYVAL hInstance AS QUAD , BYREF lpTemplate AS DLGTEMPLATEA , OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL lpDialogFunc AS QUAD , OPTIONAL BYVAL lInitParam AS LONG ) AS QUAD
DECLARE FUNCTION CreateDialogIndirectParamW LIB "user32.dll" ALIAS "CreateDialogIndirectParamW" ( BYVAL hInstance AS QUAD
 , BYREF lpTemplate AS DLGTEMPLATEW
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 , OPTIONAL BYVAL lInitParam AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CreateDialogIndirectParam = CreateDialogIndirectParamW
#ELSE
 MACRO CreateDialogIndirectParam = CreateDialogIndirectParamA
#ENDIF
'#define CreateDialogIndirectA(hInstance, lpTemplate, hwndParent, lpDialogFunc) \
' CreateDialogIndirectParamA(hInstance, lpTemplate, hwndParent, lpDialogFunc, 0L)
'MACRO CreateDialogIndirectA(hInstance,lpTemplate,hwndParent,lpDialogFunc) = CreateDialogIndirectParamA(hInstance,lpTemplate,hwndParent,lpDialogFunc,0)
FUNCTION CreateDialogIndirectA ( BYVAL hInstance AS DWORD
 , BYREF lpTemplate AS DLGTEMPLATEA
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD
 FUNCTION = CreateDialogIndirectParamA(hInstance, lpTemplate, hwndParent, lpDialogFunc, 0)
END FUNCTION
'#define CreateDialogIndirectW(hInstance, lpTemplate, hwndParent, lpDialogFunc) \
' CreateDialogIndirectParamW(hInstance, lpTemplate, hwndParent, lpDialogFunc, 0L)
'MACRO CreateDialogIndirectW(hInstance,lpTemplate,hwndParent,lpDialogFunc) = CreateDialogIndirectParamW(hInstance,lpTemplate,hwndParent,lpDialogFunc,0)
FUNCTION CreateDialogIndirectW ( BYVAL hInstance AS DWORD
 , BYREF lpTemplate AS DLGTEMPLATEW
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD
 FUNCTION = CreateDialogIndirectParamW(hInstance, lpTemplate, hwndParent, lpDialogFunc, 0)
END FUNCTION
#IF %DEF(%UNICODE)
MACRO CreateDialogIndirect = CreateDialogIndirectW
#ELSE
MACRO CreateDialogIndirect = CreateDialogIndirectA
#ENDIF
'#define CreateDialogA(hInstance, lpName, hwndParent, lpDialogFunc) \
' CreateDialogParamA(hInstance, lpName, hwndParent, lpDialogFunc, 0L)
'MACRO CreateDialogA(hInstance,lpName,hwndParent,lpDialogFunc) = CreateDialogParamA(hInstance,lpName,hwndParent,lpDialogFunc,0)
FUNCTION CreateDialogA ( BYVAL hInstance AS DWORD
 , BYREF lpTemplateName AS ASCIIZ
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD
 FUNCTION = CreateDialogParamA(hInstance, lpTemplateName, hwndParent, lpDialogFunc, 0)
END FUNCTION
'#define CreateDialogW(hInstance, lpName, hwndParent, lpDialogFunc) \
' CreateDialogParamW(hInstance, lpName, hwndParent, lpDialogFunc, 0L)
'MACRO CreateDialogW(hInstance,lpName,hwndParent,lpDialogFunc) = CreateDialogParamW(hInstance,lpName,hwndParent,lpDialogFunc,0)
FUNCTION CreateDialogW ( BYVAL hInstance AS DWORD
 , BYREF lpTemplateName AS WSTRINGZ
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD
 FUNCTION = CreateDialogParamW(hInstance, lpTemplateName, hwndParent, lpDialogFunc, 0)
END FUNCTION
#IF %DEF(%UNICODE)
MACRO CreateDialog = CreateDialogW
#ELSE
MACRO CreateDialog = CreateDialogA
#ENDIF
DECLARE FUNCTION DialogBoxParamA LIB "user32.dll" ALIAS "DialogBoxParamA" ( BYVAL hInstance AS QUAD , BYREF lpTemplateName AS ASCIIZ , OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL lpDialogFunc AS QUAD , OPTIONAL BYVAL lInitParam AS LONG ) AS LONG ' INT_PTR
DECLARE FUNCTION DialogBoxParamW LIB "user32.dll" ALIAS "DialogBoxParamW" ( BYVAL hInstance AS QUAD , BYREF lpTemplateName AS WSTRINGZ , OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL lpDialogFunc AS QUAD , OPTIONAL BYVAL lInitParam AS LONG ) AS LONG ' INT_PTR
#IF %DEF(%UNICODE)
 MACRO DialogBoxParam = DialogBoxParamW
#ELSE
 MACRO DialogBoxParam = DialogBoxParamA
#ENDIF
DECLARE FUNCTION DialogBoxIndirectParamA LIB "user32.dll" ALIAS "DialogBoxIndirectParamA" ( BYVAL hInstance AS QUAD , BYREF hDialogTemplate AS DLGTEMPLATEA , OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL lpDialogFunc AS QUAD , OPTIONAL BYVAL lInitParam AS LONG ) AS QUAD ' INT_PTR
DECLARE FUNCTION DialogBoxIndirectParamW LIB "user32.dll" ALIAS "DialogBoxIndirectParamW" ( BYVAL hInstance AS QUAD , BYREF hDialogTemplate AS DLGTEMPLATEW , OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL lpDialogFunc AS QUAD , OPTIONAL BYVAL lInitParam AS LONG ) AS QUAD ' INT_PTR
#IF %DEF(%UNICODE)
 MACRO DialogBoxIndirectParam = DialogBoxIndirectParamW
#ELSE
 MACRO DialogBoxIndirectParam = DialogBoxIndirectParamA
#ENDIF
'#define DialogBoxA(hInstance, lpTemplate, hwndParent, lpDialogFunc) \
' DialogBoxParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
'MACRO DialogBoxA(hInstance,lpTemplate,hwndParent,lpDialogFunc) = DialogBoxParamA(hInstance,lpTemplate,hwndParent,lpDialogFunc,0)
FUNCTION DialogBoxA ( BYVAL hInstance AS DWORD
 , BYREF lpTemplateName AS ASCIIZ
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD ' INT_PTR
 FUNCTION = DialogBoxParamA(hInstance, lpTemplateName, hwndParent, lpDialogFunc, 0)
END FUNCTION
'#define DialogBoxW(hInstance, lpTemplate, hwndParent, lpDialogFunc) \
' DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
'MACRO DialogBoxW(hInstance,lpTemplate,hwndParent,lpDialogFunc) = DialogBoxParamW(hInstance,lpTemplate,hwndParent,lpDialogFunc,0)
FUNCTION DialogBoxW ( BYVAL hInstance AS DWORD
 , BYREF lpTemplateName AS WSTRINGZ
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD ' INT_PTR
 FUNCTION = DialogBoxParamW(hInstance, lpTemplateName, hwndParent, lpDialogFunc, 0)
END FUNCTION
#IF %DEF(%UNICODE)
MACRO DialogBox = DialogBoxW
#ELSE
MACRO DialogBox = DialogBoxA
#ENDIF
'#define DialogBoxIndirectA(hInstance, lpTemplate, hwndParent, lpDialogFunc) \
' DialogBoxIndirectParamA(hInstance, lpTemplate, hwndParent, lpDialogFunc, 0L)
'MACRO DialogBoxIndirectA(hInstance,lpTemplate,hwndParent,lpDialogFunc) =
' DialogBoxIndirectParamA(hInstance,lpTemplate,hwndParent,lpDialogFunc,0)
FUNCTION DialogBoxIndirectA ( BYVAL hInstance AS DWORD
 , BYREF hDialogTemplate AS DLGTEMPLATEA
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD ' INT_PTR
 FUNCTION = DialogBoxIndirectParamA(hInstance, hDialogTemplate, hwndParent, lpDialogFunc, 0)
END FUNCTION
'#define DialogBoxIndirectW(hInstance, lpTemplate, hwndParent, lpDialogFunc) \
' DialogBoxIndirectParamW(hInstance, lpTemplate, hwndParent, lpDialogFunc, 0L)
'MACRO DialogBoxIndirectW(hInstance,lpTemplate,hwndParent,lpDialogFunc) = DialogBoxIndirectParamW(hInstance,lpTemplate,hwndParent,lpDialogFunc,0)
FUNCTION DialogBoxIndirectW ( BYVAL hInstance AS DWORD
 , BYREF hDialogTemplate AS DLGTEMPLATEW
 , OPTIONAL BYVAL hwndParent AS DWORD
 , OPTIONAL BYVAL lpDialogFunc AS DWORD
 ) AS DWORD ' INT_PTR
 FUNCTION = DialogBoxIndirectParamW(hInstance, hDialogTemplate, hwndParent, lpDialogFunc, 0)
END FUNCTION
#IF %DEF(%UNICODE)
MACRO DialogBoxIndirect = DialogBoxIndirectW
#ELSE
MACRO DialogBoxIndirect = DialogBoxIndirectA
#ENDIF
DECLARE FUNCTION EndDialog LIB "user32.dll" ALIAS "EndDialog" ( BYVAL hDlg AS QUAD , BYVAL nResult AS QUAD ) AS LONG
DECLARE FUNCTION GetDlgItem LIB "user32.dll" ALIAS "GetDlgItem" ( BYVAL hDlg AS QUAD
 , BYVAL nIDDlgItem AS LONG
 ) AS DWORD
DECLARE FUNCTION SetDlgItemInt LIB "user32.dll" ALIAS "SetDlgItemInt" ( BYVAL hDlg AS DWORD
 , BYVAL nIDDlgItem AS LONG
 , BYVAL uValue AS DWORD
 , BYVAL bSigned AS LONG
 ) AS LONG
DECLARE FUNCTION GetDlgItemInt LIB "user32.dll" ALIAS "GetDlgItemInt" ( BYVAL hDlg AS DWORD
 , BYVAL nIDDlgItem AS LONG
 , BYREF lpTranslated AS LONG
 , BYVAL bSigned AS LONG
 ) AS DWORD ' UINT
DECLARE FUNCTION SetDlgItemTextA LIB "user32.dll" ALIAS "SetDlgItemTextA" ( BYVAL hDlg AS QUAD , BYVAL nIDDlgItem AS LONG , BYREF lpString AS ASCIIZ ) AS LONG
DECLARE FUNCTION SetDlgItemTextW LIB "user32.dll" ALIAS "SetDlgItemTextW" ( BYVAL hDlg AS QUAD
 , BYVAL nIDDlgItem AS LONG
 , BYREF lpString AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SetDlgItemText = SetDlgItemTextW
#ELSE
 MACRO SetDlgItemText = SetDlgItemTextA
#ENDIF
DECLARE FUNCTION GetDlgItemTextA LIB "user32.dll" ALIAS "GetDlgItemTextA" ( BYVAL hDlg AS QUAD , BYVAL nIDDlgItem AS LONG , BYREF lpString AS ASCIIZ , BYVAL cchMax AS LONG ) AS QUAD ' UINT
DECLARE FUNCTION GetDlgItemTextW LIB "user32.dll" ALIAS "GetDlgItemTextW" ( BYVAL hDlg AS QUAD , BYVAL nIDDlgItem AS LONG , BYREF lpString AS WSTRINGZ , BYVAL cchMax AS LONG ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO GetDlgItemText = GetDlgItemTextW
#ELSE
 MACRO GetDlgItemText = GetDlgItemTextA
#ENDIF
DECLARE FUNCTION CheckDlgButton LIB "user32.dll" ALIAS "CheckDlgButton" ( BYVAL hDlg AS QUAD , BYVAL nIDButton AS LONG , BYVAL uCheck AS QUAD ) AS LONG
DECLARE FUNCTION CheckRadioButton LIB "user32.dll" ALIAS "CheckRadioButton" ( BYVAL hDlg AS QUAD
 , BYVAL nIDFirstButton AS LONG
 , BYVAL nIDLastButton AS LONG
 , BYVAL nIDCheckButton AS LONG
 ) AS LONG
DECLARE FUNCTION IsDlgButtonChecked LIB "user32.dll" ALIAS "IsDlgButtonChecked" ( BYVAL hDlg AS DWORD
 , BYVAL nIDButton AS LONG
 ) AS DWORD ' UINT
DECLARE FUNCTION SendDlgItemMessageA LIB "user32.dll" ALIAS "SendDlgItemMessageA" ( BYVAL hDlg AS QUAD , BYVAL nIDDlgItem AS LONG , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
DECLARE FUNCTION SendDlgItemMessageW LIB "user32.dll" ALIAS "SendDlgItemMessageW" ( BYVAL hDlg AS QUAD , BYVAL nIDDlgItem AS LONG , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO SendDlgItemMessage = SendDlgItemMessageW
#ELSE
 MACRO SendDlgItemMessage = SendDlgItemMessageA
#ENDIF
DECLARE FUNCTION GetNextDlgGroupItem LIB "user32.dll" ALIAS "GetNextDlgGroupItem" ( BYVAL hDlg AS QUAD , BYVAL hCtl AS QUAD , BYVAL bPrevious AS LONG ) AS QUAD
DECLARE FUNCTION GetNextDlgTabItem LIB "user32.dll" ALIAS "GetNextDlgTabItem" ( BYVAL hDlg AS QUAD
 , BYVAL hCtl AS DWORD
 , BYVAL bPrevious AS LONG
 ) AS DWORD
DECLARE FUNCTION GetDlgCtrlID LIB "user32.dll" ALIAS "GetDlgCtrlID" ( BYVAL hWnd AS DWORD
 ) AS LONG ' int
DECLARE FUNCTION GetDialogBaseUnits LIB "user32.dll" ALIAS "GetDialogBaseUnits" ( ) AS LONG ' long
DECLARE FUNCTION DefDlgProcA LIB "user32.dll" ALIAS "DefDlgProcA" ( BYVAL hDlg AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
DECLARE FUNCTION DefDlgProcW LIB "user32.dll" ALIAS "DefDlgProcW" ( BYVAL hDlg AS QUAD , BYVAL Msg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO DefDlgProc = DefDlgProcW
#ELSE
 MACRO DefDlgProc = DefDlgProcA
#ENDIF
'/*
' * Window extra byted needed for private dialog classes.
' */
'#ifndef _MAC
'#define DLGWINDOWEXTRA 30
%EQUATE `DLGWINDOWEXTRA = 30&
'#else
'#define DLGWINDOWEXTRA 48
'#define DLGWINDOWEXTRA 48
'#endif
'#endif /* !NOCTLMGR */
'#ENDIF ' #IF NOT %DEF(%NOCTLMGR) ' ------------------------------------------
'#IF NOT %DEF(%NOMSG) '---------------------------------------------------------
'#ifndef NOMSG
DECLARE FUNCTION CallMsgFilterA LIB "user32.dll" ALIAS "CallMsgFilterA" ( BYREF lpMsg AS tagMSG , BYVAL nCode AS LONG ) AS LONG
DECLARE FUNCTION CallMsgFilterW LIB "user32.dll" ALIAS "CallMsgFilterW" ( BYREF lpMsg AS tagMSG
 , BYVAL nCode AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO CallMsgFilter = CallMsgFilterW
#ELSE
 MACRO CallMsgFilter = CallMsgFilterA
#ENDIF
'#endif /* !NOMSG */
'#ENDIF ' #IF NOT %DEF(%NOMSG) '----------------------------------------------
'#IF NOT %DEF(%NOCLIPBOARD) ' --------------------------------------------------
'#ifndef NOCLIPBOARD
'/*
' * Clipboard Manager Functions
' */
DECLARE FUNCTION OpenClipboard LIB "user32.dll" ALIAS "OpenClipboard" ( OPTIONAL BYVAL hWndNewOwner AS QUAD ) AS LONG
DECLARE FUNCTION CloseClipboard LIB "user32.dll" ALIAS "CloseClipboard" ( ) AS LONG
'#if(WINVER >= 0x0500)
DECLARE FUNCTION GetClipboardSequenceNumber LIB "user32.dll" ALIAS "GetClipboardSequenceNumber" ( ) AS QUAD
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION GetClipboardOwner LIB "user32.dll" ALIAS "GetClipboardOwner" ( ) AS QUAD
DECLARE FUNCTION SetClipboardViewer LIB "user32.dll" ALIAS "SetClipboardViewer" ( BYVAL hWndNewViewer AS QUAD
 ) AS DWORD
DECLARE FUNCTION GetClipboardViewer LIB "user32.dll" ALIAS "GetClipboardViewer" ( ) AS DWORD
DECLARE FUNCTION ChangeClipboardChain LIB "user32.dll" ALIAS "ChangeClipboardChain" ( BYVAL hWndRemove AS DWORD
 , BYVAL hWndNewNext AS DWORD
 ) AS LONG
DECLARE FUNCTION SetClipboardData LIB "user32.dll" ALIAS "SetClipboardData" ( BYVAL uFormat AS DWORD
 , OPTIONAL BYVAL hMem AS DWORD
 ) AS DWORD
DECLARE FUNCTION GetClipboardData LIB "user32.dll" ALIAS "GetClipboardData" ( BYVAL uFormat AS DWORD
 ) AS DWORD
DECLARE FUNCTION RegisterClipboardFormatA LIB "user32.dll" ALIAS "RegisterClipboardFormatA" ( BYREF lpszFormat AS ASCIIZ
 ) AS DWORD ' UINT
DECLARE FUNCTION RegisterClipboardFormatW LIB "user32.dll" ALIAS "RegisterClipboardFormatW" ( BYREF lpszFormat AS WSTRINGZ ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO RegisterClipboardFormat = RegisterClipboardFormatW
#ELSE
 MACRO RegisterClipboardFormat = RegisterClipboardFormatA
#ENDIF
DECLARE FUNCTION CountClipboardFormats LIB "user32.dll" ALIAS "CountClipboardFormats" ( ) AS LONG ' int
DECLARE FUNCTION EnumClipboardFormats LIB "user32.dll" ALIAS "EnumClipboardFormats" ( BYVAL format AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION GetClipboardFormatNameA LIB "user32.dll" ALIAS "GetClipboardFormatNameA" ( BYVAL format AS QUAD , BYREF lpszFormatName AS ASCIIZ , BYVAL cchMaxCount AS LONG ) AS LONG ' int
DECLARE FUNCTION GetClipboardFormatNameW LIB "user32.dll" ALIAS "GetClipboardFormatNameW" ( BYVAL format AS QUAD , BYREF lpszFormatName AS WSTRINGZ , BYVAL cchMaxCount AS LONG ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO GetClipboardFormatName = GetClipboardFormatNameW
#ELSE
 MACRO GetClipboardFormatName = GetClipboardFormatNameA
#ENDIF
DECLARE FUNCTION EmptyClipboard LIB "user32.dll" ALIAS "EmptyClipboard" ( ) AS LONG
DECLARE FUNCTION IsClipboardFormatAvailable LIB "user32.dll" ALIAS "IsClipboardFormatAvailable" ( BYVAL format AS QUAD
 ) AS LONG
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPriorityClipboardFormat LIB "User32.dll" ALIAS "GetPriorityClipboardFormat" (BYVAL lpPriorityList AS QUAD PTR, BYVAL nCount AS LONG) AS LONG
#ELSE
DECLARE FUNCTION GetPriorityClipboardFormat LIB "user32.dll" ALIAS "GetPriorityClipboardFormat" ( BYREF paFormatPriorityList AS QUAD , BYVAL cFormats AS LONG ) AS LONG ' int
#ENDIF
DECLARE FUNCTION GetOpenClipboardWindow LIB "user32.dll" ALIAS "GetOpenClipboardWindow" ( ) AS QUAD
'#if(WINVER >= 0x0600)
DECLARE FUNCTION AddClipboardFormatListener LIB "user32.dll" ALIAS "AddClipboardFormatListener" ( BYVAL hWnd AS QUAD ) AS LONG
DECLARE FUNCTION RemoveClipboardFormatListener LIB "user32.dll" ALIAS "RemoveClipboardFormatListener" ( BYVAL hWnd AS QUAD
 ) AS LONG
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetUpdatedClipboardFormats LIB "User32.dll" ALIAS "GetUpdatedClipboardFormats" (BYVAL lpuiFormats AS QUAD PTR, BYVAL cFormats AS QUAD, pcFormatsOut AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION GetUpdatedClipboardFormats LIB "user32.dll" ALIAS "GetUpdatedClipboardFormats" ( BYREF lpuiFormats AS QUAD , BYVAL cFormats AS QUAD , BYREF pcFormatsOut AS QUAD ) AS LONG
#ENDIF
'#endif /* WINVER >= 0x0600 */
'#endif /* !NOCLIPBOARD */
'#ENDIF ' #IF NOT %DEF(%NOCLIPBOARD) ' ---------------------------------------
'/*
' * Character Translation Routines
' */
DECLARE FUNCTION CharToOemA LIB "user32.dll" ALIAS "CharToOemA" ( BYREF lpszSrc AS ASCIIZ , BYREF lpszDst AS ASCIIZ ) AS LONG
DECLARE FUNCTION CharToOemW LIB "user32.dll" ALIAS "CharToOemW" ( BYREF lpszSrc AS WSTRINGZ
 , BYREF lpszDst AS ASCIIZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO CharToOem = CharToOemW
#ELSE
 MACRO CharToOem = CharToOemA
#ENDIF
DECLARE FUNCTION OemToCharA LIB "user32.dll" ALIAS "OemToCharA" ( BYREF lpszSrc AS ASCIIZ , BYREF lpszDst AS ASCIIZ ) AS LONG
DECLARE FUNCTION OemToCharW LIB "user32.dll" ALIAS "OemToCharW" ( BYREF lpszSrc AS ASCIIZ
 , BYREF lpszDst AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO OemToChar = OemToCharW
#ELSE
 MACRO OemToChar = OemToCharA
#ENDIF
DECLARE FUNCTION CharToOemBuffA LIB "user32.dll" ALIAS "CharToOemBuffA" ( BYREF lpszSrc AS ASCIIZ , BYREF lpszDst AS ASCIIZ , BYVAL cchDstLength AS LONG ) AS LONG
DECLARE FUNCTION CharToOemBuffW LIB "user32.dll" ALIAS "CharToOemBuffW" ( BYREF lpszSrc AS WSTRINGZ
 , BYREF lpszDst AS ASCIIZ
 , BYVAL cchDstLength AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO CharToOemBuff = CharToOemBuffW
#ELSE
 MACRO CharToOemBuff = CharToOemBuffA
#ENDIF
DECLARE FUNCTION OemToCharBuffA LIB "user32.dll" ALIAS "OemToCharBuffA" ( BYREF lpszSrc AS ASCIIZ , BYREF lpszDst AS ASCIIZ , BYVAL cchDstLength AS LONG ) AS LONG
DECLARE FUNCTION OemToCharBuffW LIB "user32.dll" ALIAS "OemToCharBuffW" ( BYREF lpszSrc AS ASCIIZ
 , BYREF lpszDst AS WSTRINGZ
 , BYVAL cchDstLength AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO OemToCharBuff = OemToCharBuffW
#ELSE
 MACRO OemToCharBuff = OemToCharBuffA
#ENDIF
DECLARE FUNCTION CharUpperA LIB "user32.dll" ALIAS "CharUpperA" ( BYREF lpsz AS ASCIIZ ) AS QUAD
DECLARE FUNCTION CharUpperW LIB "user32.dll" ALIAS "CharUpperW" ( BYREF lpsz AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CharUpper = CharUpperW
#ELSE
 MACRO CharUpper = CharUpperA
#ENDIF
DECLARE FUNCTION CharUpperBuffA LIB "user32.dll" ALIAS "CharUpperBuffA" ( BYREF lpsz AS ASCIIZ , BYVAL cchLength AS LONG ) AS QUAD
DECLARE FUNCTION CharUpperBuffW LIB "user32.dll" ALIAS "CharUpperBuffW" ( BYREF lpsz AS WSTRINGZ
 , BYVAL cchLength AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CharUpperBuff = CharUpperBuffW
#ELSE
 MACRO CharUpperBuff = CharUpperBuffA
#ENDIF
DECLARE FUNCTION CharLowerA LIB "user32.dll" ALIAS "CharLowerA" ( BYREF lpsz AS ASCIIZ ) AS QUAD
DECLARE FUNCTION CharLowerW LIB "user32.dll" ALIAS "CharLowerW" ( BYREF lpsz AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CharLower = CharLowerW
#ELSE
 MACRO CharLower = CharLowerA
#ENDIF
DECLARE FUNCTION CharLowerBuffA LIB "user32.dll" ALIAS "CharLowerBuffA" ( BYREF lpsz AS ASCIIZ , BYVAL cchLength AS QUAD ) AS QUAD
DECLARE FUNCTION CharLowerBuffW LIB "user32.dll" ALIAS "CharLowerBuffW" ( BYREF lpsz AS WSTRINGZ
 , BYVAL cchLength AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CharLowerBuff = CharLowerBuffW
#ELSE
 MACRO CharLowerBuff = CharLowerBuffA
#ENDIF
DECLARE FUNCTION CharNextA LIB "user32.dll" ALIAS "CharNextA" ( BYREF lpsz AS ASCIIZ ) AS QUAD
DECLARE FUNCTION CharNextW LIB "user32.dll" ALIAS "CharNextW" ( BYREF lpsz AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CharNext = CharNextW
#ELSE
 MACRO CharNext = CharNextA
#ENDIF
DECLARE FUNCTION CharPrevA LIB "user32.dll" ALIAS "CharPrevA" ( BYREF lpszStart AS ASCIIZ , BYREF lpszCurrent AS ASCIIZ ) AS QUAD
DECLARE FUNCTION CharPrevW LIB "user32.dll" ALIAS "CharPrevW" ( BYREF lpszStart AS WSTRINGZ
 , BYREF lpszCurrent AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CharPrev = CharPrevW
#ELSE
 MACRO CharPrev = CharPrevA
#ENDIF
'#if(WINVER >= 0x0400)
DECLARE FUNCTION CharNextExA LIB "user32.dll" ALIAS "CharNextExA" ( BYVAL CodePage AS WORD , BYREF lpCurrentChar AS ASCIIZ , BYVAL dwFlags AS QUAD ) AS QUAD
MACRO CharNextEx = CharNextExA
DECLARE FUNCTION CharPrevExA LIB "user32.dll" ALIAS "CharPrevExA" ( BYVAL CodePage AS WORD , BYREF lpStart AS ASCIIZ , BYREF lpCurrentChar AS ASCIIZ , BYVAL dwFlags AS QUAD ) AS QUAD
MACRO CharPrevEx = CharPrevExA
'#endif /* WINVER >= 0x0400 */
'/*
' * Compatibility defines for character translation routines
' */
'#define AnsiToOem CharToOemA
'#define OemToAnsi OemToCharA
'#define AnsiToOemBuff CharToOemBuffA
'#define OemToAnsiBuff OemToCharBuffA
'#define AnsiUpper CharUpperA
'#define AnsiUpperBuff AnsiUpperBuff
'#define AnsiLower CharLowerA
'#define AnsiLowerBuff CharLowerBuffA
'#define AnsiNext CharNextA
'#define AnsiPrev CharPrevA
MACRO AnsiToOem = CharToOemA
MACRO OemToAnsi = OemToCharA
MACRO AnsiToOemBuff = CharToOemBuffA
MACRO OemToAnsiBuff = OemToCharBuffA
MACRO AnsiUpper = CharUpperA
MACRO AnsiUpperBuff = AnsiUpperBuff
MACRO AnsiLower = CharLowerA
MACRO AnsiLowerBuff = CharLowerBuffA
MACRO AnsiNext = CharNextA
MACRO AnsiPrev = CharPrevA
'#IF NOT %DEF(%NOLANGUAGE) ' ---------------------------------------------------
'#ifndef NOLANGUAGE
'/*
' * Language dependent Routines
' */
DECLARE FUNCTION IsCharAlphaA LIB "user32.dll" ALIAS "IsCharAlphaA" ( BYVAL ch AS BYTE ) AS LONG
DECLARE FUNCTION IsCharAlphaW LIB "user32.dll" ALIAS "IsCharAlphaW" ( BYVAL ch AS WORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsCharAlpha = IsCharAlphaW
#ELSE
 MACRO IsCharAlpha = IsCharAlphaA
#ENDIF
DECLARE FUNCTION IsCharAlphaNumericA LIB "user32.dll" ALIAS "IsCharAlphaNumericA" ( BYVAL ch AS BYTE ) AS LONG
DECLARE FUNCTION IsCharAlphaNumericW LIB "user32.dll" ALIAS "IsCharAlphaNumericW" ( BYVAL ch AS WORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsCharAlphaNumeric = IsCharAlphaNumericW
#ELSE
 MACRO IsCharAlphaNumeric = IsCharAlphaNumericA
#ENDIF
DECLARE FUNCTION IsCharUpperA LIB "user32.dll" ALIAS "IsCharUpperA" ( BYVAL ch AS BYTE ) AS LONG
DECLARE FUNCTION IsCharUpperW LIB "user32.dll" ALIAS "IsCharUpperW" ( BYVAL ch AS WORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsCharUpper = IsCharUpperW
#ELSE
 MACRO IsCharUpper = IsCharUpperA
#ENDIF
DECLARE FUNCTION IsCharLowerA LIB "user32.dll" ALIAS "IsCharLowerA" ( BYVAL ch AS BYTE ) AS LONG
DECLARE FUNCTION IsCharLowerW LIB "user32.dll" ALIAS "IsCharLowerW" ( BYVAL ch AS WORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsCharLower = IsCharLowerW
#ELSE
 MACRO IsCharLower = IsCharLowerA
#ENDIF
'#endif /* !NOLANGUAGE */
'#ENDIF ' #IF NOT %DEF(%NOLANGUAGE) ' ----------------------------------------
DECLARE FUNCTION SetFocus LIB "user32.dll" ALIAS "SetFocus" ( OPTIONAL BYVAL hWnd AS QUAD ) AS QUAD
DECLARE FUNCTION GetActiveWindow LIB "user32.dll" ALIAS "GetActiveWindow" ( ) AS QUAD
DECLARE FUNCTION GetFocus LIB "user32.dll" ALIAS "GetFocus" ( ) AS QUAD
DECLARE FUNCTION GetKBCodePage LIB "user32.dll" ALIAS "GetKBCodePage" ( ) AS QUAD ' UINT
DECLARE FUNCTION GetKeyState LIB "user32.dll" ALIAS "GetKeyState" ( BYVAL nVirtKey AS LONG ) AS INTEGER ' SHORT
DECLARE FUNCTION GetAsyncKeyState LIB "user32.dll" ALIAS "GetAsyncKeyState" ( BYVAL vKey AS LONG ) AS INTEGER ' SHORT
DECLARE FUNCTION GetKeyboardState LIB "user32.dll" ALIAS "GetKeyboardState" ( BYREF lpKeyState AS BYTE ) AS LONG
DECLARE FUNCTION SetKeyboardState LIB "user32.dll" ALIAS "SetKeyboardState" ( BYREF lpKeyState AS BYTE
 ) AS LONG
DECLARE FUNCTION GetKeyNameTextA LIB "user32.dll" ALIAS "GetKeyNameTextA" ( BYVAL lParam AS LONG
 , BYREF lpString AS ASCIIZ
 , BYVAL cchSize AS DWORD
 ) AS LONG ' int
DECLARE FUNCTION GetKeyNameTextW LIB "user32.dll" ALIAS "GetKeyNameTextW" ( BYVAL lParam AS LONG , BYREF lpString AS WSTRINGZ , BYVAL cchSize AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO GetKeyNameText = GetKeyNameTextW
#ELSE
 MACRO GetKeyNameText = GetKeyNameTextA
#ENDIF
DECLARE FUNCTION GetKeyboardType LIB "user32.dll" ALIAS "GetKeyboardType" ( BYVAL nTypeFlag AS LONG ) AS LONG ' int
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION ToAscii LIB "User32.dll" ALIAS "ToAscii" (BYVAL uVirtKey AS QUAD, BYVAL uScanCode AS QUAD, BYVAL lpKeyState AS BYTE PTR, lpChar AS WORD, BYVAL uFlags AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION ToAscii LIB "user32.dll" ALIAS "ToAscii" ( BYVAL uVirtKey AS QUAD , BYVAL uScanCode AS QUAD , BYREF lpKeyState AS BYTE , BYREF lpChar AS QUAD , BYVAL uFlags AS QUAD ) AS LONG ' int
#ENDIF
'#if(WINVER >= 0x0400)
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION ToAsciiEx LIB "User32.dll" ALIAS "ToAsciiEx" (BYVAL uVirtKey AS QUAD, BYVAL uScanCode AS QUAD, BYVAL lpKeyState AS BYTE PTR, lpChar AS WORD, BYVAL uFlags AS QUAD, OPTIONAL BYVAL dwHKL AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION ToAsciiEx LIB "user32.dll" ALIAS "ToAsciiEx" ( BYVAL uVirtKey AS QUAD , BYVAL uScanCode AS QUAD , BYREF lpKeyState AS ANY , BYREF lpChar AS QUAD , BYVAL uFlags AS QUAD , OPTIONAL BYVAL dwhkl AS QUAD ) AS LONG ' int
#ENDIF
'#endif /* WINVER >= 0x0400 */
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION ToUnicode LIB "User32.dll" ALIAS "ToUnicode" (BYVAL uVirtKey AS QUAD, BYVAL uScanCode AS QUAD, BYVAL lpKeyState AS BYTE PTR, pwszBuff AS WSTRINGZ, BYVAL cchBuff AS LONG, BYVAL uFlags AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION ToUnicode LIB "user32.dll" ALIAS "ToUnicode" ( BYVAL wVirtKey AS QUAD , BYVAL wScanCode AS QUAD , BYREF lpKeyState AS BYTE , BYREF pwszBuff AS WSTRINGZ , BYVAL cchBuff AS LONG , BYVAL wFlags AS QUAD ) AS LONG ' int
#ENDIF
DECLARE FUNCTION OemKeyScan LIB "user32.dll" ALIAS "OemKeyScan" ( BYVAL wOemChar AS WORD ) AS QUAD
DECLARE FUNCTION VkKeyScanA LIB "user32.dll" ALIAS "VkKeyScanA" ( BYVAL ch AS BYTE
 ) AS INTEGER ' SHORT
DECLARE FUNCTION VkKeyScanW LIB "user32.dll" ALIAS "VkKeyScanW" ( BYVAL ch AS WORD ) AS INTEGER ' SHORT
#IF %DEF(%UNICODE)
 MACRO VkKeyScan = VkKeyScanW
#ELSE
 MACRO VkKeyScan = VkKeyScanA
#ENDIF
'#if(WINVER >= 0x0400)
DECLARE FUNCTION VkKeyScanExA LIB "user32.dll" ALIAS "VkKeyScanExA" ( BYVAL ch AS BYTE , BYVAL dwhkl AS QUAD ) AS INTEGER ' SHORT
DECLARE FUNCTION VkKeyScanExW LIB "user32.dll" ALIAS "VkKeyScanExW" ( BYVAL ch AS WORD , BYVAL dwhkl AS QUAD ) AS INTEGER ' SHORT
#IF %DEF(%UNICODE)
 MACRO VkKeyScanEx = VkKeyScanExW
#ELSE
 MACRO VkKeyScanEx = VkKeyScanExA
#ENDIF
'#endif /* WINVER >= 0x0400 */
%EQUATE `KEYEVENTF_EXTENDEDKEY = &H0001
%EQUATE `KEYEVENTF_KEYUP = &H0002
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `KEYEVENTF_UNICODE = &H0004
%EQUATE `KEYEVENTF_SCANCODE = &H0008
'#endif /* _WIN32_WINNT >= 0x0500 */
DECLARE SUB keybd_event LIB "user32.dll" ALIAS "keybd_event" ( BYVAL bVk AS BYTE , BYVAL bScan AS BYTE , BYVAL dwFlags AS QUAD , BYVAL dwExtraInfo AS QUAD )
%EQUATE `MOUSEEVENTF_MOVE = &H0001 ' mouse move
%EQUATE `MOUSEEVENTF_LEFTDOWN = &H0002 ' left button down
%EQUATE `MOUSEEVENTF_LEFTUP = &H0004 ' left button up
%EQUATE `MOUSEEVENTF_RIGHTDOWN = &H0008 ' right button down
%EQUATE `MOUSEEVENTF_RIGHTUP = &H0010 ' right button up
%EQUATE `MOUSEEVENTF_MIDDLEDOWN = &H0020 ' middle button down
%EQUATE `MOUSEEVENTF_MIDDLEUP = &H0040 ' middle button up
%EQUATE `MOUSEEVENTF_XDOWN = &H0080 ' /* x button down */
%EQUATE `MOUSEEVENTF_XUP = &H0100 ' /* x button down */
%EQUATE `MOUSEEVENTF_WHEEL = &H0800 ' wheel button rolled
'#if (_WIN32_WINNT >= 0x0600)
'#define MOUSEEVENTF_HWHEEL 0x01000 /* hwheel button rolled */
%EQUATE `MOUSEEVENTF_HWHEEL_VISTA = &H01000 ' /* hwheel button rolled */
'#endif
'#if(WINVER >= 0x0600)
%EQUATE `MOUSEEVENTF_MOVE_NOCOALESCE = &H2000 ' /* do not coalesce mouse moves */
'#endif /* WINVER >= 0x0600 */
%EQUATE `MOUSEEVENTF_VIRTUALDESK = &H4000 '/* map to entire virtual desktop */
%EQUATE `MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move
DECLARE SUB mouse_event LIB "user32.dll" ALIAS "mouse_event" ( BYVAL dwFlags AS QUAD , BYVAL dx AS QUAD , BYVAL dy AS QUAD , BYVAL dwData AS QUAD , BYVAL dwExtraInfo AS QUAD )
'#if (_WIN32_WINNT > 0x0400)
UNION MOUSEINPUT_TIME_UNION
 time AS DWORD
 ' // For compatibility with the PB includes
 dtime AS DWORD
END UNION
' // Size = 24 bytes
TYPE MOUSEINPUT DWORD
 dx AS LONG
 dy AS LONG
 mouseData AS DWORD
 dwFlags AS DWORD
 MOUSEINPUT_TIME_UNION
 dwExtraInfo AS DWORD ' ULONG_PTR
END TYPE
UNION KEYBDINPUT_TIME_UNION
 time AS DWORD
 ' // For compatibility with the PB includes
 dtime AS DWORD
END UNION
' // Size = 16 bytes
TYPE KEYBDINPUT DWORD FILL
 wVk AS WORD ' WORD
 wScan AS WORD ' WORD
 dwFlags AS DWORD
 KEYBDINPUT_TIME_UNION
 dwExtraInfo AS DWORD ' ULONG_PTR
END TYPE
' // Size = 8 bytes
TYPE HARDWAREINPUT DWORD FILL
 uMsg AS DWORD
 wParamL AS WORD ' WORD
 wParamH AS WORD ' WORD
END TYPE
%EQUATE `INPUT_MOUSE = 0
%EQUATE `INPUT_KEYBOARD = 1
%EQUATE `INPUT_HARDWARE = 2
'typedef struct tagINPUT {
' DWORD type;
' union
' {
' MOUSEINPUT mi;
' KEYBDINPUT ki;
' HARDWAREINPUT hi;
' };
'} INPUT, *PINPUT, FAR* LPINPUT;
' // Size = 24 bytes
UNION INPUTAPI_UNION DWORD
 mi AS MOUSEINPUT
 ki AS KEYBDINPUT
 hi AS HARDWAREINPUT
END UNION
' // Size = 28 bytes
TYPE INPUTAPI DWORD
 dtype AS DWORD
 INPUTAPI_UNION
END TYPE
MACRO tagINPUT = INPUTAPI
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SendInput LIB "User32.dll" ALIAS "SendInput" (BYVAL cInputs AS QUAD, BYVAL pInputs AS INPUTAPI PTR, BYVAL cbSize AS LONG) AS QUAD
#ELSE
DECLARE FUNCTION SendInput LIB "user32.dll" ALIAS "SendInput" ( BYVAL cInputs AS QUAD , BYREF pInputs AS INPUTAPI , BYVAL cbSize AS LONG ) AS QUAD ' UINT
#ENDIF
'#endif // (_WIN32_WINNT > 0x0400)
'#if(WINVER >= 0x0601)
'/*
' * Touch Input defines and functions
' */
'/*
' * Touch input handle
' */
'DECLARE_HANDLE(HTOUCHINPUT);
' // Size = 40 bytes
TYPE TOUCHINPUT DWORD
 x AS LONG
 y AS LONG
 hSource AS DWORD
 dwID AS DWORD
 dwFlags AS DWORD
 dwMask AS DWORD
 dwTime AS DWORD
 dwExtraInfo AS DWORD ' ULONG_PTR
 cxContact AS DWORD
 cyContact AS DWORD
END TYPE
'/*
' * Conversion of touch input coordinates to pixels
' */
'#define TOUCH_COORD_TO_PIXEL(l) ((l) / 100)
MACRO TOUCH_COORD_TO_PIXEL(l) = (l / 100)
'/*
' * Touch input flag values (TOUCHINPUT.dwFlags)
' */
%EQUATE `TOUCHEVENTF_MOVE = &H0001
%EQUATE `TOUCHEVENTF_DOWN = &H0002
%EQUATE `TOUCHEVENTF_UP = &H0004
%EQUATE `TOUCHEVENTF_INRANGE = &H0008
%EQUATE `TOUCHEVENTF_PRIMARY = &H0010
%EQUATE `TOUCHEVENTF_NOCOALESCE = &H0020
%EQUATE `TOUCHEVENTF_PEN = &H0040
%EQUATE `TOUCHEVENTF_PALM = &H0080
'/*
' * Touch input mask values (TOUCHINPUT.dwMask)
' */
%EQUATE `TOUCHINPUTMASKF_TIMEFROMSYSTEM = &H0001 ' // the dwTime field contains a system generated value
%EQUATE `TOUCHINPUTMASKF_EXTRAINFO = &H0002 ' // the dwExtraInfo field is valid
%EQUATE `TOUCHINPUTMASKF_CONTACTAREA = &H0004 ' // the cxContact and cyContact fields are valid
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetTouchInputInfo LIB "User32.dll" ALIAS "GetTouchInputInfo" ( BYVAL hTouchInput AS QUAD, ' input event handle; from touch message lParam
 BYVAL cInputs AS DWORD, ' number of elements in the array
 BYVAL pInputs AS TOUCHINPUT PTR, ' array of touch inputs
 BYVAL cbSize AS LONG) ' sizeof(TOUCHINPUT)
 AS LONG
#ELSE
DECLARE FUNCTION GetTouchInputInfo LIB "user32.dll" ALIAS "GetTouchInputInfo" ( BYVAL hTouchInput AS QUAD , BYVAL cInputs AS QUAD , BYREF pInputs AS TOUCHINPUT , BYVAL cbSize AS LONG ) AS LONG
#ENDIF
DECLARE FUNCTION CloseTouchInputHandle LIB "user32.dll" ALIAS "CloseTouchInputHandle" ( BYVAL hTouchInput AS QUAD ) AS LONG
'/*
' * RegisterTouchWindow flag values
' */
%EQUATE `TWF_FINETOUCH = &H00000001
%EQUATE `TWF_WANTPALM = &H00000002
DECLARE FUNCTION RegisterTouchWindow LIB "user32.dll" ALIAS "RegisterTouchWindow" ( BYVAL hwnd AS QUAD , BYVAL ulFlags AS QUAD ) AS LONG
DECLARE FUNCTION UnregisterTouchWindow LIB "user32.dll" ALIAS "UnregisterTouchWindow" ( BYVAL hwnd AS QUAD
 ) AS LONG
DECLARE FUNCTION IsTouchWindow LIB "user32.dll" ALIAS "IsTouchWindow" ( BYVAL hwnd AS DWORD
 , OPTIONAL BYREF pulFlags AS DWORD
 ) AS LONG
'#endif /* WINVER >= 0x0601 */
'#if(_WIN32_WINNT >= 0x0500)
' // Size = 8 bytes
TYPE LASTINPUTINFO DWORD
 cbSize AS DWORD ' UINT
 dwTime AS DWORD
END TYPE
DECLARE FUNCTION GetLastInputInfo LIB "user32.dll" ALIAS "GetLastInputInfo" ( BYREF plii AS LASTINPUTINFO ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0500 */
DECLARE FUNCTION MapVirtualKeyA LIB "user32.dll" ALIAS "MapVirtualKeyA" ( BYVAL uCode AS QUAD , BYVAL uMapType AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION MapVirtualKeyW LIB "user32.dll" ALIAS "MapVirtualKeyW" ( BYVAL uCode AS QUAD , BYVAL uMapType AS QUAD ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO MapVirtualKey = MapVirtualKeyW
#ELSE
 MACRO MapVirtualKey = MapVirtualKeyA
#ENDIF
'#if(WINVER >= 0x0400)
DECLARE FUNCTION MapVirtualKeyExA LIB "user32.dll" ALIAS "MapVirtualKeyExA" ( BYVAL uCode AS QUAD , BYVAL uMapType AS QUAD , OPTIONAL BYVAL dwhkl AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION MapVirtualKeyExW LIB "user32.dll" ALIAS "MapVirtualKeyExW" ( BYVAL uCode AS QUAD , BYVAL uMapType AS QUAD , OPTIONAL BYVAL dwhkl AS QUAD ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO MapVirtualKeyEx = MapVirtualKeyExW
#ELSE
 MACRO MapVirtualKeyEx = MapVirtualKeyExA
#ENDIF
%EQUATE `MAPVK_VK_TO_VSC = 0
%EQUATE `MAPVK_VSC_TO_VK = 1
%EQUATE `MAPVK_VK_TO_CHAR = 2
%EQUATE `MAPVK_VSC_TO_VK_EX = 3
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0600)
%EQUATE `MAPVK_VK_TO_VSC_EX = 4
'#endif /* WINVER >= 0x0600 */
DECLARE FUNCTION GetInputState LIB "user32.dll" ALIAS "GetInputState" ( ) AS LONG
DECLARE FUNCTION GetQueueStatus LIB "user32.dll" ALIAS "GetQueueStatus" ( BYVAL flags AS QUAD
 ) AS DWORD
DECLARE FUNCTION GetCapture LIB "user32.dll" ALIAS "GetCapture" ( ) AS DWORD
DECLARE FUNCTION SetCapture LIB "user32.dll" ALIAS "SetCapture" ( BYVAL hWnd AS DWORD
 ) AS DWORD
DECLARE FUNCTION ReleaseCapture LIB "user32.dll" ALIAS "ReleaseCapture" ( ) AS LONG
DECLARE FUNCTION MsgWaitForMultipleObjects LIB "user32.dll" ALIAS "MsgWaitForMultipleObjects" ( BYVAL nCount AS DWORD
 , BYREF pHandles AS DWORD
 , BYVAL fWaitAll AS LONG
 , BYVAL dwMilliseconds AS DWORD
 , BYVAL dwWakeMask AS DWORD
 ) AS DWORD
#IF %DEF(%USEPBDECL)
' // The PB declare is lacking the dwFlags parameter
DECLARE FUNCTION MsgWaitForMultipleObjectsEx LIB "User32.dll" ALIAS "MsgWaitForMultipleObjectsEx" (BYVAL nCount AS QUAD, BYVAL pHandless AS QUAD PTR, BYVAL dwMilliseconds AS QUAD, BYVAL dwWakeMask AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION MsgWaitForMultipleObjectsEx LIB "user32.dll" ALIAS "MsgWaitForMultipleObjectsEx" ( BYVAL nCount AS QUAD , BYREF pHandles AS QUAD , BYVAL dwMilliseconds AS QUAD , BYVAL dwWakeMask AS QUAD , BYVAL dwFlags AS QUAD ) AS QUAD
#ENDIF
%EQUATE `MWMO_WAITALL = &H0001
%EQUATE `MWMO_ALERTABLE = &H0002
%EQUATE `MWMO_INPUTAVAILABLE = &H0004
'/*
' * Windows Functions
' */
DECLARE FUNCTION SetTimer LIB "user32.dll" ALIAS "SetTimer" ( BYVAL hWnd AS QUAD , BYVAL nIDEvent AS QUAD , BYVAL uElapse AS QUAD , OPTIONAL BYVAL lpTimerFunc AS QUAD ) AS QUAD ' UINT_PTR
DECLARE FUNCTION KillTimer LIB "user32.dll" ALIAS "KillTimer" ( BYVAL hWnd AS QUAD , BYVAL uIDEvent AS QUAD ) AS LONG
DECLARE FUNCTION IsWindowUnicode LIB "user32.dll" ALIAS "IsWindowUnicode" ( BYVAL hWnd AS QUAD
 ) AS LONG
DECLARE FUNCTION EnableWindow LIB "user32.dll" ALIAS "EnableWindow" ( BYVAL hWnd AS DWORD
 , BYVAL bEnable AS LONG
 ) AS LONG
DECLARE FUNCTION IsWindowEnabled LIB "user32.dll" ALIAS "IsWindowEnabled" ( BYVAL hWnd AS DWORD
 ) AS LONG
DECLARE FUNCTION LoadAcceleratorsA LIB "user32.dll" ALIAS "LoadAcceleratorsA" ( BYVAL hInstance AS DWORD
 , BYREF lpTableName AS ASCIIZ
 ) AS DWORD ' HACCEL
DECLARE FUNCTION LoadAcceleratorsW LIB "user32.dll" ALIAS "LoadAcceleratorsW" ( BYVAL hInstance AS QUAD , BYREF lpTableName AS WSTRINGZ ) AS QUAD ' HACCEL
#IF %DEF(%UNICODE)
 MACRO LoadAccelerators = LoadAcceleratorsW
#ELSE
 MACRO LoadAccelerators = LoadAcceleratorsA
#ENDIF
DECLARE FUNCTION CreateAcceleratorTableA LIB "user32.dll" ALIAS "CreateAcceleratorTableA" ( BYREF paccel AS ACCELAPI , BYVAL cAccel AS LONG ) AS QUAD ' HACCEL
DECLARE FUNCTION CreateAcceleratorTableW LIB "user32.dll" ALIAS "CreateAcceleratorTableW" ( BYREF paccel AS ACCELAPI , BYVAL cAccel AS LONG ) AS QUAD ' HACCEL
#IF %DEF(%UNICODE)
 MACRO CreateAcceleratorTable = CreateAcceleratorTableW
#ELSE
 MACRO CreateAcceleratorTable = CreateAcceleratorTableA
#ENDIF
DECLARE FUNCTION DestroyAcceleratorTable LIB "user32.dll" ALIAS "DestroyAcceleratorTable" ( BYVAL hAccel AS QUAD ) AS LONG
DECLARE FUNCTION CopyAcceleratorTableA LIB "user32.dll" ALIAS "CopyAcceleratorTableA" ( BYVAL hAccelSrc AS QUAD
 , BYREF lpAccelDst AS ACCELAPI
 , BYVAL cAccelEntries AS LONG
 ) AS LONG ' int
DECLARE FUNCTION CopyAcceleratorTableW LIB "user32.dll" ALIAS "CopyAcceleratorTableW" ( BYVAL hAccelSrc AS QUAD , BYREF lpAccelDst AS ACCELAPI , BYVAL cAccelEntries AS LONG ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO CopyAcceleratorTable = CopyAcceleratorTableW
#ELSE
 MACRO CopyAcceleratorTable = CopyAcceleratorTableA
#ENDIF
'#IF NOT %DEF(%NOMSG) '---------------------------------------------------------
'#ifndef NOMSG
DECLARE FUNCTION TranslateAcceleratorA LIB "user32.dll" ALIAS "TranslateAcceleratorA" ( BYVAL hWnd AS QUAD , BYVAL hAccTable AS QUAD , BYREF lpMsg AS tagMSG ) AS LONG ' int
DECLARE FUNCTION TranslateAcceleratorW LIB "user32.dll" ALIAS "TranslateAcceleratorW" ( BYVAL hWnd AS QUAD , BYVAL hAccTable AS QUAD , BYREF lpMsg AS tagMSG ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO TranslateAccelerator = TranslateAcceleratorW
#ELSE
 MACRO TranslateAccelerator = TranslateAcceleratorA
#ENDIF
'#endif /* !NOMSG */
'#ENDIF ' #IF NOT %DEF(%NOMSG) '----------------------------------------------
'#IF NOT %DEF(%NOSYSMETRICS) ' -------------------------------------------------
'#ifndef NOSYSMETRICS
'/*
' * GetSystemMetrics() codes
' */
%EQUATE `SM_CXSCREEN = 0&
%EQUATE `SM_CYSCREEN = 1&
%EQUATE `SM_CXVSCROLL = 2&
%EQUATE `SM_CYHSCROLL = 3&
%EQUATE `SM_CYCAPTION = 4&
%EQUATE `SM_CXBORDER = 5&
%EQUATE `SM_CYBORDER = 6&
%EQUATE `SM_CXDLGFRAME = 7&
%EQUATE `SM_CYDLGFRAME = 8&
%EQUATE `SM_CYVTHUMB = 9&
%EQUATE `SM_CXHTHUMB = 10&
%EQUATE `SM_CXICON = 11&
%EQUATE `SM_CYICON = 12&
%EQUATE `SM_CXCURSOR = 13&
%EQUATE `SM_CYCURSOR = 14&
%EQUATE `SM_CYMENU = 15&
%EQUATE `SM_CXFULLSCREEN = 16&
%EQUATE `SM_CYFULLSCREEN = 17&
%EQUATE `SM_CYKANJIWINDOW = 18&
%EQUATE `SM_MOUSEPRESENT = 19&
%EQUATE `SM_CYVSCROLL = 20&
%EQUATE `SM_CXHSCROLL = 21&
%EQUATE `SM_DEBUG = 22&
%EQUATE `SM_SWAPBUTTON = 23&
%EQUATE `SM_RESERVED1 = 24&
%EQUATE `SM_RESERVED2 = 25&
%EQUATE `SM_RESERVED3 = 26&
%EQUATE `SM_RESERVED4 = 27&
%EQUATE `SM_CXMIN = 28&
%EQUATE `SM_CYMIN = 29&
%EQUATE `SM_CXSIZE = 30&
%EQUATE `SM_CYSIZE = 31&
%EQUATE `SM_CXFRAME = 32&
%EQUATE `SM_CYFRAME = 33&
%EQUATE `SM_CXMINTRACK = 34&
%EQUATE `SM_CYMINTRACK = 35&
%EQUATE `SM_CXDOUBLECLK = 36&
%EQUATE `SM_CYDOUBLECLK = 37&
%EQUATE `SM_CXICONSPACING = 38&
%EQUATE `SM_CYICONSPACING = 39&
%EQUATE `SM_MENUDROPALIGNMENT = 40&
%EQUATE `SM_PENWINDOWS = 41&
%EQUATE `SM_DBCSENABLED = 42&
%EQUATE `SM_CMOUSEBUTTONS = 43&
'#if(WINVER >= 0x0400)
%EQUATE `SM_CXFIXEDFRAME = %SM_CXDLGFRAME ' win40 name change
%EQUATE `SM_CYFIXEDFRAME = %SM_CYDLGFRAME ' win40 name change
%EQUATE `SM_CXSIZEFRAME = %SM_CXFRAME ' win40 name change
%EQUATE `SM_CYSIZEFRAME = %SM_CYFRAME ' win40 name change
%EQUATE `SM_SECURE = 44&
%EQUATE `SM_CXEDGE = 45&
%EQUATE `SM_CYEDGE = 46&
%EQUATE `SM_CXMINSPACING = 47&
%EQUATE `SM_CYMINSPACING = 48&
%EQUATE `SM_CXSMICON = 49&
%EQUATE `SM_CYSMICON = 50&
%EQUATE `SM_CYSMCAPTION = 51&
%EQUATE `SM_CXSMSIZE = 52&
%EQUATE `SM_CYSMSIZE = 53&
%EQUATE `SM_CXMENUSIZE = 54&
%EQUATE `SM_CYMENUSIZE = 55&
%EQUATE `SM_ARRANGE = 56&
%EQUATE `SM_CXMINIMIZED = 57&
%EQUATE `SM_CYMINIMIZED = 58&
%EQUATE `SM_CXMAXTRACK = 59&
%EQUATE `SM_CYMAXTRACK = 60&
%EQUATE `SM_CXMAXIMIZED = 61&
%EQUATE `SM_CYMAXIMIZED = 62&
%EQUATE `SM_NETWORK = 63&
%EQUATE `SM_CLEANBOOT = 67&
%EQUATE `SM_CXDRAG = 68&
%EQUATE `SM_CYDRAG = 69&
'#endif /* WINVER >= 0x0400 */
%EQUATE `SM_SHOWSOUNDS = 70&
'#if(WINVER >= 0x0400)
%EQUATE `SM_CXMENUCHECK = 71& ' Use instead of GetMenuCheckMarkDimensions()
%EQUATE `SM_CYMENUCHECK = 72&
%EQUATE `SM_SLOWMACHINE = 73&
%EQUATE `SM_MIDEASTENABLED = 74&
'#endif /* WINVER >= 0x0400 */
'#if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
%EQUATE `SM_MOUSEWHEELPRESENT = 75&
'#endif
'#if(WINVER >= 0x0500)
%EQUATE `SM_XVIRTUALSCREEN = 76&
%EQUATE `SM_YVIRTUALSCREEN = 77&
%EQUATE `SM_CXVIRTUALSCREEN = 78&
%EQUATE `SM_CYVIRTUALSCREEN = 79&
%EQUATE `SM_CMONITORS = 80&
%EQUATE `SM_SAMEDISPLAYFORMAT = 81&
'#endif /* WINVER >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `SM_IMMENABLED = 82&
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `SM_CXFOCUSBORDER = 83&
%EQUATE `SM_CYFOCUSBORDER = 84&
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `SM_TABLETPC = 86&
%EQUATE `SM_MEDIACENTER = 87&
%EQUATE `SM_STARTER = 88&
%EQUATE `SM_SERVERR2 = 89&
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `SM_MOUSEHORIZONTALWHEELPRESENT = 91
%EQUATE `SM_CXPADDEDBORDER = 92
'#endif /* _WIN32_WINNT >= 0x0600 */
'#if(WINVER >= 0x0601)
%EQUATE `SM_DIGITIZER = 94
%EQUATE `SM_MAXIMUMTOUCHES = 95
'#endif /* WINVER >= 0x0601 */
'#if (WINVER < 0x0500) && (!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0400))
'#define SM_CMETRICS 76
'#elif WINVER == 0x500
'#define SM_CMETRICS 83
'#elif WINVER == 0x501
'#define SM_CMETRICS 91
'#elif WINVER == 0x600
'#define SM_CMETRICS 93
'#else
'#define SM_CMETRICS 97
'#endif
#IF %WINVER < &H0500
 %SM_CMETRICS = 76&
#ELSEIF %WINVER = &H500
 %SM_CMETRICS = 83&
#ELSEIF %WINVER = &H501
 %SM_CMETRICS = 91&
#ELSEIF %WINVER = &H600
 %SM_CMETRICS = 93&
#ELSE
 %SM_CMETRICS = 97&
#ENDIF
'#if(WINVER >= 0x0500)
%EQUATE `SM_REMOTESESSION = &H1000&
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `SM_SHUTTINGDOWN = &H2000&
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(WINVER >= 0x0501)
%EQUATE `SM_REMOTECONTROL = &H2001&
'#endif /* WINVER >= 0x0501 */
'#if(WINVER >= 0x0501)
%EQUATE `SM_CARETBLINKINGENABLED = &H2002&
'#endif /* WINVER >= 0x0501 */
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION GetSystemMetrics LIB "user32.dll" ALIAS "GetSystemMetrics" ( BYVAL nIndex AS LONG ) AS LONG ' int
'#endif /* !NOSYSMETRICS */
'#ENDIF ' #IF NOT %DEF(%NOSYSMETRICS) ' --------------------------------------
'#IF NOT %DEF(%NOMENUS) ' ------------------------------------------------------
'#ifndef NOMENUS
DECLARE FUNCTION LoadMenuA LIB "user32.dll" ALIAS "LoadMenuA" ( BYVAL hInstance AS QUAD , BYREF lpMenuName AS ASCIIZ ) AS QUAD ' HMENU
DECLARE FUNCTION LoadMenuW LIB "user32.dll" ALIAS "LoadMenuW" ( BYVAL hInstance AS QUAD , BYREF lpMenuName AS WSTRINGZ ) AS QUAD ' HMENU
#IF %DEF(%UNICODE)
 MACRO LoadMenu = LoadMenuW
#ELSE
 MACRO LoadMenu = LoadMenuA
#ENDIF
DECLARE FUNCTION LoadMenuIndirectA LIB "user32.dll" ALIAS "LoadMenuIndirectA" ( BYREF lpMenuTemplate AS ANY ) AS QUAD ' HMENU
DECLARE FUNCTION LoadMenuIndirectW LIB "user32.dll" ALIAS "LoadMenuIndirectW" ( BYREF lpMenuTemplate AS ANY ) AS QUAD ' HMENU
#IF %DEF(%UNICODE)
 MACRO LoadMenuIndirect = LoadMenuIndirectW
#ELSE
 MACRO LoadMenuIndirect = LoadMenuIndirectA
#ENDIF
DECLARE FUNCTION GetMenu LIB "user32.dll" ALIAS "GetMenu" ( BYVAL hWnd AS QUAD ) AS QUAD ' HMENU
DECLARE FUNCTION SetMenu LIB "user32.dll" ALIAS "SetMenu" ( BYVAL hWnd AS QUAD , OPTIONAL BYVAL hMenu AS QUAD ) AS LONG
DECLARE FUNCTION ChangeMenuA LIB "user32.dll" ALIAS "ChangeMenuA" ( BYVAL hMenu AS QUAD
 , BYVAL cmd AS DWORD
 , BYREF lpszNewItem AS ASCIIZ
 , BYVAL cmdInsert AS DWORD
 , BYVAL Flags AS DWORD
 ) AS LONG
DECLARE FUNCTION ChangeMenuW LIB "user32.dll" ALIAS "ChangeMenuW" ( BYVAL hMenu AS DWORD
 , BYVAL cmd AS DWORD
 , BYREF lpszNewItem AS WSTRINGZ
 , BYVAL cmdInsert AS DWORD
 , BYVAL Flags AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO ChangeMenu = ChangeMenuW
#ELSE
 MACRO ChangeMenu = ChangeMenuA
#ENDIF
DECLARE FUNCTION HiliteMenuItem LIB "user32.dll" ALIAS "HiliteMenuItem" ( BYVAL hWnd AS QUAD , BYVAL hMenu AS QUAD , BYVAL uIDHiliteItem AS QUAD , BYVAL uHilite AS QUAD ) AS LONG
DECLARE FUNCTION GetMenuStringA LIB "user32.dll" ALIAS "GetMenuStringA" ( BYVAL hMenu AS QUAD
 , BYVAL uIDItem AS DWORD
 , BYREF lpString AS ASCIIZ
 , BYVAL cchMax AS LONG
 , BYVAL Flags AS DWORD
 ) AS LONG ' int
DECLARE FUNCTION GetMenuStringW LIB "user32.dll" ALIAS "GetMenuStringW" ( BYVAL hMenu AS QUAD , BYVAL uIDItem AS QUAD , BYREF lpString AS WSTRINGZ , BYVAL cchMax AS LONG , BYVAL Flags AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO GetMenuString = GetMenuStringW
#ELSE
 MACRO GetMenuString = GetMenuStringA
#ENDIF
DECLARE FUNCTION GetMenuState LIB "user32.dll" ALIAS "GetMenuState" ( BYVAL hMenu AS QUAD , BYVAL uId AS QUAD , BYVAL uFlags AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION DrawMenuBar LIB "user32.dll" ALIAS "DrawMenuBar" ( BYVAL hWnd AS QUAD ) AS LONG
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `PMB_ACTIVE = &H00000001
'#endif /* _WIN32_WINNT >= 0x0501 */
DECLARE FUNCTION GetSystemMenu LIB "user32.dll" ALIAS "GetSystemMenu" ( BYVAL hWnd AS QUAD , BYVAL bRevert AS LONG ) AS QUAD ' HMENU
DECLARE FUNCTION CreateMenu LIB "user32.dll" ALIAS "CreateMenu" ( ) AS QUAD ' HMENU
DECLARE FUNCTION CreatePopupMenu LIB "user32.dll" ALIAS "CreatePopupMenu" ( ) AS QUAD ' HMENU
DECLARE FUNCTION DestroyMenu LIB "user32.dll" ALIAS "DestroyMenu" ( BYVAL hMenu AS QUAD ) AS LONG
DECLARE FUNCTION CheckMenuItem LIB "user32.dll" ALIAS "CheckMenuItem" ( BYVAL hMenu AS QUAD
 , BYVAL uIDCheckItem AS DWORD
 , BYVAL uCheck AS DWORD
 ) AS DWORD
DECLARE FUNCTION EnableMenuItem LIB "user32.dll" ALIAS "EnableMenuItem" ( BYVAL hMenu AS DWORD
 , BYVAL uIDEnableItem AS DWORD
 , BYVAL uEnable AS DWORD
 ) AS LONG
DECLARE FUNCTION GetSubMenu LIB "user32.dll" ALIAS "GetSubMenu" ( BYVAL hMenu AS DWORD
 , BYVAL nPos AS LONG
 ) AS DWORD ' HMENU
DECLARE FUNCTION GetMenuItemID LIB "user32.dll" ALIAS "GetMenuItemID" ( BYVAL hMenu AS QUAD , BYVAL nPos AS LONG ) AS QUAD ' UINT
DECLARE FUNCTION GetMenuItemCount LIB "user32.dll" ALIAS "GetMenuItemCount" ( OPTIONAL BYVAL hMenu AS QUAD ) AS LONG ' int
DECLARE FUNCTION InsertMenuA LIB "user32.dll" ALIAS "InsertMenuA" ( BYVAL hMenu AS QUAD , BYVAL uPosition AS QUAD , BYVAL uFlags AS QUAD , BYVAL uIDNewItem AS QUAD , OPTIONAL BYREF lpNewItem AS ASCIIZ ) AS LONG
DECLARE FUNCTION InsertMenuW LIB "user32.dll" ALIAS "InsertMenuW" ( BYVAL hMenu AS QUAD
 , BYVAL uPosition AS DWORD
 , BYVAL uFlags AS DWORD
 , BYVAL uIDNewItem AS DWORD
 , OPTIONAL BYREF lpNewItem AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InsertMenu = InsertMenuW
#ELSE
 MACRO InsertMenu = InsertMenuA
#ENDIF
DECLARE FUNCTION AppendMenuA LIB "user32.dll" ALIAS "AppendMenuA" ( BYVAL hMenu AS QUAD , BYVAL uFlags AS QUAD , BYVAL uIDNewItem AS QUAD , OPTIONAL BYREF lpNewItem AS ASCIIZ ) AS LONG
DECLARE FUNCTION AppendMenuW LIB "user32.dll" ALIAS "AppendMenuW" ( BYVAL hMenu AS QUAD
 , BYVAL uFlags AS DWORD
 , BYVAL uIDNewItem AS DWORD
 , OPTIONAL BYREF lpNewItem AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO AppendMenu = AppendMenuW
#ELSE
 MACRO AppendMenu = AppendMenuA
#ENDIF
DECLARE FUNCTION ModifyMenuA LIB "user32.dll" ALIAS "ModifyMenuA" ( BYVAL hMnu AS QUAD , BYVAL uPosition AS QUAD , BYVAL uFlags AS QUAD , BYVAL uIDNewItem AS QUAD , OPTIONAL BYREF lpNewItem AS ASCIIZ ) AS LONG
DECLARE FUNCTION ModifyMenuW LIB "user32.dll" ALIAS "ModifyMenuW" ( BYVAL hMnu AS QUAD
 , BYVAL uPosition AS DWORD
 , BYVAL uFlags AS DWORD
 , BYVAL uIDNewItem AS DWORD
 , OPTIONAL BYREF lpNewItem AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO ModifyMenu = ModifyMenuW
#ELSE
 MACRO ModifyMenu = ModifyMenuA
#ENDIF
DECLARE FUNCTION RemoveMenu LIB "user32.dll" ALIAS "RemoveMenu" ( BYVAL hMenu AS QUAD , BYVAL uPosition AS QUAD , BYVAL uFlags AS QUAD ) AS LONG
DECLARE FUNCTION DeleteMenu LIB "user32.dll" ALIAS "DeleteMenu" ( BYVAL hMenu AS QUAD
 , BYVAL uPosition AS DWORD
 , BYVAL uFlags AS DWORD
 ) AS LONG
DECLARE FUNCTION SetMenuItemBitmaps LIB "user32.dll" ALIAS "SetMenuItemBitmaps" ( BYVAL hMenu AS DWORD
 , BYVAL uPosition AS DWORD
 , BYVAL uFlags AS DWORD
 , OPTIONAL BYVAL hBitmapUnchecked AS DWORD
 , OPTIONAL BYVAL hBitmapChecked AS DWORD
 ) AS LONG
DECLARE FUNCTION GetMenuCheckMarkDimensions LIB "user32.dll" ALIAS "GetMenuCheckMarkDimensions" ( ) AS LONG ' long
DECLARE FUNCTION TrackPopupMenu LIB "user32.dll" ALIAS "TrackPopupMenu" ( BYVAL hMenu AS QUAD , BYVAL uFlags AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG , BYVAL nReserved AS LONG , BYVAL hWnd AS QUAD , OPTIONAL BYREF prcRect AS RECT ) AS LONG
'#if(WINVER >= 0x0400)
'/* return codes for WM_MENUCHAR */
%EQUATE `MNC_IGNORE = 0&
%EQUATE `MNC_CLOSE = 1&
%EQUATE `MNC_EXECUTE = 2&
%EQUATE `MNC_SELECT = 3&
' // Size = 20 bytes
TYPE TPMPARAMS DWORD
 cbSize AS DWORD ' UINT /* Size of structure */
 rcExclude AS RECT ' RECT /* Screen coordinates of rectangle to exclude when positioning */
END TYPE
DECLARE FUNCTION TrackPopupMenuEx LIB "user32.dll" ALIAS "TrackPopupMenuEx" (_
 BYVAL hMenu AS DWORD
 , BYVAL fuFlags AS DWORD
 , BYVAL x AS LONG
 , BYVAL y AS LONG
 , BYVAL hWnd AS DWORD
 , OPTIONAL BYREF ptpm AS TPMPARAMS
 ) AS LONG
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0601)
DECLARE FUNCTION CalculatePopupWindowPosition LIB "user32.dll" ALIAS "CalculatePopupWindowPosition" (_
 BYREF anchorPoint AS POINT
 , BYREF windowSize AS SIZE
 , BYVAL flags AS DWORD
 , BYREF excludeRect AS RECT
 , BYREF popupWindowPosition AS RECT
 ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0601 */
'#if(WINVER >= 0x0500)
%EQUATE `MNS_NOCHECK = &H80000000
%EQUATE `MNS_MODELESS = &H40000000
%EQUATE `MNS_DRAGDROP = &H20000000
%EQUATE `MNS_AUTODISMISS = &H10000000
%EQUATE `MNS_NOTIFYBYPOS = &H08000000
%EQUATE `MNS_CHECKORBMP = &H04000000
%EQUATE `MIM_MAXHEIGHT = &H00000001
%EQUATE `MIM_BACKGROUND = &H00000002
%EQUATE `MIM_HELPID = &H00000004
%EQUATE `MIM_MENUDATA = &H00000008
%EQUATE `MIM_STYLE = &H00000010
%EQUATE `MIM_APPLYTOSUBMENUS = &H80000000
' // Size = 28 bytes
TYPE MENUINFO DWORD
 cbSize AS DWORD
 fMask AS DWORD
 dwStyle AS DWORD
 cyMax AS DWORD ' UINT
 hbrBack AS DWORD ' HBRUSH
 dwContextHelpID AS DWORD
 dwMenuData AS DWORD ' ULONG_PTR
END TYPE
DECLARE FUNCTION GetMenuInfo LIB "user32.dll" ALIAS "GetMenuInfo" ( BYVAL hmenu AS QUAD , BYREF lpcmi AS MENUINFO ) AS LONG
DECLARE FUNCTION SetMenuInfo LIB "user32.dll" ALIAS "SetMenuInfo" ( BYVAL hmenu AS QUAD
 , BYREF lpcmi AS MENUINFO
 ) AS LONG
DECLARE FUNCTION EndMenu LIB "user32.dll" ALIAS "EndMenu" ( ) AS LONG
'/*
' * WM_MENUDRAG return values.
' */
%EQUATE `MND_CONTINUE = 0&
%EQUATE `MND_ENDMENU = 1&
' // Size = 20 bytes
TYPE MENUGETOBJECTINFO DWORD
 dwFlags AS DWORD
 uPos AS DWORD ' UINT
 hmenu AS DWORD ' HMENU
 riid AS DWORD
 pvObj AS DWORD
END TYPE
'/*
' * MENUGETOBJECTINFO dwFlags values
' */
%EQUATE `MNGOF_TOPGAP = &H00000001
%EQUATE `MNGOF_BOTTOMGAP = &H00000002
'/*
' * WM_MENUGETOBJECT return values
' */
%EQUATE `MNGO_NOINTERFACE = &H00000000
%EQUATE `MNGO_NOERROR = &H00000001
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0400)
%EQUATE `MIIM_STATE = &H00000001
%EQUATE `MIIM_ID = &H00000002
%EQUATE `MIIM_SUBMENU = &H00000004
%EQUATE `MIIM_CHECKMARKS = &H00000008
%EQUATE `MIIM_TYPE = &H00000010
%EQUATE `MIIM_DATA = &H00000020
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
%EQUATE `MIIM_STRING = &H00000040
%EQUATE `MIIM_BITMAP = &H00000080
%EQUATE `MIIM_FTYPE = &H00000100
%EQUATE `HBMMENU_CALLBACK = &HFFFFFFFF ' ((HBITMAP) -1)
%EQUATE `HBMMENU_SYSTEM = 1 ' ((HBITMAP) 1)
%EQUATE `HBMMENU_MBAR_RESTORE = 2 ' ((HBITMAP) 2)
%EQUATE `HBMMENU_MBAR_MINIMIZE = 3 ' ((HBITMAP) 3)
%EQUATE `HBMMENU_MBAR_CLOSE = 5 ' ((HBITMAP) 5)
%EQUATE `HBMMENU_MBAR_CLOSE_D = 6 ' ((HBITMAP) 6)
%EQUATE `HBMMENU_MBAR_MINIMIZE_D = 7 ' ((HBITMAP) 7)
%EQUATE `HBMMENU_POPUP_CLOSE = 8 ' ((HBITMAP) 8)
%EQUATE `HBMMENU_POPUP_RESTORE = 9 ' ((HBITMAP) 9)
%EQUATE `HBMMENU_POPUP_MAXIMIZE = 10 ' ((HBITMAP) 10)
%EQUATE `HBMMENU_POPUP_MINIMIZE = 11 ' ((HBITMAP) 11)
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0400)
' // Size = 48 bytes
TYPE MENUITEMINFOA DWORD
 cbSize AS DWORD ' UINT
 fMask AS DWORD ' UINT
 fType AS DWORD ' UINT // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
 fState AS DWORD ' UINT // used if MIIM_STATE
 wID AS DWORD ' UINT // used if MIIM_ID
 hSubMenu AS DWORD ' HMENU // used if MIIM_SUBMENU
 hbmpChecked AS DWORD ' HBITMAP // used if MIIM_CHECKMARKS
 hbmpUnchecked AS DWORD ' HBITMAP // used if MIIM_CHECKMARKS
 dwItemData AS DWORD ' ULONG_PTR // used if MIIM_DATA
 dwTypeData AS ASCIIZ PTR ' LPSTR // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
 cch AS DWORD ' UINT // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
#IF %WINVER >= &H0500
 hbmpItem AS DWORD ' HBITMAP // used if MIIM_BITMAP
#ENDIF ' /* WINVER >= 0x0500 */
END TYPE
' // Size = 48 bytes
TYPE MENUITEMINFOW DWORD
 cbSize AS DWORD ' UINT
 fMask AS DWORD ' UINT
 fType AS DWORD ' UINT // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
 fState AS DWORD ' UINT // used if MIIM_STATE
 wID AS DWORD ' UINT // used if MIIM_ID
 hSubMenu AS DWORD ' HMENU // used if MIIM_SUBMENU
 hbmpChecked AS DWORD ' HBITMAP // used if MIIM_CHECKMARKS
 hbmpUnchecked AS DWORD ' HBITMAP // used if MIIM_CHECKMARKS
 dwItemData AS DWORD ' ULONG_PTR // used if MIIM_DATA
 dwTypeData AS WSTRINGZ PTR ' LPWSTR // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
 cch AS DWORD ' UINT // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
#IF %WINVER >= &H0500
 hbmpItem AS DWORD ' HBITMAP // used if MIIM_BITMAP
#ENDIF ' /* WINVER >= 0x0500 */
END TYPE
#IF %DEF(%UNICODE)
MACRO MENUITEMINFO = MENUITEMINFOW
#ELSE
MACRO MENUITEMINFO = MENUITEMINFOA
#ENDIF
DECLARE FUNCTION InsertMenuItemA LIB "user32.dll" ALIAS "InsertMenuItemA" ( BYVAL hmenu AS QUAD , BYVAL item AS QUAD , BYVAL fByPosition AS LONG , BYREF lpmi AS MENUITEMINFOA ) AS LONG
DECLARE FUNCTION InsertMenuItemW LIB "user32.dll" ALIAS "InsertMenuItemW" ( BYVAL hmenu AS QUAD
 , BYVAL item AS DWORD
 , BYVAL fByPosition AS LONG
 , BYREF lpmi AS MENUITEMINFOW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InsertMenuItem = InsertMenuItemW
#ELSE
 MACRO InsertMenuItem = InsertMenuItemA
#ENDIF
DECLARE FUNCTION GetMenuItemInfoA LIB "user32.dll" ALIAS "GetMenuItemInfoA" ( BYVAL hmenu AS QUAD , BYVAL item AS QUAD , BYVAL fByPosition AS LONG , BYREF lpmii AS MENUITEMINFOA ) AS LONG
DECLARE FUNCTION GetMenuItemInfoW LIB "user32.dll" ALIAS "GetMenuItemInfoW" ( BYVAL hmenu AS QUAD
 , BYVAL item AS DWORD
 , BYVAL fByPosition AS LONG
 , BYREF lpmii AS MENUITEMINFOW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetMenuItemInfo = GetMenuItemInfoW
#ELSE
 MACRO GetMenuItemInfo = GetMenuItemInfoA
#ENDIF
DECLARE FUNCTION SetMenuItemInfoA LIB "user32.dll" ALIAS "SetMenuItemInfoA" ( BYVAL hmenu AS QUAD , BYVAL item AS QUAD , BYVAL fByPositon AS LONG , BYREF lpmii AS MENUITEMINFOA ) AS LONG
DECLARE FUNCTION SetMenuItemInfoW LIB "user32.dll" ALIAS "SetMenuItemInfoW" ( BYVAL hmenu AS QUAD
 , BYVAL item AS DWORD
 , BYVAL fByPositon AS LONG
 , BYREF lpmii AS MENUITEMINFOW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SetMenuItemInfo = SetMenuItemInfoW
#ELSE
 MACRO SetMenuItemInfo = SetMenuItemInfoA
#ENDIF
%EQUATE `GMDI_USEDISABLED = &H0001
%EQUATE `GMDI_GOINTOPOPUPS = &H0002
DECLARE FUNCTION GetMenuDefaultItem LIB "user32.dll" ALIAS "GetMenuDefaultItem" ( BYVAL hMenu AS QUAD , BYVAL fByPos AS QUAD , BYVAL gmdiFlags AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION SetMenuDefaultItem LIB "user32.dll" ALIAS "SetMenuDefaultItem" ( BYVAL hMenu AS QUAD , BYVAL uItem AS QUAD , BYVAL fByPos AS QUAD ) AS LONG
DECLARE FUNCTION GetMenuItemRect LIB "user32.dll" ALIAS "GetMenuItemRect" ( BYVAL hWnd AS QUAD
 , BYVAL hMenu AS DWORD
 , BYVAL uItem AS DWORD
 , BYREF lprcItem AS RECT
 ) AS LONG
DECLARE FUNCTION MenuItemFromPoint LIB "user32.dll" ALIAS "MenuItemFromPoint" ( BYVAL hWnd AS DWORD
 , BYVAL hMenu AS DWORD
 , BYVAL pt AS POINT
 ) AS LONG ' int
' // Same as above, but using x, y coordinates
DECLARE FUNCTION MenuItemFromXY LIB "user32.dll" ALIAS "MenuItemFromPoint" ( BYVAL hWnd AS QUAD , BYVAL hMenu AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG ) AS LONG ' int
'#endif /* WINVER >= 0x0400 */
'/*
' * Flags for TrackPopupMenu
' */
'%TPM_LEFTBUTTON = &H0000
'%TPM_RIGHTBUTTON = &H0002
'%TPM_LEFTALIGN = &H0000
'%TPM_CENTERALIGN = &H0004
'%TPM_RIGHTALIGN = &H0008
'#if(WINVER >= 0x0400)
'%TPM_TOPALIGN = &H0000
'%TPM_VCENTERALIGN = &H0010
'%TPM_BOTTOMALIGN = &H0020
%EQUATE `TPM_HORIZONTAL = &H0000 ' Horz alignment matters more
%EQUATE `TPM_VERTICAL = &H0040 ' Vert alignment matters more
%EQUATE `TPM_NONOTIFY = &H0080 ' Don't send any notification msgs
%EQUATE `TPM_RETURNCMD = &H0100
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
%EQUATE `TPM_RECURSE = &H00001
%EQUATE `TPM_HORPOSANIMATION = &H00400
%EQUATE `TPM_HORNEGANIMATION = &H00800
%EQUATE `TPM_VERPOSANIMATION = &H01000
%EQUATE `TPM_VERNEGANIMATION = &H02000
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `TPM_NOANIMATION = &H04000
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `TPM_LAYOUTRTL = &H08000
'#endif /* _WIN32_WINNT >= 0x0501 */
'#endif /* WINVER >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `TPM_WORKAREA = &H10000
'#endif /* _WIN32_WINNT >= 0x0601 */
'#endif /* !NOMENUS */
'#ENDIF ' #IF NOT %DEF(%NOMENUS) ' -------------------------------------------
'#if(WINVER >= 0x0400)
'//
'// Drag-and-drop support
'// Obsolete - use OLE instead
'//
' // Size = 28 bytes
TYPE DROPSTRUCT DWORD
 hwndSource AS DWORD
 hwndSink AS DWORD
 wFmt AS DWORD
 dwData AS DWORD ' ULONG_PTR
 ptDrop AS POINT
 dwControlData AS DWORD
END TYPE
%EQUATE `DOF_EXECUTABLE = &H8001 ' wFmt flags
%EQUATE `DOF_DOCUMENT = &H8002
%EQUATE `DOF_DIRECTORY = &H8003
%EQUATE `DOF_MULTIPLE = &H8004
%EQUATE `DOF_PROGMAN = &H0001
%EQUATE `DOF_SHELLDATA = &H0002
%EQUATE `DO_DROPFILE = &H454C4946
%EQUATE `DO_PRINTFILE = &H544E5250
DECLARE FUNCTION DragObject LIB "user32.dll" ALIAS "DragObject" ( BYVAL hWnd AS QUAD , BYVAL hwndFrom AS QUAD , BYVAL fmt AS QUAD , BYVAL data AS QUAD , OPTIONAL BYVAL hcur AS QUAD ) AS QUAD
DECLARE FUNCTION DragDetect LIB "user32.dll" ALIAS "DragDetect" ( BYVAL hwnd AS QUAD
 , BYVAL pt AS POINT
 ) AS LONG
' // Same as above, but using x, y coordinates
DECLARE FUNCTION DragDetectXY LIB "user32.dll" ALIAS "DragDetect" ( BYVAL hwnd AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG ) AS LONG
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION DrawIcon LIB "user32.dll" ALIAS "DrawIcon" ( BYVAL hDC AS QUAD , BYVAL X AS LONG , BYVAL Y AS LONG , BYVAL hIcon AS QUAD ) AS LONG
'#IF NOT %DEF(%NODRAWTEXT) ' ---------------------------------------------------
'#ifndef NODRAWTEXT
'/*
' * DrawText() Format Flags
' */
%EQUATE `DT_TOP = &H00000000
%EQUATE `DT_LEFT = &H00000000
%EQUATE `DT_CENTER = &H00000001
%EQUATE `DT_RIGHT = &H00000002
%EQUATE `DT_VCENTER = &H00000004
%EQUATE `DT_BOTTOM = &H00000008
%EQUATE `DT_WORDBREAK = &H00000010
%EQUATE `DT_SINGLELINE = &H00000020
%EQUATE `DT_EXPANDTABS = &H00000040
%EQUATE `DT_TABSTOP = &H00000080
%EQUATE `DT_NOCLIP = &H00000100
%EQUATE `DT_EXTERNALLEADING = &H00000200
%EQUATE `DT_CALCRECT = &H00000400
%EQUATE `DT_NOPREFIX = &H00000800
%EQUATE `DT_INTERNAL = &H00001000
'#if(WINVER >= 0x0400)
%EQUATE `DT_EDITCONTROL = &H00002000
%EQUATE `DT_PATH_ELLIPSIS = &H00004000
%EQUATE `DT_END_ELLIPSIS = &H00008000
%EQUATE `DT_MODIFYSTRING = &H00010000
%EQUATE `DT_RTLREADING = &H00020000
%EQUATE `DT_WORD_ELLIPSIS = &H00040000
'#if(WINVER >= 0x0500)
%EQUATE `DT_NOFULLWIDTHCHARBREAK = &H00080000
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `DT_HIDEPREFIX = &H00100000
%EQUATE `DT_PREFIXONLY = &H00200000
'#endif /* _WIN32_WINNT >= 0x0500 */
'#endif /* WINVER >= 0x0500 */
' // Size = 20 bytes
TYPE DRAWTEXTPARAMS DWORD
 cbSize AS DWORD ' UINT
 iTabLength AS LONG ' int
 iLeftMargin AS LONG ' int
 iRightMargin AS LONG ' int
 uiLengthDrawn AS DWORD ' UINT
END TYPE
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION DrawTextA LIB "user32.dll" ALIAS "DrawTextA" ( BYVAL hdc AS QUAD , BYREF lpchText AS ASCIIZ , BYVAL cchText AS LONG , BYREF lprc AS RECT , BYVAL format AS QUAD ) AS LONG ' int
DECLARE FUNCTION DrawTextW LIB "user32.dll" ALIAS "DrawTextW" ( BYVAL hdc AS QUAD , BYREF lpchText AS WSTRINGZ , BYVAL cchText AS LONG , BYREF lprc AS RECT , BYVAL format AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO DrawText = DrawTextW
#ELSE
 MACRO DrawText = DrawTextA
#ENDIF
'#if(WINVER >= 0x0400)
DECLARE FUNCTION DrawTextExA LIB "user32.dll" ALIAS "DrawTextExA" ( BYVAL hdc AS QUAD , BYREF lpchText AS ASCIIZ , BYVAL cchText AS LONG , BYREF lprc AS RECT , BYVAL format AS QUAD , OPTIONAL BYREF lpdtp AS DRAWTEXTPARAMS ) AS LONG ' int
DECLARE FUNCTION DrawTextExW LIB "user32.dll" ALIAS "DrawTextExW" ( BYVAL hdc AS QUAD , BYREF lpchText AS WSTRINGZ , BYVAL cchText AS LONG , BYREF lprc AS RECT , BYVAL format AS QUAD , OPTIONAL BYREF lpdtp AS DRAWTEXTPARAMS ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO DrawTextEx = DrawTextExW
#ELSE
 MACRO DrawTextEx = DrawTextExA
#ENDIF
'#endif /* !NODRAWTEXT */
'#ENDIF ' #IF NOT %DEF(%NODRAWTEXT) ' ----------------------------------------
DECLARE FUNCTION GrayStringA LIB "user32.dll" ALIAS "GrayStringA" ( BYVAL hDC AS QUAD , BYVAL hBrush AS QUAD , BYVAL lpOutputFunc AS QUAD , BYVAL lpData AS LONG , BYVAL nCount AS LONG , BYVAL X AS LONG , BYVAL Y AS LONG , BYVAL nWidth AS LONG , BYVAL nHeight AS LONG ) AS LONG
DECLARE FUNCTION GrayStringW LIB "user32.dll" ALIAS "GrayStringW" ( BYVAL hDC AS QUAD
 , BYVAL hBrush AS DWORD
 , BYVAL lpOutputFunc AS DWORD
 , BYVAL lpData AS LONG
 , BYVAL nCount AS LONG
 , BYVAL X AS LONG
 , BYVAL Y AS LONG
 , BYVAL nWidth AS LONG
 , BYVAL nHeight AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GrayString = GrayStringW
#ELSE
 MACRO GrayString = GrayStringA
#ENDIF
'#if(WINVER >= 0x0400)
'/* Monolithic state-drawing routine */
'/* Image type */
%EQUATE `DST_COMPLEX = &H0000
%EQUATE `DST_TEXT = &H0001
%EQUATE `DST_PREFIXTEXT = &H0002
%EQUATE `DST_ICON = &H0003
%EQUATE `DST_BITMAP = &H0004
'/* State type */
%EQUATE `DSS_NORMAL = &H0000
%EQUATE `DSS_UNION = &H0010 ' Gray string appearance
%EQUATE `DSS_DISABLED = &H0020
%EQUATE `DSS_MONO = &H0080
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `DSS_HIDEPREFIX = &H0200
%EQUATE `DSS_PREFIXONLY = &H0400
'#endif /* _WIN32_WINNT >= 0x0500 */
%EQUATE `DSS_RIGHT = &H8000
DECLARE FUNCTION DrawStateA LIB "user32.dll" ALIAS "DrawStateA" ( BYVAL hdc AS QUAD , BYVAL hbrFore AS QUAD , BYVAL qfnCallBack AS QUAD , BYVAL lData AS LONG , BYVAL wData AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG , BYVAL cx AS LONG , BYVAL cy AS LONG , BYVAL uFlags AS QUAD ) AS LONG
DECLARE FUNCTION DrawStateW LIB "user32.dll" ALIAS "DrawStateW" ( BYVAL hdc AS QUAD
 , BYVAL hbrFore AS DWORD
 , BYVAL qfnCallBack AS DWORD
 , BYVAL lData AS LONG
 , BYVAL wData AS DWORD
 , BYVAL x AS LONG
 , BYVAL y AS LONG
 , BYVAL cx AS LONG
 , BYVAL cy AS LONG
 , BYVAL uFlags AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DrawState = DrawStateW
#ELSE
 MACRO DrawState = DrawStateA
#ENDIF
DECLARE FUNCTION TabbedTextOutA LIB "user32.dll" ALIAS "TabbedTextOutA" ( BYVAL hdc AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG , BYREF lpString AS ASCIIZ , BYVAL chCount AS LONG , BYVAL nTabPositions AS LONG , BYREF lpnTabStopPositions AS LONG , BYVAL nTabOrigin AS LONG ) AS LONG ' long
DECLARE FUNCTION TabbedTextOutW LIB "user32.dll" ALIAS "TabbedTextOutW" ( BYVAL hdc AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG , BYREF lpString AS WSTRINGZ , BYVAL chCount AS LONG , BYVAL nTabPositions AS LONG , BYREF lpnTabStopPositions AS LONG , BYVAL nTabOrigin AS LONG ) AS LONG ' long
#IF %DEF(%UNICODE)
 MACRO TabbedTextOut = TabbedTextOutW
#ELSE
 MACRO TabbedTextOut = TabbedTextOutA
#ENDIF
DECLARE FUNCTION GetTabbedTextExtentA LIB "user32.dll" ALIAS "GetTabbedTextExtentA" ( BYVAL hdc AS QUAD , BYREF lpString AS ASCIIZ , BYVAL chCount AS LONG , BYVAL nTabPositions AS LONG , BYREF lpnTabStopPositions AS LONG ) AS QUAD
DECLARE FUNCTION GetTabbedTextExtentW LIB "user32.dll" ALIAS "GetTabbedTextExtentW" ( BYVAL hdc AS QUAD
 , BYREF lpString AS WSTRINGZ
 , BYVAL chCount AS LONG
 , BYVAL nTabPositions AS LONG
 , BYREF lpnTabStopPositions AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO GetTabbedTextExtent = GetTabbedTextExtentW
#ELSE
 MACRO GetTabbedTextExtent = GetTabbedTextExtentA
#ENDIF
DECLARE FUNCTION UpdateWindow LIB "user32.dll" ALIAS "UpdateWindow" ( BYVAL hWnd AS QUAD ) AS LONG
DECLARE FUNCTION SetActiveWindow LIB "user32.dll" ALIAS "SetActiveWindow" ( BYVAL hWnd AS QUAD
 ) AS DWORD
DECLARE FUNCTION GetForegroundWindow LIB "user32.dll" ALIAS "GetForegroundWindow" ( ) AS DWORD
'#if(WINVER >= 0x0400)
DECLARE FUNCTION PaintDesktop LIB "user32.dll" ALIAS "PaintDesktop" ( BYVAL hdc AS QUAD ) AS LONG
' Although you can access this function by using LoadLibrary and GetProcAddress
' combined in Microsoft Windows versions prior to Windows XP, the function is
' not accessible using the standard Include file and library linkage. The header
' files included in Windows XP Service Pack 1 (SP1) and Windows Server 2003
' document this function and make it accessible using the appropriate Include
' file and library linkage. However, this function is deprecated and not intended
' for general use. It is recommended that you do not use it in new programs
' because it might be altered or unavailable in subsequent versions of Windows.
DECLARE SUB SwitchToThisWindow LIB "user32.dll" ALIAS "SwitchToThisWindow" ( BYVAL hWnd AS QUAD , BYVAL fUnknown AS LONG )
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION SetForegroundWindow LIB "user32.dll" ALIAS "SetForegroundWindow" ( BYVAL hWnd AS QUAD ) AS LONG
'#if(_WIN32_WINNT >= 0x0500)
DECLARE FUNCTION AllowSetForegroundWindow LIB "user32.dll" ALIAS "AllowSetForegroundWindow" ( BYVAL dwProcessId AS QUAD ) AS LONG
%EQUATE `ASFW_ANY = &HFFFFFFFF ' ((DWORD)-1)
DECLARE FUNCTION LockSetForegroundWindow LIB "user32.dll" ALIAS "LockSetForegroundWindow" ( BYVAL uLockCode AS QUAD ) AS LONG
%EQUATE `LSFW_LOCK = 1
%EQUATE `LSFW_UNLOCK = 2
'#endif /* _WIN32_WINNT >= 0x0500 */
DECLARE FUNCTION WindowFromDC LIB "user32.dll" ALIAS "WindowFromDC" ( BYVAL hDC AS QUAD ) AS QUAD
DECLARE FUNCTION GetDC LIB "user32.dll" ALIAS "GetDC" ( OPTIONAL BYVAL hWnd AS QUAD
 ) AS DWORD ' HDC
DECLARE FUNCTION GetDCEx LIB "user32.dll" ALIAS "GetDCEx" ( BYVAL hWnd AS QUAD , BYVAL hrgnClip AS QUAD , BYVAL flags AS QUAD ) AS QUAD ' HDC
'/*
' * GetDCEx() flags
' */
%EQUATE `DCX_WINDOW = &H00000001
%EQUATE `DCX_CACHE = &H00000002
%EQUATE `DCX_NORESETATTRS = &H00000004
%EQUATE `DCX_CLIPCHILDREN = &H00000008
%EQUATE `DCX_CLIPSIBLINGS = &H00000010
%EQUATE `DCX_PARENTCLIP = &H00000020
%EQUATE `DCX_EXCLUDERGN = &H00000040
%EQUATE `DCX_INTERSECTRGN = &H00000080
%EQUATE `DCX_EXCLUDEUPDATE = &H00000100
%EQUATE `DCX_INTERSECTUPDATE = &H00000200
%EQUATE `DCX_LOCKWINDOWUPDATE = &H00000400
%EQUATE `DCX_VALIDATE = &H00200000
DECLARE FUNCTION GetWindowDC LIB "user32.dll" ALIAS "GetWindowDC" ( OPTIONAL BYVAL hWnd AS QUAD ) AS QUAD ' HDC
DECLARE FUNCTION ReleaseDC LIB "user32.dll" ALIAS "ReleaseDC" ( BYVAL hWnd AS QUAD , BYVAL hDC AS QUAD ) AS LONG ' int
DECLARE FUNCTION BeginPaint LIB "user32.dll" ALIAS "BeginPaint" ( BYVAL hWnd AS QUAD , BYREF lpPaint AS PAINTSTRUCT ) AS QUAD ' HDC
DECLARE FUNCTION EndPaint LIB "user32.dll" ALIAS "EndPaint" ( BYVAL hWnd AS QUAD , BYREF lpPaint AS PAINTSTRUCT ) AS LONG
DECLARE FUNCTION GetUpdateRect LIB "user32.dll" ALIAS "GetUpdateRect" ( BYVAL hWnd AS QUAD
 , BYREF lpRect AS RECT
 , BYVAL bErase AS LONG
 ) AS LONG
DECLARE FUNCTION GetUpdateRgn LIB "user32.dll" ALIAS "GetUpdateRgn" ( BYVAL hWnd AS DWORD
 , BYVAL hRgn AS DWORD
 , BYVAL bErase AS LONG
 ) AS LONG ' int
DECLARE FUNCTION SetWindowRgn LIB "user32.dll" ALIAS "SetWindowRgn" ( BYVAL hWnd AS QUAD , BYVAL hRgn AS QUAD , BYVAL bRedraw AS LONG ) AS LONG ' int
DECLARE FUNCTION GetWindowRgn LIB "user32.dll" ALIAS "GetWindowRgn" ( BYVAL hWnd AS QUAD , BYVAL hRgn AS QUAD ) AS LONG ' int
'#if(_WIN32_WINNT >= 0x0501)
DECLARE FUNCTION GetWindowRgnBox LIB "user32.dll" ALIAS "GetWindowRgnBox" ( BYVAL hWnd AS QUAD , BYREF lprc AS RECT ) AS LONG ' int
'#endif /* _WIN32_WINNT >= 0x0501 */
DECLARE FUNCTION ExcludeUpdateRgn LIB "user32.dll" ALIAS "ExcludeUpdateRgn" ( BYVAL hDC AS QUAD , BYVAL hWnd AS QUAD ) AS LONG ' int
DECLARE FUNCTION InvalidateRect LIB "user32.dll" ALIAS "InvalidateRect" ( BYVAL hWnd AS QUAD , BYREF lpRect AS RECT , BYVAL bErase AS LONG ) AS LONG
DECLARE FUNCTION ValidateRect LIB "user32.dll" ALIAS "ValidateRect" ( OPTIONAL BYVAL hWnd AS QUAD
 , OPTIONAL BYREF lpRect AS RECT
 ) AS LONG
DECLARE FUNCTION InvalidateRgn LIB "user32.dll" ALIAS "InvalidateRgn" ( BYVAL hWnd AS DWORD
 , BYVAL hRgn AS DWORD
 , BYVAL bErase AS LONG
 ) AS LONG
DECLARE FUNCTION ValidateRgn LIB "user32.dll" ALIAS "ValidateRgn" ( BYVAL hWnd AS DWORD
 , OPTIONAL BYVAL hRgn AS DWORD
 ) AS LONG
DECLARE FUNCTION RedrawWindow LIB "user32.dll" ALIAS "RedrawWindow" ( BYVAL hWnd AS DWORD
 , BYREF lprcUpdate AS RECT
 , BYVAL hrgnUpdate AS DWORD
 , BYVAL Flags AS DWORD
 ) AS LONG
'/*
' * RedrawWindow() flags
' */
%EQUATE `RDW_INVALIDATE = &H0001
%EQUATE `RDW_INTERNALPAINT = &H0002
%EQUATE `RDW_ERASE = &H0004
%EQUATE `RDW_VALIDATE = &H0008
%EQUATE `RDW_NOINTERNALPAINT = &H0010
%EQUATE `RDW_NOERASE = &H0020
%EQUATE `RDW_NOCHILDREN = &H0040
%EQUATE `RDW_ALLCHILDREN = &H0080
%EQUATE `RDW_UPDATENOW = &H0100
%EQUATE `RDW_ERASENOW = &H0200
%EQUATE `RDW_FRAME = &H0400
%EQUATE `RDW_NOFRAME = &H0800
'/*
' * LockWindowUpdate API
' */
DECLARE FUNCTION LockWindowUpdate LIB "user32.dll" ALIAS "LockWindowUpdate" ( OPTIONAL BYVAL hWndLock AS QUAD ) AS LONG
DECLARE FUNCTION ScrollWindow LIB "user32.dll" ALIAS "ScrollWindow" ( BYVAL hWnd AS QUAD
 , BYVAL XAmount AS LONG
 , BYVAL YAmount AS LONG
 , OPTIONAL BYREF lpRect AS RECT
 , OPTIONAL BYREF lpClipRect AS RECT
 ) AS LONG
DECLARE FUNCTION ScrollDC LIB "user32.dll" ALIAS "ScrollDC" ( BYVAL hDC AS DWORD
 , BYVAL dx AS LONG
 , BYVAL dy AS LONG
 , OPTIONAL BYREF lprcScroll AS RECT
 , OPTIONAL BYREF lprcClip AS RECT
 , OPTIONAL BYVAL hrgnUpdate AS DWORD
 , OPTIONAL BYREF lprcUpdate AS RECT
 ) AS LONG
DECLARE FUNCTION ScrollWindowEx LIB "user32.dll" ALIAS "ScrollWindowEx" ( BYVAL hWnd AS DWORD
 , BYVAL dx AS LONG
 , BYVAL dy AS LONG
 , BYREF prcScroll AS RECT
 , BYREF prcClip AS RECT
 , BYVAL hrgnUpdate AS DWORD
 , BYREF prcUpdate AS RECT
 , BYVAL Flags AS DWORD
 ) AS LONG ' int
%EQUATE `SW_SCROLLCHILDREN = &H0001 ' /* Scroll children within *lprcScroll. */
%EQUATE `SW_INVALIDATE = &H0002 ' /* Invalidate after scrolling */
%EQUATE `SW_ERASE = &H0004 ' /* If SW_INVALIDATE, don't send WM_ERASEBACKGROUND */
'#if(WINVER >= 0x0500)
%EQUATE `SW_SMOOTHSCROLL = &H0010 ' /* Use smooth scrolling */
'#endif /* WINVER >= 0x0500 */
'#IF NOT %DEF(%NOSCROLL) ' -----------------------------------------------------
'#ifndef NOSCROLL
DECLARE FUNCTION SetScrollPos LIB "user32.dll" ALIAS "SetScrollPos" ( BYVAL hWnd AS QUAD , BYVAL nBar AS LONG , BYVAL nPos AS LONG , BYVAL bRedraw AS LONG ) AS LONG ' int
DECLARE FUNCTION GetScrollPos LIB "user32.dll" ALIAS "GetScrollPos" ( BYVAL hWnd AS QUAD , BYVAL nBar AS LONG ) AS LONG ' int
DECLARE FUNCTION SetScrollRange LIB "user32.dll" ALIAS "SetScrollRange" ( BYVAL hWnd AS QUAD , BYVAL nBar AS LONG , BYVAL nMinPos AS LONG , BYVAL nMaxPos AS LONG , BYVAL bRedraw AS LONG ) AS LONG
DECLARE FUNCTION GetScrollRange LIB "user32.dll" ALIAS "GetScrollRange" ( BYVAL hWnd AS QUAD
 , BYVAL nBar AS LONG
 , BYREF lpMinPos AS LONG
 , BYREF lpMaxPos AS LONG
 ) AS LONG
DECLARE FUNCTION ShowScrollBar LIB "user32.dll" ALIAS "ShowScrollBar" ( BYVAL hWnd AS DWORD
 , BYVAL wBar AS LONG
 , BYVAL bShow AS LONG
 ) AS LONG
DECLARE FUNCTION EnableScrollBar LIB "user32.dll" ALIAS "EnableScrollBar" ( BYVAL hWnd AS DWORD
 , BYVAL wSBflags AS DWORD
 , BYVAL wArrows AS DWORD
 ) AS LONG
'/*
' * EnableScrollBar() flags
' */
%EQUATE `ESB_ENABLE_BOTH = &H0000
%EQUATE `ESB_DISABLE_BOTH = &H0003
%EQUATE `ESB_DISABLE_LEFT = &H0001
%EQUATE `ESB_DISABLE_RIGHT = &H0002
%EQUATE `ESB_DISABLE_UP = &H0001
%EQUATE `ESB_DISABLE_DOWN = &H0002
%EQUATE `ESB_DISABLE_LTUP = %ESB_DISABLE_LEFT
%EQUATE `ESB_DISABLE_RTDN = %ESB_DISABLE_RIGHT
'#endif /* !NOSCROLL */
'#ENDIF ' #IF NOT %DEF(%NOSCROLL) ' ------------------------------------------
DECLARE FUNCTION SetPropA LIB "user32.dll" ALIAS "SetPropA" ( BYVAL hWnd AS QUAD , BYREF lpString AS ASCIIZ , OPTIONAL BYVAL hData AS QUAD ) AS LONG
DECLARE FUNCTION SetPropW LIB "user32.dll" ALIAS "SetPropW" ( BYVAL hWnd AS QUAD
 , BYREF lpString AS WSTRINGZ
 , OPTIONAL BYVAL hData AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SetProp = SetPropW
#ELSE
 MACRO SetProp = SetPropA
#ENDIF
DECLARE FUNCTION GetPropA LIB "user32.dll" ALIAS "GetPropA" ( BYVAL hWnd AS QUAD , BYREF lpString AS ASCIIZ ) AS QUAD
DECLARE FUNCTION GetPropW LIB "user32.dll" ALIAS "GetPropW" ( BYVAL hWnd AS QUAD
 , BYREF lpString AS WSTRINGZ
 ) AS DWORD
' // Not a macro because GetPropW conflicts with the GetPropW method of the IMimeMessageW interface.
#IF %DEF(%UNICODE)
DECLARE FUNCTION GetProp LIB "user32.dll" ALIAS "GetPropW" ( BYVAL hWnd AS QUAD , BYREF lpString AS WSTRINGZ ) AS QUAD
#ELSE
DECLARE FUNCTION GetProp LIB "user32.dll" ALIAS "GetPropA" ( BYVAL hWnd AS QUAD , BYREF lpString AS ASCIIZ ) AS QUAD
#ENDIF
DECLARE FUNCTION RemovePropA LIB "user32.dll" ALIAS "RemovePropA" ( BYVAL hWnd AS QUAD , BYREF lpString AS ASCIIZ ) AS QUAD
DECLARE FUNCTION RemovePropW LIB "user32.dll" ALIAS "RemovePropW" ( BYVAL hWnd AS QUAD
 , BYREF lpString AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO RemoveProp = RemovePropW
#ELSE
 MACRO RemoveProp = RemovePropA
#ENDIF
DECLARE FUNCTION EnumPropsExA LIB "user32.dll" ALIAS "EnumPropsExA" ( BYVAL hWnd AS QUAD , BYVAL lpEnumFunc AS QUAD , BYVAL lParam AS LONG ) AS LONG ' int
DECLARE FUNCTION EnumPropsExW LIB "user32.dll" ALIAS "EnumPropsExW" ( BYVAL hWnd AS QUAD , BYVAL lpEnumFunc AS QUAD , BYVAL lParam AS LONG ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO EnumPropsEx = EnumPropsExW
#ELSE
 MACRO EnumPropsEx = EnumPropsExA
#ENDIF
DECLARE FUNCTION EnumPropsA LIB "user32.dll" ALIAS "EnumPropsA" ( BYVAL hWnd AS QUAD , BYVAL lpEnumFunc AS QUAD ) AS LONG ' int
DECLARE FUNCTION EnumPropsW LIB "user32.dll" ALIAS "EnumPropsW" ( BYVAL hWnd AS QUAD , BYVAL lpEnumFunc AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO EnumProps = EnumPropsW
#ELSE
 MACRO EnumProps = EnumPropsA
#ENDIF
DECLARE FUNCTION SetWindowTextA LIB "user32.dll" ALIAS "SetWindowTextA" ( BYVAL hWnd AS QUAD , OPTIONAL BYREF lpString AS ASCIIZ ) AS LONG
DECLARE FUNCTION SetWindowTextW LIB "user32.dll" ALIAS "SetWindowTextW" ( BYVAL hWnd AS QUAD
 , OPTIONAL BYREF lpString AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SetWindowText = SetWindowTextW
#ELSE
 MACRO SetWindowText = SetWindowTextA
#ENDIF
DECLARE FUNCTION GetWindowTextA LIB "user32.dll" ALIAS "GetWindowTextA" ( BYVAL hWnd AS QUAD , BYREF lpString AS ASCIIZ , BYVAL nMaxCount AS LONG ) AS LONG ' int
DECLARE FUNCTION GetWindowTextW LIB "user32.dll" ALIAS "GetWindowTextW" ( BYVAL hWnd AS QUAD , BYREF lpString AS WSTRINGZ , BYVAL nMaxCount AS LONG ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO GetWindowText = GetWindowTextW
#ELSE
 MACRO GetWindowText = GetWindowTextA
#ENDIF
DECLARE FUNCTION GetWindowTextLengthA LIB "user32.dll" ALIAS "GetWindowTextLengthA" ( BYVAL hWnd AS QUAD ) AS LONG ' int
DECLARE FUNCTION GetWindowTextLengthW LIB "user32.dll" ALIAS "GetWindowTextLengthW" ( BYVAL hWnd AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO GetWindowTextLength = GetWindowTextLengthW
#ELSE
 MACRO GetWindowTextLength = GetWindowTextLengthA
#ENDIF
DECLARE FUNCTION GetClientRect LIB "user32.dll" ALIAS "GetClientRect" ( BYVAL hWnd AS QUAD , BYREF lpRect AS RECT ) AS LONG
DECLARE FUNCTION GetWindowRect LIB "user32.dll" ALIAS "GetWindowRect" ( BYVAL hWnd AS QUAD
 , BYREF lpRect AS RECT
 ) AS LONG
DECLARE FUNCTION AdjustWindowRect LIB "user32.dll" ALIAS "AdjustWindowRect" ( BYREF lpRect AS RECT
 , BYVAL dwStyle AS DWORD
 , BYVAL bMenu AS LONG
 ) AS LONG
DECLARE FUNCTION AdjustWindowRectEx LIB "user32.dll" ALIAS "AdjustWindowRectEx" ( BYREF lpRect AS RECT
 , BYVAL dwStyle AS DWORD
 , BYVAL bMenu AS LONG
 , BYVAL dwExStyle AS DWORD
 ) AS LONG
'#if(WINVER >= 0x0400)
%EQUATE `HELPINFO_WINDOW = &H0001&
%EQUATE `HELPINFO_MENUITEM = &H0002&
' // Size = 28 bytes
TYPE HELPINFO DWORD
 cbSize AS DWORD ' UINT /* Size in bytes of this struct */
 iContextType AS LONG ' int /* Either HELPINFO_WINDOW or HELPINFO_MENUITEM */
 iCtrlId AS LONG ' int /* Control Id or a Menu item Id. */
 hItemHandle AS DWORD ' HANDLE /* hWnd of control or hMenu. */
 dwContextId AS DWORD ' DWORD_PTR /* Context Id associated with this item */
 MousePos AS POINT ' POINT /* Mouse Position in screen co-ordinates */
END TYPE
DECLARE FUNCTION SetWindowContextHelpId LIB "user32.dll" ALIAS "SetWindowContextHelpId" ( BYVAL hwnd AS QUAD , BYVAL dwContextHelpId AS QUAD ) AS LONG
DECLARE FUNCTION GetWindowContextHelpId LIB "user32.dll" ALIAS "GetWindowContextHelpId" ( BYVAL hwnd AS QUAD
 ) AS DWORD
DECLARE FUNCTION SetMenuContextHelpId LIB "user32.dll" ALIAS "SetMenuContextHelpId" ( BYVAL hmenu AS DWORD
 , BYVAL dwContextHelpId AS DWORD
 ) AS LONG
DECLARE FUNCTION GetMenuContextHelpId LIB "user32.dll" ALIAS "GetMenuContextHelpId" ( BYVAL hmenu AS DWORD
 ) AS DWORD
'#endif /* WINVER >= 0x0400 */
'#IF NOT %DEF(%NOMB) ' ---------------------------------------------------------
'#ifndef NOMB
'/*
' * MessageBox() Flags
' */
'%MB_OK = &H00000000
'%MB_OKCANCEL = &H00000001
'%MB_ABORTRETRYIGNORE = &H00000002
'%MB_YESNOCANCEL = &H00000003
'%MB_YESNO = &H00000004
'%MB_RETRYCANCEL = &H00000005
'#if(WINVER >= 0x0500)
'%MB_CANCELTRYCONTINUE = &H00000006
'#endif /* WINVER >= 0x0500 */
'%MB_ICONHAND = &H00000010
'%MB_ICONQUESTION = &H00000020
'%MB_ICONEXCLAMATION = &H00000030
'%MB_ICONASTERISK = &H00000040
'#if(WINVER >= 0x0400)
'%MB_USERICON = &H00000080
'%MB_ICONWARNING = %MB_ICONEXCLAMATION
'%MB_ICONERROR = %MB_ICONHAND
'#endif /* WINVER >= 0x0400 */
'%MB_ICONINFORMATION = %MB_ICONASTERISK
'%MB_ICONSTOP = %MB_ICONHAND
'%MB_DEFBUTTON1 = &H00000000
'%MB_DEFBUTTON2 = &H00000100
'%MB_DEFBUTTON3 = &H00000200
'#if(WINVER >= 0x0400)
'%MB_DEFBUTTON4 = &H00000300
'#endif /* WINVER >= 0x0400 */
'%MB_APPLMODAL = &H00000000
'%MB_SYSTEMMODAL = &H00001000
'%MB_TASKMODAL = &H00002000
'#if(WINVER >= 0x0400)
'%MB_HELP = &H00004000 ' Help Button
'#endif /* WINVER >= 0x0400 */
'%MB_NOFOCUS = &H00008000
'%MB_SETFOREGROUND = &H00010000
'%MB_DEFAULT_DESKTOP_ONLY = &H00020000
'%MB_TOPMOST = &H00040000
'%MB_RIGHT = &H00080000
'%MB_RTLREADING = &H00100000
'#endif /* WINVER >= 0x0400 */
'#ifdef _WIN32_WINNT
'#if (_WIN32_WINNT >= 0x0400)
'#define MB_SERVICE_NOTIFICATION 0x00200000L
'#else
'#define MB_SERVICE_NOTIFICATION 0x00040000L
'#endif
'#define MB_SERVICE_NOTIFICATION_NT3X 0x00040000L
'#endif
'%MB_SERVICE_NOTIFICATION = &H00200000
'%MB_SERVICE_NOTIFICATION_NT3X = &H00040000
'%MB_TYPEMASK = &H0000000F
'%MB_ICONMASK = &H000000F0
'%MB_DEFMASK = &H00000F00
'%MB_MODEMASK = &H00003000
'%MB_MISCMASK = &H0000C000
DECLARE FUNCTION MessageBoxA LIB "user32.dll" ALIAS "MessageBoxA" ( BYVAL hWnd AS QUAD , BYREF lpText AS ASCIIZ , BYREF lpCaption AS ASCIIZ , BYVAL uType AS QUAD ) AS LONG ' int
DECLARE FUNCTION MessageBoxW LIB "user32.dll" ALIAS "MessageBoxW" ( BYVAL hWnd AS QUAD , BYREF lpText AS WSTRINGZ , BYREF lpCaption AS WSTRINGZ , BYVAL uType AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO MessageBox = MessageBoxW
#ELSE
 MACRO MessageBox = MessageBoxA
#ENDIF
DECLARE FUNCTION MessageBoxExA LIB "user32.dll" ALIAS "MessageBoxExA" ( BYVAL hWnd AS QUAD , BYREF lpText AS ASCIIZ , BYREF lpCaption AS ASCIIZ , BYVAL uType AS QUAD , BYVAL wLanguageId AS WORD ) AS LONG ' int
DECLARE FUNCTION MessageBoxExW LIB "user32.dll" ALIAS "MessageBoxExW" ( BYVAL hWnd AS QUAD , BYREF lpText AS WSTRINGZ , BYREF lpCaption AS WSTRINGZ , BYVAL uType AS QUAD , BYVAL wLanguageId AS WORD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO MessageBoxEx = MessageBoxExW
#ELSE
 MACRO MessageBoxEx = MessageBoxExA
#ENDIF
' Undocumented
DECLARE FUNCTION MessageBoxTimeoutA LIB "user32.dll" ALIAS "MessageBoxTimeoutA" ( BYVAL hWnd AS QUAD , BYREF lpText AS ASCIIZ , BYREF lpCaption AS ASCIIZ , BYVAL uType AS QUAD , BYVAL wLanguageId AS WORD , BYVAL dwMilliseconds AS QUAD ) AS LONG ' int
' Undocumented
DECLARE FUNCTION MessageBoxTimeoutW LIB "user32.dll" ALIAS "MessageBoxTimeoutW" ( BYVAL hWnd AS QUAD , BYREF lpText AS WSTRINGZ , BYREF lpCaption AS WSTRINGZ , BYVAL uType AS QUAD , BYVAL wLanguageId AS WORD , BYVAL dwMilliseconds AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO MessageBoxTimeout = MessageBoxTimeoutW
#ELSE
 MACRO MessageBoxTimeout = MessageBoxTimeoutA
#ENDIF
'#if(WINVER >= 0x0400)
'typedef VOID (CALLBACK *MSGBOXCALLBACK)(LPHELPINFO lpHelpInfo);
' // Size = 40 bytes
TYPE MSGBOXPARAMSA DWORD
 cbSize AS DWORD ' UINT
 hWndOwner AS DWORD
 hInstance AS DWORD ' HINSTANCE
 lpszText AS ASCIIZ PTR
 lpszCaption AS ASCIIZ PTR
 dwStyle AS DWORD
 lpszIcon AS ASCIIZ PTR
 dwContextHelpId AS DWORD ' DWORD_PTR
 lpfnMsgBoxCallback AS LONG ' MSGBOXCALLBACK
 dwLanguageId AS DWORD
END TYPE
' // Size = 40 bytes
TYPE MSGBOXPARAMSW DWORD
 cbSize AS DWORD ' UINT
 hWndOwner AS DWORD
 hInstance AS DWORD ' HINSTANCE
 lpszText AS WSTRINGZ PTR
 lpszCaption AS WSTRINGZ PTR
 dwStyle AS DWORD
 lpszIcon AS WSTRINGZ PTR
 dwContextHelpId AS DWORD ' DWORD_PTR
 lpfnMsgBoxCallback AS LONG ' MSGBOXCALLBACK
 dwLanguageId AS DWORD
END TYPE
#IF %DEF(%UNICODE)
MACRO MSGBOXPARAMS = MSGBOXPARAMSW
#ELSE
MACRO MSGBOXPARAMS = MSGBOXPARAMSA
#ENDIF
DECLARE FUNCTION MessageBoxIndirectA LIB "user32.dll" ALIAS "MessageBoxIndirectA" ( BYREF lpmbp AS MSGBOXPARAMSA ) AS LONG ' int
DECLARE FUNCTION MessageBoxIndirectW LIB "user32.dll" ALIAS "MessageBoxIndirectW" ( BYREF lpmbp AS MSGBOXPARAMSW ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO MessageBoxIndirect = MessageBoxIndirectW
#ELSE
 MACRO MessageBoxIndirect = MessageBoxIndirectA
#ENDIF
DECLARE FUNCTION MessageBeep LIB "user32.dll" ALIAS "MessageBeep" ( BYVAL uType AS QUAD ) AS LONG
'#endif /* !NOMB */
'#ENDIF ' #IF NOT %DEF(%NOMB) ' ----------------------------------------------
DECLARE FUNCTION ShowCursor LIB "user32.dll" ALIAS "ShowCursor" ( OPTIONAL BYVAL bShow AS LONG ) AS LONG ' int
DECLARE FUNCTION SetCursorPos LIB "user32.dll" ALIAS "SetCursorPos" ( BYVAL X As LONG , BYVAL Y AS LONG ) AS LONG
'#if(WINVER >= 0x0600)
DECLARE FUNCTION SetPhysicalCursorPos LIB "user32.dll" ALIAS "SetPhysicalCursorPos" ( BYVAL X AS LONG , BYVAL Y AS LONG ) AS LONG
'#endif /* WINVER >= 0x0600 */
DECLARE FUNCTION SetCursor LIB "user32.dll" ALIAS "SetCursor" ( OPTIONAL BYVAL hCursor AS QUAD ) AS QUAD ' HCURSOR
DECLARE FUNCTION GetCursorPos LIB "user32.dll" ALIAS "GetCursorPos" ( BYREF lpPoint AS POINT ) AS LONG
'#if(WINVER >= 0x0600)
DECLARE FUNCTION GetPhysicalCursorPos LIB "user32.dll" ALIAS "GetPhysicalCursorPos" ( BYREF lpPoint AS POINT ) AS LONG
'#endif /* WINVER >= 0x0600 */
DECLARE FUNCTION ClipCursor LIB "user32.dll" ALIAS "ClipCursor" ( OPTIONAL BYREF lpRect AS RECT ) AS LONG
DECLARE FUNCTION GetClipCursor LIB "user32.dll" ALIAS "GetClipCursor" ( BYREF lpRect AS RECT
 ) AS LONG
DECLARE FUNCTION GetCursor LIB "user32.dll" ALIAS "GetCursor" ( ) AS DWORD ' HCURSOR
DECLARE FUNCTION CreateCaret LIB "user32.dll" ALIAS "CreateCaret" ( BYVAL hWnd AS QUAD , BYVAL hBitmap AS QUAD , BYVAL nWidth AS LONG , BYVAL nHeight AS LONG ) AS LONG
DECLARE FUNCTION GetCaretBlinkTime LIB "user32.dll" ALIAS "GetCaretBlinkTime" ( ) AS QUAD ' UINT
DECLARE FUNCTION SetCaretBlinkTime LIB "user32.dll" ALIAS "SetCaretBlinkTime" ( BYVAL uMSeconds AS QUAD ) AS LONG
DECLARE FUNCTION DestroyCaret LIB "user32.dll" ALIAS "DestroyCaret" ( ) AS LONG
DECLARE FUNCTION HideCaret LIB "user32.dll" ALIAS "HideCaret" ( OPTIONAL BYVAL hWnd AS QUAD
 ) AS LONG
DECLARE FUNCTION ShowCaret LIB "user32.dll" ALIAS "ShowCaret" ( OPTIONAL BYVAL hWnd AS DWORD
 ) AS LONG
DECLARE FUNCTION SetCaretPos LIB "user32.dll" ALIAS "SetCaretPos" ( BYVAL X AS LONG
 , BYVAL Y AS LONG
 ) AS LONG
DECLARE FUNCTION GetCaretPos LIB "user32.dll" ALIAS "GetCaretPos" ( BYREF lpPoint AS POINT
 ) AS LONG
DECLARE FUNCTION ClientToScreen LIB "user32.dll" ALIAS "ClientToScreen" ( BYVAL hWnd AS DWORD
 , BYREF lpPoint AS POINT
 ) AS LONG
DECLARE FUNCTION ScreenToClient LIB "user32.dll" ALIAS "ScreenToClient" ( BYVAL hWnd AS DWORD
 , BYREF lpPoint AS POINT
 ) AS LONG
'#if(WINVER >= 0x0600)
DECLARE FUNCTION LogicalToPhysicalPoint LIB "user32.dll" ALIAS "LogicalToPhysicalPoint" ( BYVAL hWnd AS QUAD , BYREF lpPoint AS POINT ) AS LONG
DECLARE FUNCTION PhysicalToLogicalPoint LIB "user32.dll" ALIAS "PhysicalToLogicalPoint" ( BYVAL hWnd AS QUAD
 , BYREF lpPoint AS POINT
 ) AS LONG
'#endif /* WINVER >= 0x0600 */
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION MapWindowPoints LIB "User32.dll" ALIAS "MapWindowPoints" (BYVAL hWndFrom AS QUAD, BYVAL hWndTo AS QUAD, BYVAL lppt AS POINT PTR, BYVAL cPoints AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION MapWindowPoints LIB "user32.dll" ALIAS "MapWindowPoints" ( BYVAL hWndFrom AS QUAD , BYVAL hWndTo AS QUAD , BYREF lpPoints AS ANY , BYVAL cPoints AS QUAD ) AS LONG ' int
#ENDIF
DECLARE FUNCTION WindowFromPoint LIB "user32.dll" ALIAS "WindowFromPoint" ( BYVAL Point AS POINT ) AS QUAD
' // Same as above, but using x, y coordinates
DECLARE FUNCTION WindowFromXY LIB "user32.dll" ALIAS "WindowFromPoint" ( BYVAL x AS LONG , BYVAL y AS LONG ) AS QUAD
'#if(WINVER >= 0x0600)
DECLARE FUNCTION WindowFromPhysicalPoint LIB "user32.dll" ALIAS "WindowFromPhysicalPoint" ( BYVAL Point AS POINT ) AS QUAD
'#endif /* WINVER >= 0x0600 */
DECLARE FUNCTION ChildWindowFromPoint LIB "user32.dll" ALIAS "ChildWindowFromPoint" ( BYVAL hwndParent AS QUAD , BYVAL Point AS POINT ) AS QUAD
' Same as above, but using x, y coordinates
DECLARE FUNCTION ChildWindowFromXY LIB "user32.dll" ALIAS "ChildWindowFromPoint" ( BYVAL hwndParent AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG ) AS QUAD
'#if(WINVER >= 0x0400)
%EQUATE `CWP_ALL = &H0000
%EQUATE `CWP_SKIPINVISIBLE = &H0001
%EQUATE `CWP_SKIPDISABLED = &H0002
%EQUATE `CWP_SKIPTRANSPARENT = &H0004
DECLARE FUNCTION ChildWindowFromPointEx LIB "user32.dll" ALIAS "ChildWindowFromPointEx" ( BYVAL hWnd AS QUAD , BYVAL pt AS POINT , BYVAL Flags AS QUAD ) AS QUAD
' Same as above, but using x, y coordinates
DECLARE FUNCTION ChildWindowFromXYEx LIB "user32.dll" ALIAS "ChildWindowFromPointEx" ( BYVAL hWnd AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG , BYVAL Flags AS QUAD ) AS QUAD
'#endif /* WINVER >= 0x0400 */
'#IF NOT %DEF(%NOCOLOR) ' ------------------------------------------------------
'#ifndef NOCOLOR
'/*
' * Color Types
' */
%EQUATE `CTLCOLOR_MSGBOX = 0&
%EQUATE `CTLCOLOR_EDIT = 1&
%EQUATE `CTLCOLOR_LISTBOX = 2&
%EQUATE `CTLCOLOR_BTN = 3&
%EQUATE `CTLCOLOR_DLG = 4&
%EQUATE `CTLCOLOR_SCROLLBAR = 5&
%EQUATE `CTLCOLOR_STATIC = 6&
%EQUATE `CTLCOLOR_MAX = 7&
%EQUATE `COLOR_SCROLLBAR = 0&
%EQUATE `COLOR_BACKGROUND = 1&
%EQUATE `COLOR_ACTIVECAPTION = 2&
%EQUATE `COLOR_INACTIVECAPTION = 3&
%EQUATE `COLOR_MENU = 4&
%EQUATE `COLOR_MSGBOX = 4&
%EQUATE `COLOR_WINDOW = 5&
%EQUATE `COLOR_WINDOWFRAME = 6&
%EQUATE `COLOR_MENUTEXT = 7&
%EQUATE `COLOR_MSGBOXTEXT = 7&
%EQUATE `COLOR_WINDOWTEXT = 8&
%EQUATE `COLOR_CAPTIONTEXT = 9&
%EQUATE `COLOR_ACTIVEBORDER = 10&
%EQUATE `COLOR_INACTIVEBORDER = 11&
%EQUATE `COLOR_APPWORKSPACE = 12&
%EQUATE `COLOR_HIGHLIGHT = 13&
%EQUATE `COLOR_HIGHLIGHTTEXT = 14&
%EQUATE `COLOR_BTNFACE = 15&
%EQUATE `COLOR_BTNSHADOW = 16&
%EQUATE `COLOR_GRAYTEXT = 17&
%EQUATE `COLOR_BTNTEXT = 18&
%EQUATE `COLOR_INACTIVECAPTIONTEXT = 19&
%EQUATE `COLOR_BTNHIGHLIGHT = 20&
'#if(WINVER >= 0x0400)
%EQUATE `COLOR_3DDKSHADOW = 21&
%EQUATE `COLOR_3DLIGHT = 22&
%EQUATE `COLOR_INFOTEXT = 23&
%EQUATE `COLOR_INFOBK = 24&
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
%EQUATE `COLOR_HOTLIGHT = 26&
%EQUATE `COLOR_GRADIENTACTIVECAPTION = 27&
%EQUATE `COLOR_GRADIENTINACTIVECAPTION = 28&
'#if(WINVER >= 0x0501)
%EQUATE `COLOR_MENUHILIGHT = 29&
%EQUATE `COLOR_MENUBAR = 30&
'#endif /* WINVER >= 0x0501 */
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0400)
%EQUATE `COLOR_DESKTOP = %COLOR_BACKGROUND
%EQUATE `COLOR_3DFACE = %COLOR_BTNFACE
%EQUATE `COLOR_3DSHADOW = %COLOR_BTNSHADOW
%EQUATE `COLOR_3DHIGHLIGHT = %COLOR_BTNHIGHLIGHT
%EQUATE `COLOR_3DHILIGHT = %COLOR_BTNHIGHLIGHT
%EQUATE `COLOR_BTNHILIGHT = %COLOR_BTNHIGHLIGHT
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION GetSysColor LIB "user32.dll" ALIAS "GetSysColor" ( BYVAL nIndex AS LONG ) AS QUAD
'#if(WINVER >= 0x0400)
DECLARE FUNCTION GetSysColorBrush LIB "user32.dll" ALIAS "GetSysColorBrush" ( BYVAL nIndex AS LONG ) AS QUAD ' HBRUSH
'#endif /* WINVER >= 0x0400 */
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetSysColors LIB "User32.dll" ALIAS "SetSysColors" (BYVAL nChanges AS LONG, BYVAL lpSysColor AS LONG PTR, BYVAL lpColorValues AS QUAD PTR) AS LONG
#ELSE
DECLARE FUNCTION SetSysColors LIB "user32.dll" ALIAS "SetSysColors" ( BYVAL cElements AS LONG , BYREF lpaElements AS LONG , BYREF lpaRgbValues AS QUAD ) AS LONG
#ENDIF
'#endif /* !NOCOLOR */
'#ENDIF ' #IF NOT %DEF(%NOCOLOR) ' -------------------------------------------
DECLARE FUNCTION DrawFocusRect LIB "user32.dll" ALIAS "DrawFocusRect" ( BYVAL hDC AS QUAD , BYREF lprc AS RECT ) AS LONG
DECLARE FUNCTION FillRect LIB "user32.dll" ALIAS "FillRect" ( BYVAL hDC AS QUAD
 , BYREF lprc AS RECT
 , BYVAL hbr AS DWORD
 ) AS LONG ' int
DECLARE FUNCTION FrameRect LIB "user32.dll" ALIAS "FrameRect" ( BYVAL hDC AS QUAD , BYREF lprc AS RECT , BYVAL hbr AS QUAD ) AS LONG ' int
DECLARE FUNCTION InvertRect LIB "user32.dll" ALIAS "InvertRect" ( BYVAL hDC AS QUAD , BYREF lprc AS RECT ) AS LONG
DECLARE FUNCTION SetRect LIB "user32.dll" ALIAS "SetRect" ( BYREF lprc AS RECT
 , BYVAL xLeft AS LONG
 , BYVAL yTop AS LONG
 , BYVAL xRight AS LONG
 , BYVAL yBottom AS LONG
 ) AS LONG
DECLARE FUNCTION SetRectEmpty LIB "user32.dll" ALIAS "SetRectEmpty" ( BYREF lprc AS RECT
 ) AS LONG
DECLARE FUNCTION CopyRect LIB "user32.dll" ALIAS "CopyRect" ( BYREF lprcDst AS RECT
 , BYREF lprcSrc AS RECT
 ) AS LONG
DECLARE FUNCTION InflateRect LIB "user32.dll" ALIAS "InflateRect" ( BYREF lprc AS RECT
 , BYVAL dx AS LONG
 , BYVAL dy AS LONG
 ) AS LONG
DECLARE FUNCTION IntersectRect LIB "user32.dll" ALIAS "IntersectRect" ( BYREF lprcDst AS RECT
 , BYREF lprcSrc1 AS RECT
 , BYREF lprcSrc2 AS RECT
 ) AS LONG
DECLARE FUNCTION UnionRect LIB "user32.dll" ALIAS "UnionRect" ( BYREF lprcDst AS RECT
 , BYREF lprcSrc1 AS RECT
 , BYREF lprcSrc2 AS RECT
 ) AS LONG
DECLARE FUNCTION SubtractRect LIB "user32.dll" ALIAS "SubtractRect" ( BYREF lprcDst AS RECT
 , BYREF lprcSrc1 AS RECT
 , BYREF lprcSrc2 AS RECT
 ) AS LONG
DECLARE FUNCTION OffsetRect LIB "user32.dll" ALIAS "OffsetRect" ( BYREF lprc AS RECT
 , BYVAL dx AS LONG
 , BYVAL dy AS LONG
 ) AS LONG
DECLARE FUNCTION IsRectEmpty LIB "user32.dll" ALIAS "IsRectEmpty" ( BYREF lprc AS RECT
 ) AS LONG
DECLARE FUNCTION EqualRect LIB "user32.dll" ALIAS "EqualRect" ( BYREF lprc1 AS RECT
 , BYREF lprc2 AS RECT
 ) AS LONG
DECLARE FUNCTION PtInRect LIB "user32.dll" ALIAS "PtInRect" ( BYREF lprc AS RECT
 , BYVAL pt AS POINT
 ) AS LONG
' Same as above, but using x, y coordinates
DECLARE FUNCTION PtInRectXY LIB "user32.dll" ALIAS "PtInRect" ( BYREF lprc AS RECT , BYVAL x AS LONG , BYVAL y AS LONG ) AS LONG
'#IF NOT %DEF(%NOWINOFFSETS) ' -------------------------------------------------
'#ifndef NOWINOFFSETS
DECLARE FUNCTION GetWindowWord LIB "user32.dll" ALIAS "GetWindowWord" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG ) AS WORD ' WORD
DECLARE FUNCTION SetWindowWord LIB "user32.dll" ALIAS "SetWindowWord" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG , BYVAL wNewWord AS WORD ) AS WORD ' WORD
DECLARE FUNCTION GetWindowLongA LIB "user32.dll" ALIAS "GetWindowLongA" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG ) AS LONG ' long
DECLARE FUNCTION GetWindowLongW LIB "user32.dll" ALIAS "GetWindowLongW" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG ) AS LONG ' long
#IF %DEF(%UNICODE)
 MACRO GetWindowLong = GetWindowLongW
#ELSE
 MACRO GetWindowLong = GetWindowLongA
#ENDIF
DECLARE FUNCTION SetWindowLongA LIB "user32.dll" ALIAS "SetWindowLongA" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG , BYVAL dwNewLong AS LONG ) AS LONG ' long
DECLARE FUNCTION SetWindowLongW LIB "user32.dll" ALIAS "SetWindowLongW" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG , BYVAL dwNewLong AS LONG ) AS LONG ' long
#IF %DEF(%UNICODE)
 MACRO SetWindowLong = SetWindowLongW
#ELSE
 MACRO SetWindowLong = SetWindowLongA
#ENDIF
'#ifdef _WIN64
'DECLARE FUNCTION GetWindowLongPtrA LIB "user32.dll" ALIAS "GetWindowLongPtrA" ( ' BYVAL hWnd AS QUAD
' , BYVAL nIndex AS LONG
' ) AS QUAD ' LONG_PTR
'DECLARE FUNCTION GetWindowLongPtrW LIB "user32.dll" ALIAS "GetWindowLongPtrW" ( ' BYVAL hWnd AS QUAD
' , BYVAL nIndex AS LONG
' ) AS QUAD ' LONG_PTR
'#IF %DEF(%UNICODE)
' MACRO GetWindowLongPtr = GetWindowLongPtrW
'#ELSE
' MACRO GetWindowLongPtr = GetWindowLongPtrA
'#ENDIF
'DECLARE FUNCTION SetWindowLongPtrA LIB "user32.dll" ALIAS "SetWindowLongPtrA" ( ' BYVAL hWnd AS QUAD
' , BYVAL nIndex AS LONG
' , BYVAL dwNewLong AS QUAD
' ) AS QUAD ' LONG_PTR
'DECLARE FUNCTION SetWindowLongPtrW LIB "user32.dll" ALIAS "SetWindowLongPtrW" ( ' BYVAL hWnd AS QUAD
' , BYVAL nIndex AS LONG
' , BYVAL dwNewLong AS QUAD
' ) AS QUAD ' LONG_PTR
'#IF %DEF(%UNICODE)
' MACRO SetWindowLongPtr = SetWindowLongPtrW
'#ELSE
' MACRO SetWindowLongPtr = SetWindowLongPtrA
'#ENDIF
'#endif /* _WIN64 */
DECLARE FUNCTION GetClassWord LIB "user32.dll" ALIAS "GetClassWord" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG ) AS WORD ' WORD
DECLARE FUNCTION SetClassWord LIB "user32.dll" ALIAS "SetClassWord" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG , BYVAL wNewWord AS WORD ) AS WORD ' WORD
DECLARE FUNCTION GetClassLongA LIB "user32.dll" ALIAS "GetClassLongA" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG ) AS QUAD
DECLARE FUNCTION GetClassLongW LIB "user32.dll" ALIAS "GetClassLongW" ( BYVAL hWnd AS QUAD
 , BYVAL nIndex AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO GetClassLong = GetClassLongW
#ELSE
 MACRO GetClassLong = GetClassLongA
#ENDIF
DECLARE FUNCTION SetClassLongA LIB "user32.dll" ALIAS "SetClassLongA" ( BYVAL hWnd AS QUAD , BYVAL nIndex AS LONG , BYVAL dwNewLong AS QUAD ) AS QUAD
DECLARE FUNCTION SetClassLongW LIB "user32.dll" ALIAS "SetClassLongW" ( BYVAL hWnd AS QUAD
 , BYVAL nIndex AS LONG
 , BYVAL dwNewLong AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO SetClassLong = SetClassLongW
#ELSE
 MACRO SetClassLong = SetClassLongA
#ENDIF
'#ifdef _WIN64
'DECLARE FUNCTION GetClassLongPtrA LIB "user32.dll" ALIAS "GetClassLongPtrA" ( ' BYVAL hWnd AS DWORD
' , BYVAL nIndex AS LONG
' ) AS DWORD ' ULONG_PTR
'DECLARE FUNCTION GetClassLongPtrW LIB "user32.dll" ALIAS "GetClassLongPtrW" ( ' BYVAL hWnd AS DWORD
' , BYVAL nIndex AS LONG
' ) AS DWORD ' ULONG_PTR
'#IF %DEF(%UNICODE)
' MACRO GetClassLongPtr = GetClassLongPtrW
'#ELSE
' MACRO GetClassLongPtr = GetClassLongPtrA
'#ENDIF
'DECLARE FUNCTION SetClassLongPtrA LIB "user32.dll" ALIAS "SetClassLongPtrA" ( ' BYVAL hWnd AS DWORD
' , BYVAL nIndex AS LONG
' , BYVAL dwNewLong AS LONG
' ) AS DWORD ' ULONG_PTR
'DECLARE FUNCTION SetClassLongPtrW LIB "user32.dll" ALIAS "SetClassLongPtrW" ( ' BYVAL hWnd AS DWORD
' , BYVAL nIndex AS LONG
' , BYVAL dwNewLong AS LONG
' ) AS DWORD ' ULONG_PTR
'#IF %DEF(%UNICODE)
' MACRO SetClassLongPtr = SetClassLongPtrW
'#ELSE
' MACRO SetClassLongPtr = SetClassLongPtrA
'#ENDIF
'#endif /* _WIN64 */
'#endif /* !NOWINOFFSETS */
'#ENDIF ' #IF NOT %DEF(%NOWINOFFSETS) ' --------------------------------------
'#if(WINVER >= 0x0500)
DECLARE FUNCTION GetProcessDefaultLayout LIB "user32.dll" ALIAS "GetProcessDefaultLayout" ( BYREF pdwDefaultLayout AS QUAD ) AS LONG
DECLARE FUNCTION SetProcessDefaultLayout LIB "user32.dll" ALIAS "SetProcessDefaultLayout" ( BYVAL dwDefaultLayout AS QUAD
 ) AS LONG
'#endif /* WINVER >= 0x0500 */
DECLARE FUNCTION GetDesktopWindow LIB "user32.dll" ALIAS "GetDesktopWindow" ( ) AS QUAD
DECLARE FUNCTION GetParent LIB "user32.dll" ALIAS "GetParent" ( BYVAL hWnd AS QUAD
 ) AS DWORD
DECLARE FUNCTION SetParent LIB "user32.dll" ALIAS "SetParent" ( BYVAL hWnd AS DWORD
 , OPTIONAL BYVAL hWndNewParent AS DWORD
 ) AS DWORD
DECLARE FUNCTION EnumChildWindows LIB "user32.dll" ALIAS "EnumChildWindows" ( BYVAL hwndParent AS DWORD
 , BYVAL lpEnumFunc AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
DECLARE FUNCTION FindWindowA LIB "user32.dll" ALIAS "FindWindowA" ( OPTIONAL BYREF lpClassName AS ASCIIZ
 , OPTIONAL BYREF lpWindowName AS ASCIIZ
 ) AS DWORD
DECLARE FUNCTION FindWindowW LIB "user32.dll" ALIAS "FindWindowW" ( OPTIONAL BYREF lpClassName AS WSTRINGZ
 , OPTIONAL BYREF lpWindowName AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO FindWindow = FindWindowW
#ELSE
 MACRO FindWindow = FindWindowA
#ENDIF
'#if(WINVER >= 0x0400)
DECLARE FUNCTION FindWindowExA LIB "user32.dll" ALIAS "FindWindowExA" ( OPTIONAL BYVAL hwndParent AS QUAD , OPTIONAL BYVAL hWndChildAfter AS QUAD , OPTIONAL BYREF lpszClass AS ASCIIZ , OPTIONAL BYREF lpszWindow AS ASCIIZ ) AS QUAD
DECLARE FUNCTION FindWindowExW LIB "user32.dll" ALIAS "FindWindowExW" ( OPTIONAL BYVAL hwndParent AS QUAD
 , OPTIONAL BYVAL hWndChildAfter AS DWORD
 , OPTIONAL BYREF lpszClass AS WSTRINGZ
 , OPTIONAL BYREF lpszWindow AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO FindWindowEx = FindWindowExW
#ELSE
 MACRO FindWindowEx = FindWindowExA
#ENDIF
DECLARE FUNCTION GetShellWindow LIB "user32.dll" ALIAS "GetShellWindow" ( ) AS QUAD
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION RegisterShellHookWindow LIB "user32.dll" ALIAS "RegisterShellHookWindow" ( BYVAL hWnd AS QUAD ) AS LONG
DECLARE FUNCTION DeregisterShellHookWindow LIB "user32.dll" ALIAS "DeregisterShellHookWindow" ( BYVAL hWnd AS QUAD
 ) AS LONG
DECLARE FUNCTION EnumWindows LIB "user32.dll" ALIAS "EnumWindows" ( BYVAL lpEnumFunc AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
DECLARE FUNCTION EnumThreadWindows LIB "user32.dll" ALIAS "EnumThreadWindows" ( BYVAL dwThreadId AS DWORD
 , BYVAL lpfn AS DWORD
 , BYVAL lParam AS LONG
 ) AS LONG
'#define EnumTaskWindows(hTask, lpfn, lParam) EnumThreadWindows(HandleToUlong(hTask), lpfn, lParam)
'MACRO EnumTaskWindows(hTask, lpfn, lParam) = EnumThreadWindows(hTask, lpfn, lParam)
MACRO EnumTaskWindows = EnumThreadWindows
DECLARE FUNCTION GetClassNameA LIB "user32.dll" ALIAS "GetClassNameA" ( BYVAL hWnd AS QUAD , BYREF lpClassName AS ASCIIZ , BYVAL nMaxCount AS LONG ) AS LONG ' int
DECLARE FUNCTION GetClassNameW LIB "user32.dll" ALIAS "GetClassNameW" ( BYVAL hWnd AS QUAD , BYREF lpClassName AS WSTRINGZ , BYVAL nMaxCount AS LONG ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO GetClassName = GetClassNameW
#ELSE
 MACRO GetClassName = GetClassNameA
#ENDIF
DECLARE FUNCTION GetTopWindow LIB "user32.dll" ALIAS "GetTopWindow" ( OPTIONAL BYVAL hWnd AS QUAD ) AS QUAD
DECLARE FUNCTION GetWindowThreadProcessId LIB "user32.dll" ALIAS "GetWindowThreadProcessId" ( BYVAL hWnd AS QUAD
 , OPTIONAL BYREF lpdwProcessId AS DWORD
 ) AS DWORD
'#if(_WIN32_WINNT >= 0x0501)
DECLARE FUNCTION IsGUIThread LIB "user32.dll" ALIAS "IsGUIThread" ( BYVAL bConvert AS LONG ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0501 */
'#define GetWindowTask(hWnd) \
' ((HANDLE)(DWORD_PTR)GetWindowThreadProcessId(hWnd, NULL))
'MACRO GetWindowTask(hWnd) = GetWindowThreadProcessId(hWnd, BYVAL %NULL)
FUNCTION GetWindowTask (BYVAL hWnd AS DWORD) AS DWORD
 FUNCTION = GetWindowThreadProcessId(hWnd, BYVAL %NULL)
END FUNCTION
DECLARE FUNCTION GetLastActivePopup LIB "user32.dll" ALIAS "GetLastActivePopup" ( BYVAL hWnd AS QUAD ) AS QUAD
'/*
' * GetWindow() Constants
' */
%EQUATE `GW_HWNDFIRST = 0
%EQUATE `GW_HWNDLAST = 1
%EQUATE `GW_HWNDNEXT = 2
%EQUATE `GW_HWNDPREV = 3
%EQUATE `GW_OWNER = 4
%EQUATE `GW_CHILD = 5
'#if(WINVER <= 0x0400)
'%GW_MAX = 5
'#else
%EQUATE `GW_ENABLEDPOPUP = 6
%EQUATE `GW_MAX = 6
'#endif
DECLARE FUNCTION GetWindow LIB "user32.dll" ALIAS "GetWindow" ( BYVAL hWnd AS QUAD , BYVAL uCmd AS QUAD ) AS QUAD
'#define GetNextWindow(hWnd, wCmd) GetWindow(hWnd, wCmd)
'#define GetSysModalWindow() (NULL)
'#define SetSysModalWindow(hWnd) (NULL)
FUNCTION GetNextWindow (BYVAL hWnd AS DWORD, BYVAL wCmd AS DWORD) AS DWORD
 FUNCTION = GetWindow(hWnd, wCmd)
END FUNCTION
'#IF NOT %DEF(%NOWH) ' ---------------------------------------------------------
'#ifndef NOWH
DECLARE FUNCTION SetWindowsHookA LIB "user32.dll" ALIAS "SetWindowsHookA" ( BYVAL nFilterType AS LONG , BYVAL pfnFilterProc AS QUAD ) AS QUAD ' HHOOK
DECLARE FUNCTION SetWindowsHookW LIB "user32.dll" ALIAS "SetWindowsHookW" ( BYVAL nFilterType AS LONG , BYVAL pfnFilterProc AS QUAD ) AS QUAD ' HHOOK
#IF %DEF(%UNICODE)
 MACRO SetWindowsHook = SetWindowsHookW
#ELSE
 MACRO SetWindowsHook = SetWindowsHookA
#ENDIF
DECLARE FUNCTION UnhookWindowsHook LIB "user32.dll" ALIAS "UnhookWindowsHook" ( BYVAL nCode AS LONG , BYVAL pfnFilterProc AS QUAD ) AS LONG
DECLARE FUNCTION SetWindowsHookExA LIB "user32.dll" ALIAS "SetWindowsHookExA" ( BYVAL idHook AS LONG
 , BYVAL lpfn AS DWORD
 , BYVAL hmod AS DWORD
 , BYVAL dwThreadId AS DWORD
 ) AS DWORD ' HHOOK
DECLARE FUNCTION SetWindowsHookExW LIB "user32.dll" ALIAS "SetWindowsHookExW" ( BYVAL idHook AS LONG , BYVAL lpfn AS QUAD , BYVAL hmod AS QUAD , BYVAL dwThreadId AS QUAD ) AS QUAD ' HHOOK
#IF %DEF(%UNICODE)
 MACRO SetWindowsHookEx = SetWindowsHookExW
#ELSE
 MACRO SetWindowsHookEx = SetWindowsHookExA
#ENDIF
DECLARE FUNCTION UnhookWindowsHookEx LIB "user32.dll" ALIAS "UnhookWindowsHookEx" ( BYVAL hhk AS QUAD ) AS LONG
DECLARE FUNCTION CallNextHookEx LIB "user32.dll" ALIAS "CallNextHookEx" ( BYVAL hhk AS QUAD
 , BYVAL nCode AS LONG
 , BYVAL wParam AS DWORD
 , BYVAL lParam AS DWORD
 ) AS LONG ' LRESULT
'/*
' * Macros for source-level compatibility with old functions.
' */
'#define DefHookProc(nCode, wParam, lParam, phhk)\
' CallNextHookEx((HHOOK)*phhk, nCode, wParam, lParam)
'MACRO DefHookProc(nCode, wParam, lParam, phhk) = CallNextHookEx(phhk, nCode, wParam, lParam)
FUNCTION DefHookProc ( BYVAL nCode AS LONG
 , BYVAL wParam AS DWORD
 , BYVAL lParam AS DWORD,
 OPTIONAL BYVAL hhk AS DWORD
 ) AS LONG ' LRESULT
 FUNCTION = CallNextHookEx(hhk, nCode, wParam, lParam)
END FUNCTION
'#endif /* !NOWH */
'#ENDIF ' #IF NOT %DEF(%NOWH) ' ----------------------------------------------
'#IF NOT %DEF(%NOMENUS) ' ------------------------------------------------------
'#ifndef NOMENUS
'/* ;win40 -- A lot of MF_* flags have been renamed as MFT_* and MFS_* flags */
'/*
' * Menu flags for Add/Check/EnableMenuItem()
' */
%EQUATE `MF_INSERT = &H00000000
%EQUATE `MF_CHANGE = &H00000080
%EQUATE `MF_APPEND = &H00000100
%EQUATE `MF_DELETE = &H00000200
%EQUATE `MF_REMOVE = &H00001000
%EQUATE `MF_BYCOMMAND = &H00000000
%EQUATE `MF_BYPOSITION = &H00000400
%EQUATE `MF_SEPARATOR = &H00000800
'%MF_ENABLED = &H00000000
'%MF_GRAYED = &H00000001
'%MF_DISABLED = &H00000002
'%MF_UNCHECKED = &H00000000
'%MF_CHECKED = &H00000008
%EQUATE `MF_USECHECKBITMAPS = &H00000200
%EQUATE `MF_STRING = &H00000000
%EQUATE `MF_BITMAP = &H00000004
%EQUATE `MF_OWNERDRAW = &H00000100
%EQUATE `MF_POPUP = &H00000010
%EQUATE `MF_MENUBARBREAK = &H00000020
%EQUATE `MF_MENUBREAK = &H00000040
'%MF_UNHILITE = &H00000000
'%MF_HILITE = &H00000080
'#if(WINVER >= 0x0400)
%EQUATE `MF_DEFAULT = &H00001000
'#endif /* WINVER >= 0x0400 */
%EQUATE `MF_SYSMENU = &H00002000
%EQUATE `MF_HELP = &H00004000
'#if(WINVER >= 0x0400)
%EQUATE `MF_RIGHTJUSTIFY = &H00004000
'#endif /* WINVER >= 0x0400 */
%EQUATE `MF_MOUSESELECT = &H00008000
'#if(WINVER >= 0x0400)
'%MF_END = &H00000080 ' /* Obsolete -- only used by old RES files */
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0400)
%EQUATE `MFT_STRING = %MF_STRING
%EQUATE `MFT_BITMAP = %MF_BITMAP
%EQUATE `MFT_MENUBARBREAK = %MF_MENUBARBREAK
%EQUATE `MFT_MENUBREAK = %MF_MENUBREAK
%EQUATE `MFT_OWNERDRAW = %MF_OWNERDRAW
%EQUATE `MFT_RADIOCHECK = &H00000200
%EQUATE `MFT_SEPARATOR = %MF_SEPARATOR
%EQUATE `MFT_RIGHTORDER = &H00002000
%EQUATE `MFT_RIGHTJUSTIFY = %MF_RIGHTJUSTIFY
'/* Menu flags for Add/Check/EnableMenuItem() */
'%MFS_GRAYED = &H00000003
'%MFS_DISABLED = %MFS_GRAYED
'%MFS_CHECKED = %MF_CHECKED
'%MFS_HILITE = %MF_HILITE
'%MFS_ENABLED = %MF_ENABLED
'%MFS_UNCHECKED = %MF_UNCHECKED
'%MFS_UNHILITE = %MF_UNHILITE
'%MFS_DEFAULT = %MF_DEFAULT
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0400)
DECLARE FUNCTION CheckMenuRadioItem LIB "user32.dll" ALIAS "CheckMenuRadioItem" ( BYVAL hmenu AS QUAD , BYVAL first AS QUAD , BYVAL last AS QUAD , BYVAL check AS QUAD , BYVAL Flags AS QUAD ) AS LONG
'#endif /* WINVER >= 0x0400 */
'/*
' * Menu item resource format
' */
' // Size = 4 bytes
TYPE MENUITEMTEMPLATEHEADER WORD
 versionNumber AS WORD ' WORD
 offset AS WORD ' WORD
END TYPE
' // Size = 6 bytes
TYPE MENUITEMTEMPLATE WORD
 mtOption AS WORD ' WORD
 mtID AS WORD ' WORD
 mtString AS WSTRINGZ * 1 ' WCHAR mtString[1]
END TYPE
%EQUATE `MF_END = &H00000080
'#endif /* !NOMENUS */
'#ENDIF ' #IF NOT %DEF(%NOMENUS) ' -------------------------------------------
'#IF NOT %DEF(%NOSYSCOMMANDS) ' ------------------------------------------------
'#ifndef NOSYSCOMMANDS
' // Note: The remed equates are predefined in the compiler.
'/*
' * System Menu Command Values
' */
'%SC_SIZE = &HF000
'%SC_MOVE = &HF010
'%SC_MINIMIZE = &HF020
'%SC_MAXIMIZE = &HF030
'%SC_NEXTWINDOW = &HF040
'%SC_PREVWINDOW = &HF050
'%SC_CLOSE = &HF060
'%SC_VSCROLL = &HF070
'%SC_HSCROLL = &HF080
'%SC_MOUSEMENU = &HF090
'%SC_KEYMENU = &HF100
'%SC_ARRANGE = &HF110
'%SC_RESTORE = &HF120
'%SC_TASKLIST = &HF130
'%SC_SCREENSAVE = &HF140
'%SC_HOTKEY = &HF150
'#if(WINVER >= 0x0400)
'%SC_DEFAULT = &HF160
'%SC_MONITORPOWER = &HF170
'%SC_CONTEXTHELP = &HF180
%EQUATE `SC_SEPARATOR = &HF00F
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0600)
%EQUATE `SCF_ISSECURE = &H00000001
'#endif /* WINVER >= 0x0600 */
'#define GET_SC_WPARAM(wParam) ((int)wParam & 0xFFF0)
MACRO GET_SC_WPARAM(wParam) = BITS(LONG, wParam AND &HFFF0)
'/*
' * Obsolete names
' */
%EQUATE `SC_ICON = %SC_MINIMIZE
%EQUATE `SC_ZOOM = %SC_MAXIMIZE
'#endif /* !NOSYSCOMMANDS */
'#ENDIF ' #IF NOT %DEF(%NOSYSCOMMANDS) ' -------------------------------------
'/*
' * Resource Loading Routines
' */
DECLARE FUNCTION LoadBitmapA LIB "user32.dll" ALIAS "LoadBitmapA" ( BYVAL hInstance AS QUAD , BYREF lpBitmapName AS ASCIIZ ) AS QUAD ' HBITMAP
DECLARE FUNCTION LoadBitmapW LIB "user32.dll" ALIAS "LoadBitmapW" ( BYVAL hInstance AS QUAD , BYREF lpBitmapName AS WSTRINGZ ) AS QUAD ' HBITMAP
#IF %DEF(%UNICODE)
 MACRO LoadBitmap = LoadBitmapW
#ELSE
 MACRO LoadBitmap = LoadBitmapA
#ENDIF
DECLARE FUNCTION LoadCursorA LIB "user32.dll" ALIAS "LoadCursorA" ( BYVAL hInstance AS QUAD , BYREF lpCursorName AS ASCIIZ ) AS QUAD ' HCURSOR
DECLARE FUNCTION LoadCursorW LIB "user32.dll" ALIAS "LoadCursorW" ( BYVAL hInstance AS QUAD , BYREF lpCursorName AS WSTRINGZ ) AS QUAD ' HCURSOR
#IF %DEF(%UNICODE)
 MACRO LoadCursor = LoadCursorW
#ELSE
 MACRO LoadCursor = LoadCursorA
#ENDIF
DECLARE FUNCTION LoadCursorFromFileA LIB "user32.dll" ALIAS "LoadCursorFromFileA" ( BYREF lpFileName AS ASCIIZ ) AS QUAD ' HCURSOR
DECLARE FUNCTION LoadCursorFromFileW LIB "user32.dll" ALIAS "LoadCursorFromFileW" ( BYREF lpFileName AS WSTRINGZ ) AS QUAD ' HCURSOR
#IF %DEF(%UNICODE)
 MACRO LoadCursorFromFile = LoadCursorFromFileW
#ELSE
 MACRO LoadCursorFromFile = LoadCursorFromFileA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION CreateCursor LIB "User32.dll" ALIAS "CreateCursor" (BYVAL hInstance AS QUAD, BYVAL nXhotspot AS LONG, BYVAL nYhotspot AS LONG, BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, BYVAL lpANDbitPlane AS BYTE PTR, BYVAL lpXORbitPlane AS BYTE PTR) AS QUAD
#ELSE
DECLARE FUNCTION CreateCursor LIB "user32.dll" ALIAS "CreateCursor" ( BYVAL hInst AS QUAD , BYVAL xHotSpot AS LONG , BYVAL yHotSpot AS LONG , BYVAL nWidth AS LONG , BYVAL nHeight AS LONG , BYREF pvANDPlane AS ANY , BYREF pvXORPlane AS ANY ) AS QUAD ' HCURSOR
#ENDIF
DECLARE FUNCTION DestroyCursor LIB "user32.dll" ALIAS "DestroyCursor" ( BYVAL hCursor AS QUAD ) AS LONG
' // Note: CopyCursor is implemented as a call to the CopyIcon function.
DECLARE FUNCTION CopyCursor LIB "user32.dll" ALIAS "CopyIcon" ( BYVAL hCursor AS QUAD ) AS QUAD ' HCURSOR
'#endif
'/*
' * Standard Cursor IDs
' */
'#define IDC_ARROW MAKEINTRESOURCE(32512)
'#define IDC_IBEAM MAKEINTRESOURCE(32513)
'#define IDC_WAIT MAKEINTRESOURCE(32514)
'#define IDC_CROSS MAKEINTRESOURCE(32515)
'#define IDC_UPARROW MAKEINTRESOURCE(32516)
'#define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
'#define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
'#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
'#define IDC_SIZENESW MAKEINTRESOURCE(32643)
'#define IDC_SIZEWE MAKEINTRESOURCE(32644)
'#define IDC_SIZENS MAKEINTRESOURCE(32645)
'#define IDC_SIZEALL MAKEINTRESOURCE(32646)
'#define IDC_NO MAKEINTRESOURCE(32648) /*not in win3.1 */
'#if(WINVER >= 0x0500)
'#define IDC_HAND MAKEINTRESOURCE(32649)
'#endif /* WINVER >= 0x0500 */
'#define IDC_APPSTARTING MAKEINTRESOURCE(32650) /*not in win3.1 */
'#if(WINVER >= 0x0400)
'#define IDC_HELP MAKEINTRESOURCE(32651)
'#endif /* WINVER >= 0x0400 */
%EQUATE `IDC_ARROW = 32512
%EQUATE `IDC_IBEAM = 32513
%EQUATE `IDC_WAIT = 32514
%EQUATE `IDC_CROSS = 32515
%EQUATE `IDC_UPARROW = 32516
%EQUATE `IDC_SIZE = 32640
%EQUATE `IDC_ICON = 32641
%EQUATE `IDC_SIZENWSE = 32642
%EQUATE `IDC_SIZENESW = 32643
%EQUATE `IDC_SIZEWE = 32644
%EQUATE `IDC_SIZENS = 32645
%EQUATE `IDC_SIZEALL = 32646
%EQUATE `IDC_NO = 32648
'#if(WINVER >= 0x0500)
%EQUATE `IDC_HAND = 32649
'#endif /* WINVER >= 0x0500 */
%EQUATE `IDC_APPSTARTING = 32650
'#if(WINVER >= 0x0400)
%EQUATE `IDC_HELP = 32651
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION SetSystemCursor LIB "user32.dll" ALIAS "SetSystemCursor" ( BYVAL hcur AS QUAD , BYVAL id AS LONG ) AS LONG
' // Size = 20 bytes
TYPE ICONINFO DWORD
 fIcon AS LONG
 xHotspot AS DWORD
 yHotspot AS DWORD
 hbmMask AS DWORD ' HBITMAP
 hbmColor AS DWORD ' HBITMAP
END TYPE
DECLARE FUNCTION LoadIconA LIB "user32.dll" ALIAS "LoadIconA" ( BYVAL hInstance AS QUAD , BYREF lpIconName AS ASCIIZ ) AS QUAD ' HICON
DECLARE FUNCTION LoadIconW LIB "user32.dll" ALIAS "LoadIconW" ( BYVAL hInstance AS QUAD , BYREF lpIconName AS WSTRINGZ ) AS QUAD ' HICON
#IF %DEF(%UNICODE)
 MACRO LoadIcon = LoadIconW
#ELSE
 MACRO LoadIcon = LoadIconA
#ENDIF
DECLARE FUNCTION PrivateExtractIconsA LIB "user32.dll" ALIAS "PrivateExtractIconsA" ( BYREF szFileName AS ASCIIZ , BYVAL nIconIndex AS LONG , BYVAL cxIcon AS LONG , BYVAL cyIcon AS LONG , BYREF phicon AS QUAD , BYREF piconid AS QUAD , BYVAL nIcons AS QUAD , BYVAL Flags AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION PrivateExtractIconsW LIB "user32.dll" ALIAS "PrivateExtractIconsW" ( BYREF szFileName AS WSTRINGZ , BYVAL nIconIndex AS LONG , BYVAL cxIcon AS LONG , BYVAL cyIcon AS LONG , BYREF phicon AS QUAD , BYREF piconid AS QUAD , BYVAL nIcons AS QUAD , BYVAL Flags AS QUAD ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO PrivateExtractIcons = PrivateExtractIconsW
#ELSE
 MACRO PrivateExtractIcons = PrivateExtractIconsA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION CreateIcon LIB "User32.dll" ALIAS "CreateIcon" (BYVAL hInstance AS QUAD, BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, BYVAL nPlanes AS BYTE, BYVAL nBitsPixel AS BYTE, BYVAL lpANDbits AS BYTE PTR, BYVAL lpXORbits AS BYTE PTR) AS QUAD
#ELSE
DECLARE FUNCTION CreateIcon LIB "user32.dll" ALIAS "CreateIcon" ( BYVAL hInstance AS QUAD , BYVAL nWidth AS LONG , BYVAL nHeight AS LONG , BYVAL cPlanes AS BYTE , BYVAL cBitsPixel AS BYTE , BYREF lpbANDbits AS BYTE , BYREF lpbXORbits AS BYTE ) AS QUAD ' HICON
#ENDIF
DECLARE FUNCTION DestroyIcon LIB "user32.dll" ALIAS "DestroyIcon" ( BYVAL hIcon AS QUAD ) AS LONG
DECLARE FUNCTION LookupIconIdFromDirectory LIB "user32.dll" ALIAS "LookupIconIdFromDirectory" ( BYVAL presbits AS BYTE PTR
 , BYVAL fIcon AS LONG
 ) AS LONG ' int
'#if(WINVER >= 0x0400)
DECLARE FUNCTION LookupIconIdFromDirectoryEx LIB "user32.dll" ALIAS "LookupIconIdFromDirectoryEx" ( BYVAL presbits AS BYTE PTR , BYVAL fIcon AS LONG , BYVAL cxDesired AS LONG , BYVAL cyDesired AS LONG , BYVAL Flags AS QUAD ) AS LONG ' int
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION CreateIconFromResource LIB "user32.dll" ALIAS "CreateIconFromResource" ( BYVAL presbits AS BYTE PTR , BYVAL dwResSize AS QUAD , BYVAL fIcon AS LONG , BYVAL dwVer AS QUAD ) AS QUAD ' HICON
'#if(WINVER >= 0x0400)
DECLARE FUNCTION CreateIconFromResourceEx LIB "user32.dll" ALIAS "CreateIconFromResourceEx" ( BYVAL presbits AS BYTE PTR , BYVAL dwResSize AS QUAD , BYVAL fIcon AS LONG , BYVAL dwVer AS QUAD , BYVAL cxDesired AS LONG , BYVAL cyDesired AS LONG , BYVAL Flags AS QUAD ) AS QUAD ' HICON
'/* Icon/Cursor header */
'#endif /* WINVER >= 0x0400 */
' // Size = 24 bytes
TYPE CURSORSHAPE BYTE
 xHotSpot AS LONG ' int
 yHotSpot AS LONG ' int
 cx AS LONG ' int
 cy AS LONG ' int
 cbWidth AS LONG ' int
 Planes AS BYTE ' BYTE
 BitsPixel AS BYTE ' BYTE
 alignment__ AS WORD ' // To keep DWORD alignment
END TYPE
%EQUATE `IMAGE_BITMAP = 0
%EQUATE `IMAGE_ICON = 1
%EQUATE `IMAGE_CURSOR = 2
'#if(WINVER >= 0x0400)
%EQUATE `IMAGE_ENHMETAFILE = 3
%EQUATE `LR_DEFAULTCOLOR = &H0000
%EQUATE `LR_MONOCHROME = &H0001
%EQUATE `LR_COLOR = &H0002
%EQUATE `LR_COPYRETURNORG = &H0004
%EQUATE `LR_COPYDELETEORG = &H0008
%EQUATE `LR_LOADFROMFILE = &H0010
%EQUATE `LR_LOADTRANSPARENT = &H0020
%EQUATE `LR_DEFAULTSIZE = &H0040
%EQUATE `LR_VGACOLOR = &H0080
%EQUATE `LR_LOADMAP3DCOLORS = &H1000
%EQUATE `LR_CREATEDIBSECTION = &H2000
%EQUATE `LR_COPYFROMRESOURCE = &H4000
%EQUATE `LR_SHARED = &H8000
DECLARE FUNCTION LoadImageA LIB "user32.dll" ALIAS "LoadImageA" ( BYVAL hInst AS QUAD , BYREF name AS ASCIIZ , BYVAL type AS QUAD , BYVAL cx AS LONG , BYVAL cy AS LONG , BYVAL fuLoad AS QUAD ) AS QUAD
DECLARE FUNCTION LoadImageW LIB "user32.dll" ALIAS "LoadImageW" ( BYVAL hInst AS QUAD
 , BYREF name AS WSTRINGZ
 , BYVAL type AS DWORD
 , BYVAL cx AS LONG
 , BYVAL cy AS LONG
 , BYVAL fuLoad AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO LoadImage = LoadImageW
#ELSE
 MACRO LoadImage = LoadImageA
#ENDIF
DECLARE FUNCTION CopyImage LIB "user32.dll" ALIAS "CopyImage" ( BYVAL h AS QUAD , BYVAL type AS QUAD , BYVAL cx AS LONG , BYVAL cy AS LONG , BYVAL Flags AS QUAD ) AS QUAD
%EQUATE `DI_MASK = &H0001
%EQUATE `DI_IMAGE = &H0002
%EQUATE `DI_NORMAL = &H0003
%EQUATE `DI_COMPAT = &H0004
%EQUATE `DI_DEFAULTSIZE = &H0008
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `DI_NOMIRROR = &H0010
'#endif /* _WIN32_WINNT >= 0x0501 */
DECLARE FUNCTION DrawIconEx LIB "user32.dll" ALIAS "DrawIconEx" ( BYVAL hDC AS QUAD , BYVAL xLeft AS LONG , BYVAL yTop AS LONG , BYVAL hIcon AS QUAD , BYVAL cxWidth AS LONG , BYVAL cyWidth AS LONG , BYVAL istepIfAniCur AS QUAD , BYVAL hbrFlickerFreeDraw AS QUAD , BYVAL diFlags AS QUAD ) AS LONG ' long
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION CreateIconIndirect LIB "user32.dll" ALIAS "CreateIconIndirect" ( BYREF piconinfo AS ICONINFO ) AS QUAD ' HICON
DECLARE FUNCTION CopyIcon LIB "user32.dll" ALIAS "CopyIcon" ( BYVAL hIcon AS QUAD ) AS QUAD ' HICON
DECLARE FUNCTION GetIconInfo LIB "user32.dll" ALIAS "GetIconInfo" ( BYVAL hIcon AS QUAD , BYREF piconinfo AS ICONINFO ) AS LONG
'#if(_WIN32_WINNT >= 0x0600)
' // Size = 548 bytes
TYPE ICONINFOEXA DWORD
 cbSize AS DWORD
 fIcon AS LONG
 xHotspot AS DWORD
 yHotspot AS DWORD
 hbmMask AS DWORD ' HBITMAP
 hbmColor AS DWORD ' HBITMAP
 wResID AS WORD ' WORD
 szModName AS ASCIIZ * %MAX_PATH
 szResName AS ASCIIZ * %MAX_PATH
END TYPE
' // Size = 1068 bytes
TYPE ICONINFOEXW DWORD
 cbSize AS DWORD
 fIcon AS LONG
 xHotspot AS DWORD
 yHotspot AS DWORD
 hbmMask AS DWORD ' HBITMAP
 hbmColor AS DWORD ' HBITMAP
 wResID AS WORD ' WORD
 szModName AS WSTRINGZ * %MAX_PATH
 szResName AS WSTRINGZ * %MAX_PATH
END TYPE
#IF %DEF(%UNICODE)
MACRO ICONINFOEX = ICONINFOEXW
#ELSE
MACRO ICONINFOEX = ICONINFOEXA
#ENDIF
DECLARE FUNCTION GetIconInfoExA LIB "user32.dll" ALIAS "GetIconInfoExA" ( BYVAL hIcon AS QUAD , BYREF piconinfo AS ICONINFOEXA ) AS LONG
DECLARE FUNCTION GetIconInfoExW LIB "user32.dll" ALIAS "GetIconInfoExW" ( BYVAL hIcon AS QUAD
 , BYREF piconinfo AS ICONINFOEXW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetIconInfoEx = GetIconInfoExW
#ELSE
 MACRO GetIconInfoEx = GetIconInfoExA
#ENDIF
'#endif /* _WIN32_WINNT >= 0x0600 */
'#if(WINVER >= 0x0400)
%EQUATE `RES_ICON = 1
%EQUATE `RES_CURSOR = 2
'#endif /* WINVER >= 0x0400 */
'#ifdef OEMRESOURCE
'/*
' * OEM Resource Ordinal Numbers
' */
%EQUATE `OBM_CLOSE = 32754
%EQUATE `OBM_UPARROW = 32753
%EQUATE `OBM_DNARROW = 32752
%EQUATE `OBM_RGARROW = 32751
%EQUATE `OBM_LFARROW = 32750
%EQUATE `OBM_REDUCE = 32749
%EQUATE `OBM_ZOOM = 32748
%EQUATE `OBM_RESTORE = 32747
%EQUATE `OBM_REDUCED = 32746
%EQUATE `OBM_ZOOMD = 32745
%EQUATE `OBM_RESTORED = 32744
%EQUATE `OBM_UPARROWD = 32743
%EQUATE `OBM_DNARROWD = 32742
%EQUATE `OBM_RGARROWD = 32741
%EQUATE `OBM_LFARROWD = 32740
%EQUATE `OBM_MNARROW = 32739
%EQUATE `OBM_COMBO = 32738
%EQUATE `OBM_UPARROWI = 32737
%EQUATE `OBM_DNARROWI = 32736
%EQUATE `OBM_RGARROWI = 32735
%EQUATE `OBM_LFARROWI = 32734
%EQUATE `OBM_OLD_CLOSE = 32767
%EQUATE `OBM_SIZE = 32766
%EQUATE `OBM_OLD_UPARROW = 32765
%EQUATE `OBM_OLD_DNARROW = 32764
%EQUATE `OBM_OLD_RGARROW = 32763
%EQUATE `OBM_OLD_LFARROW = 32762
%EQUATE `OBM_BTSIZE = 32761
%EQUATE `OBM_CHECK = 32760
%EQUATE `OBM_CHECKBOXES = 32759
%EQUATE `OBM_BTNCORNERS = 32758
%EQUATE `OBM_OLD_REDUCE = 32757
%EQUATE `OBM_OLD_ZOOM = 32756
%EQUATE `OBM_OLD_RESTORE = 32755
%EQUATE `OCR_NORMAL = 32512
%EQUATE `OCR_IBEAM = 32513
%EQUATE `OCR_WAIT = 32514
%EQUATE `OCR_CROSS = 32515
%EQUATE `OCR_UP = 32516
%EQUATE `OCR_SIZE = 32640 ' OBSOLETE: use %OCR_SIZEALL
%EQUATE `OCR_ICON = 32641 ' OBSOLETE: use %OCR_NORMAL
%EQUATE `OCR_SIZENWSE = 32642
%EQUATE `OCR_SIZENESW = 32643
%EQUATE `OCR_SIZEWE = 32644
%EQUATE `OCR_SIZENS = 32645
%EQUATE `OCR_SIZEALL = 32646
%EQUATE `OCR_ICOCUR = 32647 ' OBSOLETE: use %OIC_WINLOGO
%EQUATE `OCR_NO = 32648
'#if(WINVER >= 0x0500)
%EQUATE `OCR_HAND = 32649
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0400)
%EQUATE `OCR_APPSTARTING = 32650
'#endif /* WINVER >= 0x0400 */
%EQUATE `OIC_SAMPLE = 32512
%EQUATE `OIC_HAND = 32513
%EQUATE `OIC_QUES = 32514
%EQUATE `OIC_BANG = 32515
%EQUATE `OIC_NOTE = 32516
'#if(WINVER >= 0x0400)
%EQUATE `OIC_WINLOGO = 32517
%EQUATE `OIC_WARNING = %OIC_BANG
%EQUATE `OIC_ERROR = %OIC_HAND
%EQUATE `OIC_INFORMATION = %OIC_NOTE
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0600)
%EQUATE `OIC_SHIELD = 32518
'#endif /* WINVER >= 0x0600 */
'#endif /* OEMRESOURCE */
'#define ORD_LANGDRIVER 1 /* The ordinal number for the entry point of
' ** language drivers.
' */
%EQUATE `ORD_LANGDRIVER = 1& ' The ordinal number for the entry point of language drivers.
'#IF NOT %DEF(%NOICONS) ' ------------------------------------------------------
'#ifndef NOICONS
'/*
' * Standard Icon IDs
' */
'#ifdef RC_INVOKED
'#define IDI_APPLICATION 32512
'#define IDI_HAND 32513
'#define IDI_QUESTION 32514
'#define IDI_EXCLAMATION 32515
'#define IDI_ASTERISK 32516
'#if(WINVER >= 0x0400)
'#define IDI_WINLOGO 32517
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0600)
'#define IDI_SHIELD 32518
'#endif /* WINVER >= 0x0600 */
'#else
'#define IDI_APPLICATION MAKEINTRESOURCE(32512)
'#define IDI_HAND MAKEINTRESOURCE(32513)
'#define IDI_QUESTION MAKEINTRESOURCE(32514)
'#define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
'#define IDI_ASTERISK MAKEINTRESOURCE(32516)
'#if(WINVER >= 0x0400)
'#define IDI_WINLOGO MAKEINTRESOURCE(32517)
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0600)
'#define IDI_SHIELD MAKEINTRESOURCE(32518)
'#endif /* WINVER >= 0x0600 */
'#endif /* RC_INVOKED */
%EQUATE `IDI_APPLICATION = 32512
%EQUATE `IDI_HAND = 32513
%EQUATE `IDI_QUESTION = 32514
%EQUATE `IDI_EXCLAMATION = 32515
%EQUATE `IDI_ASTERISK = 32516
%EQUATE `IDI_WINLOGO = 32517
%EQUATE `IDI_SHIELD = 32518
'#if(WINVER >= 0x0400)
'#define IDI_WARNING IDI_EXCLAMATION
'#define IDI_ERROR IDI_HAND
'#define IDI_INFORMATION IDI_ASTERISK
%EQUATE `IDI_WARNING = %IDI_EXCLAMATION
%EQUATE `IDI_ERROR = %IDI_HAND
%EQUATE `IDI_INFORMATION = %IDI_ASTERISK
'#endif /* WINVER >= 0x0400 */
'#endif /* !NOICONS */
'#ENDIF ' #IF NOT %DEF(%NOICONS) ' -------------------------------------------
DECLARE FUNCTION LoadStringA LIB "user32.dll" ALIAS "LoadStringA" ( BYVAL hInstance AS QUAD , BYVAL uID AS QUAD , BYREF lpBuffer AS ASCIIZ , BYVAL cchBufferMax AS LONG ) AS LONG ' int
DECLARE FUNCTION LoadStringW LIB "user32.dll" ALIAS "LoadStringW" ( BYVAL hInstance AS QUAD , BYVAL uID AS QUAD , BYREF lpBuffer AS WSTRINGZ , BYVAL cchBufferMax AS LONG ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO LoadString = LoadStringW
#ELSE
 MACRO LoadString = LoadStringA
#ENDIF
' // Note: The remed IDs are predefined in the compiler.
'/*
' * Dialog Box Command IDs
' */
'%IDOK = 1
'%IDCANCEL = 2
'%IDABORT = 3
'%IDRETRY = 4
'%IDIGNORE = 5
'%IDYES = 6
'%IDNO = 7
'#if(WINVER >= 0x0400)
'%IDCLOSE = 8
'%IDHELP = 9
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
'%IDTRYAGAIN = 10
'%IDCONTINUE = 11
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0501)
#IF NOT %DEF(%IDTIMEOUT)
%EQUATE `IDTIMEOUT = 32000
#ENDIF
'#endif /* WINVER >= 0x0501 */
'#IF NOT %DEF(%NOCTLMGR) ' -----------------------------------------------------
'#ifndef NOCTLMGR
'/*
' * Control Manager Structures and Definitions
' */
'#IF NOT %DEF(%NOWINSTYLES) ' --------------------------------------------------
'#ifndef NOWINSTYLES
'/*
' * Edit Control Styles
' */
'%ES_LEFT = &H0000
'%ES_CENTER = &H0001
'%ES_RIGHT = &H0002
'%ES_MULTILINE = &H0004
'%ES_UPPERCASE = &H0008
'%ES_LOWERCASE = &H0010
'%ES_PASSWORD = &H0020
'%ES_AUTOVSCROLL = &H0040
'%ES_AUTOHSCROLL = &H0080
'%ES_NOHIDESEL = &H0100
'%ES_OEMCONVERT = &H0400
'%ES_READONLY = &H0800
'%ES_WANTRETURN = &H1000
'#if(WINVER >= 0x0400)
'%ES_NUMBER = &H2000
'#endif /* WINVER >= 0x0400 */
'#endif /* !NOWINSTYLES */
'#ENDIF ' #IF NOT %DEF(%NOWINSTYLES) ' ---------------------------------------
'/*
' * Edit Control Notification Codes
' */
'%EN_SETFOCUS = &H0100
'%EN_KILLFOCUS = &H0200
'%EN_CHANGE = &H0300
'%EN_UPDATE = &H0400
'%EN_ERRSPACE = &H0500
'%EN_MAXTEXT = &H0501
'%EN_HSCROLL = &H0601
'%EN_VSCROLL = &H0602
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `EN_ALIGN_LTR_EC = &H0700
%EQUATE `EN_ALIGN_RTL_EC = &H0701
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(WINVER >= 0x0400)
'/* Edit control EM_SETMARGIN parameters */
%EQUATE `EC_LEFTMARGIN = &H0001
%EQUATE `EC_RIGHTMARGIN = &H0002
%EQUATE `EC_USEFONTINFO = &HFFFF
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
'/* wParam of EM_GET/SETIMESTATUS */
%EQUATE `EMSIS_COMPOSITIONSTRING = &H0001
'/* lParam for EMSIS_COMPOSITIONSTRING */
%EQUATE `EIMES_GETCOMPSTRATONCE = &H0001
%EQUATE `EIMES_CANCELCOMPSTRINFOCUS = &H0002
%EQUATE `EIMES_COMPLETECOMPSTRKILLFOCUS = &H0004
'#endif /* WINVER >= 0x0500 */
'#IF NOT %DEF(%NOWINMESSAGES) ' ------------------------------------------------
'#ifndef NOWINMESSAGES
'/*
' * Edit Control Messages
' */
%EQUATE `EM_GETSEL = &H00B0
%EQUATE `EM_SETSEL = &H00B1
%EQUATE `EM_GETRECT = &H00B2
%EQUATE `EM_SETRECT = &H00B3
%EQUATE `EM_SETRECTNP = &H00B4
%EQUATE `EM_SCROLL = &H00B5
%EQUATE `EM_LINESCROLL = &H00B6
%EQUATE `EM_SCROLLCARET = &H00B7
%EQUATE `EM_GETMODIFY = &H00B8
%EQUATE `EM_SETMODIFY = &H00B9
%EQUATE `EM_GETLINECOUNT = &H00BA
%EQUATE `EM_LINEINDEX = &H00BB
%EQUATE `EM_SETHANDLE = &H00BC
%EQUATE `EM_GETHANDLE = &H00BD
%EQUATE `EM_GETTHUMB = &H00BE
%EQUATE `EM_LINELENGTH = &H00C1
%EQUATE `EM_REPLACESEL = &H00C2
%EQUATE `EM_GETLINE = &H00C4
%EQUATE `EM_LIMITTEXT = &H00C5
%EQUATE `EM_CANUNDO = &H00C6
%EQUATE `EM_UNDO = &H00C7
%EQUATE `EM_FMTLINES = &H00C8
%EQUATE `EM_LINEFROMCHAR = &H00C9
%EQUATE `EM_SETTABSTOPS = &H00CB
%EQUATE `EM_SETPASSWORDCHAR = &H00CC
%EQUATE `EM_EMPTYUNDOBUFFER = &H00CD
%EQUATE `EM_GETFIRSTVISIBLELINE = &H00CE
%EQUATE `EM_SETREADONLY = &H00CF
%EQUATE `EM_SETWORDBREAKPROC = &H00D0
%EQUATE `EM_GETWORDBREAKPROC = &H00D1
%EQUATE `EM_GETPASSWORDCHAR = &H00D2
'#if(WINVER >= 0x0400)
%EQUATE `EM_SETMARGINS = &H00D3
%EQUATE `EM_GETMARGINS = &H00D4
%EQUATE `EM_SETLIMITTEXT = %EM_LIMITTEXT
%EQUATE `EM_GETLIMITTEXT = &H00D5
%EQUATE `EM_POSFROMCHAR = &H00D6
%EQUATE `EM_CHARFROMPOS = &H00D7
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0500)
%EQUATE `EM_SETIMESTATUS = &H00D8
%EQUATE `EM_GETIMESTATUS = &H00D9
'#endif /* WINVER >= 0x0500 */
'#endif /* !NOWINMESSAGES */
'#ENDIF ' #IF NOT %DEF(%NOWINMESSAGES) ' -------------------------------------
'/*
' * EDITWORDBREAKPROC code values
' */
%EQUATE `WB_LEFT = 0&
%EQUATE `WB_RIGHT = 1&
%EQUATE `WB_ISDELIMITER = 2&
' // Note: The remed BS_XXX styles are predefined in the compiler.
'/*
' * Button Control Styles
' */
'%BS_PUSHBUTTON = &H00000000
'%BS_DEFPUSHBUTTON = &H00000001
'%BS_DEFAULT = %BS_DEFPUSHBUTTON
'%BS_CHECKBOX = &H00000002
'%BS_AUTOCHECKBOX = &H00000003
'%BS_RADIOBUTTON = &H00000004
'%BS_3STATE = &H00000005
'%BS_AUTO3STATE = &H00000006
'%BS_GROUPBOX = &H00000007
'%BS_USERBUTTON = &H00000008
'%BS_AUTORADIOBUTTON = &H00000009
'%BS_OWNERDRAW = &H0000000B
'%BS_LEFTTEXT = &H00000020
'#if(WINVER >= 0x0400)
'%BS_TEXT = &H00000000
'%BS_ICON = &H00000040
'%BS_BITMAP = &H00000080
'%BS_LEFT = &H00000100
'%BS_RIGHT = &H00000200
'%BS_CENTER = &H00000300
'%BS_TOP = &H00000400
'%BS_BOTTOM = &H00000800
'%BS_VCENTER = &H00000C00
'%BS_PUSHLIKE = &H00001000
'%BS_MULTILINE = &H00002000
'%BS_NOTIFY = &H00004000
'%BS_FLAT = &H00008000
%EQUATE `BS_RIGHTBUTTON = %BS_LEFTTEXT
'#endif /* WINVER >= 0x0400 */
' // The remed BN_XXX equates are predefined in the compiler.
'/*
' * User Button Notification Codes
' */
'%BN_CLICKED = 0&
'%BN_PAINT = 1&
'%BN_HILITE = 2&
'%BN_UNHILITE = 3&
'%BN_DISABLE = 4&
'%BN_DOUBLECLICKED = 5&
'#if(WINVER >= 0x0400)
%EQUATE `BN_PUSHED = %BN_HILITE
%EQUATE `BN_UNPUSHED = %BN_UNHILITE
'%BN_DBLCLK = %BN_DOUBLECLICKED
'%BN_SETFOCUS = 6&
'%BN_KILLFOCUS = 7&
'#endif /* WINVER >= 0x0400 */
'/*
' * Button Control Messages
' */
%EQUATE `BM_GETCHECK = &H00F0
%EQUATE `BM_SETCHECK = &H00F1
%EQUATE `BM_GETSTATE = &H00F2
%EQUATE `BM_SETSTATE = &H00F3
%EQUATE `BM_SETSTYLE = &H00F4
'#if(WINVER >= 0x0400)
%EQUATE `BM_CLICK = &H00F5
%EQUATE `BM_GETIMAGE = &H00F6
%EQUATE `BM_SETIMAGE = &H00F7
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0600)
%EQUATE `BM_SETDONTCLICK = &H00F8
'#endif /* WINVER >= 0x0600 */
'#if(WINVER >= 0x0400)
%EQUATE `BST_UNCHECKED = &H0000&
%EQUATE `BST_CHECKED = &H0001&
%EQUATE `BST_INDETERMINATE = &H0002&
%EQUATE `BST_PUSHED = &H0004&
%EQUATE `BST_FOCUS = &H0008&
'#endif /* WINVER >= 0x0400 */
'/*
' * Static Control Constants
' */
'%SS_LEFT = &H00000000
'%SS_CENTER = &H00000001
'%SS_RIGHT = &H00000002
'%SS_ICON = &H00000003
'%SS_BLACKRECT = &H00000004
'%SS_GRAYRECT = &H00000005
'%SS_WHITERECT = &H00000006
'%SS_BLACKFRAME = &H00000007
'%SS_GRAYFRAME = &H00000008
'%SS_WHITEFRAME = &H00000009
'%SS_USERITEM = &H0000000A
'%SS_SIMPLE = &H0000000B
'%SS_LEFTNOWORDWRAP = &H0000000C
'#if(WINVER >= 0x0400)
'%SS_NOWORDWRAP = %SS_LEFTNOWORDWRAP
'%SS_OWNERDRAW = &H0000000D
'%SS_BITMAP = &H0000000E
'%SS_ENHMETAFILE = &H0000000F
'%SS_ETCHEDHORZ = &H00000010
'%SS_ETCHEDVERT = &H00000011
'%SS_ETCHEDFRAME = &H00000012
%EQUATE `SS_TYPEMASK = &H0000001F
'#endif /* WINVER >= 0x0400 */
'#if(WINVER >= 0x0501)
'%SS_REALSIZECONTROL = &H00000040
'#endif /* WINVER >= 0x0501 */
'%SS_NOPREFIX = &H00000080 ' Don't do "&" character translation
'#if(WINVER >= 0x0400)
'%SS_NOTIFY = &H00000100
'%SS_CENTERIMAGE = &H00000200
'%SS_RIGHTJUST = &H00000400
'%SS_REALSIZEIMAGE = &H00000800
'%SS_REALSIZE = %SS_REALSIZEIMAGE
'%SS_SUNKEN = &H00001000
'%SS_ENDELLIPSIS = &H00004000
'%SS_PATHELLIPSIS = &H00008000
'%SS_WORDELLIPSIS = &H0000C000
'%SS_ELLIPSISMASK = &H0000C000
'#endif /* WINVER >= 0x0400 */
'#IF NOT %DEF(%NOWINMESSAGES) ' ------------------------------------------------
'#ifndef NOWINMESSAGES
'/*
' * Static Control Mesages
' */
%EQUATE `STM_SETICON = &H0170
%EQUATE `STM_GETICON = &H0171
'#if(WINVER >= 0x0400)
%EQUATE `STM_SETIMAGE = &H0172
%EQUATE `STM_GETIMAGE = &H0173
%EQUATE `STN_CLICKED = 0&
%EQUATE `STN_DBLCLK = 1&
%EQUATE `STN_ENABLE = 2&
%EQUATE `STN_DISABLE = 3&
'#endif /* WINVER >= 0x0400 */
%EQUATE `STM_MSGMAX = &H0174
'#endif /* !NOWINMESSAGES */
'#ENDIF ' #IF NOT %DEF(%NOWINMESSAGES) ' -------------------------------------
'/*
' * Dialog window class
' */
'#define WC_DIALOG (MAKEINTATOM(0x8002))
%EQUATE `WC_DIALOG = &H8002
'/*
' * Get/SetWindowWord/Long offsets for use with WC_DIALOG windows
' */
%EQUATE `DWL_MSGRESULT = 0&
%EQUATE `DWL_DLGPROC = 4&
%EQUATE `DWL_USER = 8&
'#ifdef _WIN64
'#undef DWL_MSGRESULT
'#undef DWL_DLGPROC
'#undef DWL_USER
'#endif /* _WIN64 */
'#define DWLP_MSGRESULT 0
'#define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT)
'#define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC)
%EQUATE `DWLP_MSGRESULT = 0
%EQUATE `DWLP_DLGPROC = %DWLP_MSGRESULT + 4
%EQUATE `DWLP_USER = %DWLP_DLGPROC + 4
'/*
' * Dialog Manager Routines
' */
'#IF NOT %DEF(%NOMSG) '---------------------------------------------------------
'#ifndef NOMSG
DECLARE FUNCTION IsDialogMessageA LIB "user32.dll" ALIAS "IsDialogMessageA" ( BYVAL hDlg AS QUAD , BYREF lpMsg AS tagMSG ) AS LONG
DECLARE FUNCTION IsDialogMessageW LIB "user32.dll" ALIAS "IsDialogMessageW" ( BYVAL hDlg AS QUAD
 , BYREF lpMsg AS tagMSG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsDialogMessage = IsDialogMessageW
#ELSE
 MACRO IsDialogMessage = IsDialogMessageA
#ENDIF
'#endif /* !NOMSG */
'#ENDIF ' #IF NOT %DEF(%NOMSG) '----------------------------------------------
DECLARE FUNCTION MapDialogRect LIB "user32.dll" ALIAS "MapDialogRect" ( BYVAL hDlg AS QUAD , BYREF lpRect AS RECT ) AS LONG
DECLARE FUNCTION DlgDirListA LIB "user32.dll" ALIAS "DlgDirListA" ( BYVAL hDlg AS QUAD
 , BYREF lpPathSpec AS ASCIIZ
 , BYVAL nIDListBox AS LONG
 , BYVAL nIDStaticPath AS LONG
 , BYVAL uFileType AS DWORD
 ) AS LONG ' int
DECLARE FUNCTION DlgDirListW LIB "user32.dll" ALIAS "DlgDirListW" ( BYVAL hDlg AS QUAD , BYREF lpPathSpec AS WSTRINGZ , BYVAL nIDListBox AS LONG , BYVAL nIDStaticPath AS LONG , BYVAL uFileType AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO DlgDirList = DlgDirListW
#ELSE
 MACRO DlgDirList = DlgDirListA
#ENDIF
'/*
' * DlgDirList, DlgDirListComboBox flags values
' */
%EQUATE `DDL_READWRITE = &H0000
%EQUATE `DDL_READONLY = &H0001
%EQUATE `DDL_HIDDEN = &H0002
%EQUATE `DDL_SYSTEM = &H0004
%EQUATE `DDL_DIRECTORY = &H0010
%EQUATE `DDL_ARCHIVE = &H0020
%EQUATE `DDL_POSTMSGS = &H2000
%EQUATE `DDL_DRIVES = &H4000
%EQUATE `DDL_EXCLUSIVE = &H8000
DECLARE FUNCTION DlgDirSelectExA LIB "user32.dll" ALIAS "DlgDirSelectExA" ( BYVAL hWndDlg AS QUAD , BYREF lpString AS ASCIIZ , BYVAL chCount AS LONG , BYVAL idListBox AS LONG ) AS LONG
DECLARE FUNCTION DlgDirSelectExW LIB "user32.dll" ALIAS "DlgDirSelectExW" ( BYVAL hWndDlg AS QUAD
 , BYREF lpString AS WSTRINGZ
 , BYVAL chCount AS LONG
 , BYVAL idListBox AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DlgDirSelectEx = DlgDirSelectExW
#ELSE
 MACRO DlgDirSelectEx = DlgDirSelectExA
#ENDIF
DECLARE FUNCTION DlgDirListComboBoxA LIB "user32.dll" ALIAS "DlgDirListComboBoxA" ( BYVAL hDlg AS QUAD , BYREF lpPathSpec AS ASCIIZ , BYVAL nIDComboBox AS LONG , BYVAL nIDStaticPath AS LONG , BYVAL uFiletype AS QUAD ) AS LONG ' int
DECLARE FUNCTION DlgDirListComboBoxW LIB "user32.dll" ALIAS "DlgDirListComboBoxW" ( BYVAL hDlg AS QUAD , BYREF lpPathSpec AS WSTRINGZ , BYVAL nIDComboBox AS LONG , BYVAL nIDStaticPath AS LONG , BYVAL uFiletype AS QUAD ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO DlgDirListComboBox = DlgDirListComboBoxW
#ELSE
 MACRO DlgDirListComboBox = DlgDirListComboBoxA
#ENDIF
DECLARE FUNCTION DlgDirSelectComboBoxExA LIB "user32.dll" ALIAS "DlgDirSelectComboBoxExA" ( BYVAL hWndDlg AS QUAD , BYREF lpString AS ASCIIZ , BYVAL cchOut AS LONG , BYVAL idComboBox AS LONG ) AS LONG
DECLARE FUNCTION DlgDirSelectComboBoxExW LIB "user32.dll" ALIAS "DlgDirSelectComboBoxExW" ( BYVAL hWndDlg AS QUAD
 , BYREF lpString AS WSTRINGZ
 , BYVAL cchOut AS LONG
 , BYVAL idComboBox AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DlgDirSelectComboBoxEx = DlgDirSelectComboBoxExW
#ELSE
 MACRO DlgDirSelectComboBoxEx = DlgDirSelectComboBoxExA
#ENDIF
' // Note: The remed DS_XXX styles are predefined in the compiler.
'/*
' * Dialog Styles
' */
'%DS_ABSALIGN = &H01
'%DS_SYSMODAL = &H02
'%DS_LOCALEDIT = &H20 ' Edit items get Local storage.
'%DS_SETFONT = &H40 ' User specified font for Dlg controls
'%DS_MODALFRAME = &H80 ' Can be combined with WS_CAPTION
'%DS_NOIDLEMSG = &H100 ' WM_ENTERIDLE message will not be sent
'%DS_SETFOREGROUND = &H200 ' not in win3.1
'#if(WINVER >= 0x0400)
'%DS_3DLOOK = &H0004
'%DS_FIXEDSYS = &H0008
'%DS_NOFAILCREATE = &H0010
'%DS_CONTROL = &H0400
'%DS_CENTER = &H0800
'%DS_CENTERMOUSE = &H1000
'%DS_CONTEXTHELP = &H2000
'%DS_SHELLFONT = %DS_SETFONT OR %DS_FIXEDSYS
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WCE >= 0x0500)
%EQUATE `DS_USEPIXELS = &H8000
'#endif
%EQUATE `DM_GETDEFID = %WM_USER + 0
%EQUATE `DM_SETDEFID = %WM_USER + 1
'#if(WINVER >= 0x0400)
%EQUATE `DM_REPOSITION = %WM_USER + 2
'#endif /* WINVER >= 0x0400 */
'/*
' * Returned in HIWORD() of DM_GETDEFID result if msg is supported
' */
%EQUATE `DC_HASDEFID = &H534B
'/*
' * Dialog Codes
' */
'%DLGC_WANTARROWS = &H0001& ' Control wants arrow keys
'%DLGC_WANTTAB = &H0002& ' Control wants tab keys
'%DLGC_WANTALLKEYS = &H0004& ' Control wants all keys
'%DLGC_WANTMESSAGE = &H0004& ' Pass message to control
'%DLGC_HASSETSEL = &H0008& ' Understands EM_SETSEL message
'%DLGC_DEFPUSHBUTTON = &H0010& ' Default pushbutton
'%DLGC_UNDEFPUSHBUTTON = &H0020& ' Non-default pushbutton
'%DLGC_RADIOBUTTON = &H0040& ' Radio button
'%DLGC_WANTCHARS = &H0080& ' Want WM_CHAR messages
'%DLGC_STATIC = &H0100& ' Static item: don't include
'%DLGC_BUTTON = &H2000& ' Button item: can be checked
%EQUATE `LB_CTLCODE = 0&
'/*
' * Listbox Return Values
' */
%EQUATE `LB_OKAY = 0&
%EQUATE `LB_ERR = -1&
%EQUATE `LB_ERRSPACE = -2&
'/*
'** The idStaticPath parameter to DlgDirList can have the following values
'** ORed if the list box should show other details of the files along with
'** the name of the files;
'*/
'/* all other details also will be returned */
' // Note: The remed LBN_XXX equates are predefined in the compiler.
'/*
' * Listbox Notification Codes
' */
'%LBN_ERRSPACE = -2&
'%LBN_SELCHANGE = 1&
'%LBN_DBLCLK = 2&
'%LBN_SELCANCEL = 3&
'%LBN_SETFOCUS = 4&
'%LBN_KILLFOCUS = 5&
'#IF NOT %DEF(%NOWINMESSAGES) ' ------------------------------------------------
'#ifndef NOWINMESSAGES
'/*
' * Listbox messages
' */
%EQUATE `LB_ADDSTRING = &H180
%EQUATE `LB_INSERTSTRING = &H181
%EQUATE `LB_DELETESTRING = &H182
%EQUATE `LB_SELITEMRANGEEX = &H183
%EQUATE `LB_RESETCONTENT = &H184
%EQUATE `LB_SETSEL = &H185
%EQUATE `LB_SETCURSEL = &H186
%EQUATE `LB_GETSEL = &H187
%EQUATE `LB_GETCURSEL = &H188
%EQUATE `LB_GETTEXT = &H189
%EQUATE `LB_GETTEXTLEN = &H18A
%EQUATE `LB_GETCOUNT = &H18B
%EQUATE `LB_SELECTSTRING = &H18C
%EQUATE `LB_DIR = &H18D
%EQUATE `LB_GETTOPINDEX = &H18E
%EQUATE `LB_FINDSTRING = &H18F
%EQUATE `LB_GETSELCOUNT = &H190
%EQUATE `LB_GETSELITEMS = &H191
%EQUATE `LB_SETTABSTOPS = &H192
%EQUATE `LB_GETHORIZONTALEXTENT = &H193
%EQUATE `LB_SETHORIZONTALEXTENT = &H194
%EQUATE `LB_SETCOLUMNWIDTH = &H195
%EQUATE `LB_ADDFILE = &H196
%EQUATE `LB_SETTOPINDEX = &H197
%EQUATE `LB_GETITEMRECT = &H198
%EQUATE `LB_GETITEMDATA = &H199
%EQUATE `LB_SETITEMDATA = &H19A
%EQUATE `LB_SELITEMRANGE = &H19B
%EQUATE `LB_SETANCHORINDEX = &H19C
%EQUATE `LB_GETANCHORINDEX = &H19D
%EQUATE `LB_SETCARETINDEX = &H19E
%EQUATE `LB_GETCARETINDEX = &H19F
%EQUATE `LB_SETITEMHEIGHT = &H1A0
%EQUATE `LB_GETITEMHEIGHT = &H1A1
%EQUATE `LB_FINDSTRINGEXACT = &H1A2
%EQUATE `LB_SETLOCALE = &H1A5
%EQUATE `LB_GETLOCALE = &H1A6
%EQUATE `LB_SETCOUNT = &H1A7
'#if(WINVER >= 0x0400)
%EQUATE `LB_INITSTORAGE = &H1A8
%EQUATE `LB_ITEMFROMPOINT = &H1A9
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WCE >= 0x0400)
%EQUATE `LB_MULTIPLEADDSTRING = &H1B1
'#endif
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `LB_GETLISTBOXINFO = &H1B2
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0501)
'#define LB_MSGMAX 0x01B3
'#elif(_WIN32_WCE >= 0x0400)
'#define LB_MSGMAX 0x01B1
'#elif(WINVER >= 0x0400)
'#define LB_MSGMAX 0x01B0
'#else
'#define LB_MSGMAX 0x01A8
'#endif
%EQUATE `LB_MSGMAX = &H1B3 ' depends on Windows version
'#endif /* !NOWINMESSAGES */
'#ENDIF ' #IF NOT %DEF(%NOWINMESSAGES) ' -------------------------------------
'#IF NOT %DEF(%NOWINSTYLES) ' --------------------------------------------------
'#ifndef NOWINSTYLES
' // Note: The remed LBX_XXX equates are predefined in the compiler.
'/*
' * Listbox Styles
' */
'%LBS_NOTIFY = &H0001
'%LBS_SORT = &H0002
'%LBS_NOREDRAW = &H0004
'%LBS_MULTIPLESEL = &H0008
'%LBS_OWNERDRAWFIXED = &H0010
'%LBS_OWNERDRAWVARIABLE = &H0020
'%LBS_HASSTRINGS = &H0040
'%LBS_USETABSTOPS = &H0080
'%LBS_NOINTEGRALHEIGHT = &H0100
'%LBS_MULTICOLUMN = &H0200
'%LBS_WANTKEYBOARDINPUT = &H0400
'%LBS_EXTENDEDSEL = &H0800
'%LBS_DISABLENOSCROLL = &H1000
'%LBS_NODATA = &H2000
'#if(WINVER >= 0x0400)
'%LBS_NOSEL = &H4000
'#endif /* WINVER >= 0x0400 */
%EQUATE `LBS_COMBOBOX = &H8000
'%LBS_STANDARD = %LBS_NOTIFY OR %LBS_SORT OR %WS_VSCROLL OR %WS_BORDER
'#endif /* !NOWINSTYLES */
'#ENDIF ' #IF NOT %DEF(%NOWINSTYLES) ' ---------------------------------------
'/*
' * Combo Box return Values
' */
%EQUATE `CB_OKAY = 0&
%EQUATE `CB_ERR = -1&
%EQUATE `CB_ERRSPACE = -2&
'/*
' * Combo Box Notification Codes
' */
'%CBN_ERRSPACE = -1&
'%CBN_SELCHANGE = 1&
'%CBN_DBLCLK = 2&
'%CBN_SETFOCUS = 3&
'%CBN_KILLFOCUS = 4&
'%CBN_EDITCHANGE = 5&
'%CBN_EDITUPDATE = 6&
'%CBN_DROPDOWN = 7&
'%CBN_CLOSEUP = 8&
'%CBN_SELENDOK = 9&
'%CBN_SELENDCANCEL = 10&
'%CBN_SELCANCEL = %CBN_SELENDCANCEL
'#IF NOT %DEF(%NOWINSTYLES) ' --------------------------------------------------
'#ifndef NOWINSTYLES
'/*
' * Combo Box styles
' */
'%CBS_SIMPLE = &H0001
'%CBS_DROPDOWN = &H0002
'%CBS_DROPDOWNLIST = &H0003
'%CBS_OWNERDRAWFIXED = &H0010
'%CBS_OWNERDRAWVARIABLE = &H0020
'%CBS_AUTOHSCROLL = &H0040
'%CBS_OEMCONVERT = &H0080
'%CBS_SORT = &H0100
'%CBS_HASSTRINGS = &H0200
'%CBS_NOINTEGRALHEIGHT = &H0400
'%CBS_DISABLENOSCROLL = &H0800
'#if(WINVER >= 0x0400)
'%CBS_UPPERCASE = &H2000
'%CBS_LOWERCASE = &H4000
'#endif /* WINVER >= 0x0400 */
'#endif /* !NOWINSTYLES */
'#ENDIF ' #IF NOT %DEF(%NOWINSTYLES) ' ---------------------------------------
'/*
' * Combo Box messages
' */
'#IF NOT %DEF(%NOWINMESSAGES) ' ------------------------------------------------
'#ifndef NOWINMESSAGES
%EQUATE `CB_GETEDITSEL = &H0140
%EQUATE `CB_LIMITTEXT = &H0141
%EQUATE `CB_SETEDITSEL = &H0142
%EQUATE `CB_ADDSTRING = &H0143
%EQUATE `CB_DELETESTRING = &H0144
%EQUATE `CB_DIR = &H0145
%EQUATE `CB_GETCOUNT = &H0146
%EQUATE `CB_GETCURSEL = &H0147
%EQUATE `CB_GETLBTEXT = &H0148
%EQUATE `CB_GETLBTEXTLEN = &H0149
%EQUATE `CB_INSERTSTRING = &H014A
%EQUATE `CB_RESETCONTENT = &H014B
%EQUATE `CB_FINDSTRING = &H014C
%EQUATE `CB_SELECTSTRING = &H014D
%EQUATE `CB_SETCURSEL = &H014E
%EQUATE `CB_SHOWDROPDOWN = &H014F
%EQUATE `CB_GETITEMDATA = &H0150
%EQUATE `CB_SETITEMDATA = &H0151
%EQUATE `CB_GETDROPPEDCONTROLRECT = &H0152
%EQUATE `CB_SETITEMHEIGHT = &H0153
%EQUATE `CB_GETITEMHEIGHT = &H0154
%EQUATE `CB_SETEXTENDEDUI = &H0155
%EQUATE `CB_GETEXTENDEDUI = &H0156
%EQUATE `CB_GETDROPPEDSTATE = &H0157
%EQUATE `CB_FINDSTRINGEXACT = &H0158
%EQUATE `CB_SETLOCALE = &H0159
%EQUATE `CB_GETLOCALE = &H015A
'#if(WINVER >= 0x0400)
%EQUATE `CB_GETTOPINDEX = &H015B
%EQUATE `CB_SETTOPINDEX = &H015C
%EQUATE `CB_GETHORIZONTALEXTENT = &H015D
%EQUATE `CB_SETHORIZONTALEXTENT = &H015E
%EQUATE `CB_GETDROPPEDWIDTH = &H015F
%EQUATE `CB_SETDROPPEDWIDTH = &H0160
%EQUATE `CB_INITSTORAGE = &H0161
'#if(_WIN32_WCE >= 0x0400)
%EQUATE `CB_MULTIPLEADDSTRING = &H0163
'#endif
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `CB_GETCOMBOBOXINFO = &H0164
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0501)
'#define CB_MSGMAX 0x0165
'#elif(_WIN32_WCE >= 0x0400)
'#define CB_MSGMAX 0x0163
'#elif(WINVER >= 0x0400)
'#define CB_MSGMAX 0x0162
'#else
'#define CB_MSGMAX 0x015B
'#endif
%EQUATE `CB_MSGMAX = &H0165 ' depends on Windows version
'#endif /* !NOWINMESSAGES */
'#ENDIF ' #IF NOT %DEF(%NOWINMESSAGES) ' -----------------------------------
'#IF NOT %DEF(%NOWINSTYLES) ' --------------------------------------------------
'#ifndef NOWINSTYLES
'/*
' * Scroll Bar Styles
' */
'%SBS_HORZ = &H0000
'%SBS_VERT = &H0001
'%SBS_TOPALIGN = &H0002
'%SBS_LEFTALIGN = &H0002
'%SBS_BOTTOMALIGN = &H0004
'%SBS_RIGHTALIGN = &H0004
'%SBS_SIZEBOXTOPLEFTALIGN = &H0002
'%SBS_SIZEBOXBOTTOMRIGHTALIGN = &H0004
'%SBS_SIZEBOX = &H0008
'#if(WINVER >= 0x0400)
'%SBS_SIZEGRIP = &H0010
'#endif /* WINVER >= 0x0400 */
'#endif /* !NOWINSTYLES */
'#ENDIF ' #IF NOT %DEF(%NOWINSTYLES) ' -------------------------------------
'/*
' * Scroll bar messages
' */
'#ifndef NOWINMESSAGES
'#IF NOT %DEF(%NOWINMESSAGES) ' ------------------------------------------------
%EQUATE `SBM_SETPOS = &H0E0 ' not in win3.1
%EQUATE `SBM_GETPOS = &H0E1 ' not in win3.1
%EQUATE `SBM_SETRANGE = &H0E2 ' not in win3.1
%EQUATE `SBM_SETRANGEREDRAW = &H0E6 ' not in win3.1
%EQUATE `SBM_GETRANGE = &H0E3 ' not in win3.1
%EQUATE `SBM_ENABLE_ARROWS = &H0E4 ' not in win3.1
'#if(WINVER >= 0x0400)
%EQUATE `SBM_SETSCROLLINFO = &H0E9
%EQUATE `SBM_GETSCROLLINFO = &H0EA
'#endif /* WINVER >= 0x0400 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `SBM_GETSCROLLBARINFO = &H0EB
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(WINVER >= 0x0400)
'%SIF_RANGE = &H0001
'%SIF_PAGE = &H0002
'%SIF_POS = &H0004
'%SIF_DISABLENOSCROLL = &H000q8???
'%SIF_TRACKPOS = &H0010
'%SIF_ALL = %SIF_RANGE OR %SIF_PAGE OR %SIF_POS OR %SIF_TRACKPOS
' // Size = 28 bytes
TYPE SCROLLINFO DWORD
 cbSize AS DWORD ' UINT
 fMask AS DWORD ' UINT
 nMin AS LONG ' int
 nMax AS LONG ' int
 nPage AS DWORD ' UINT
 nPos AS LONG ' int
 nTrackPos AS LONG ' int
END TYPE
DECLARE FUNCTION SetScrollInfo LIB "user32.dll" ALIAS "SetScrollInfo" ( BYVAL hWnd AS QUAD , BYVAL nBar AS LONG , BYREF lpsi AS SCROLLINFO , BYVAL redraw AS LONG ) AS LONG ' int
DECLARE FUNCTION GetScrollInfo LIB "user32.dll" ALIAS "GetScrollInfo" ( BYVAL hWnd AS QUAD , BYVAL nBar AS LONG , BYREF lpsi AS SCROLLINFO ) AS LONG
'#endif /* WINVER >= 0x0400 */
'#endif /* !NOWINMESSAGES */
'#ENDIF ' #IF NOT %DEF(%NOWINMESSAGES) ' -------------------------------------
'#endif /* !NOCTLMGR */
'#ENDIF ' #IF NOT %DEF(%NOCTLMGR) ' ------------------------------------------
'#IF NOT %DEF(%NOMDI) ' --------------------------------------------------------
'#ifndef NOMDI
'/*
' * MDI client style bits
' */
%EQUATE `MDIS_ALLCHILDSTYLES = &H0001
'/*
' * wParam Flags for WM_MDITILE and WM_MDICASCADE messages.
' */
%EQUATE `MDITILE_VERTICAL = &H0000
%EQUATE `MDITILE_HORIZONTAL = &H0001
%EQUATE `MDITILE_SKIPDISABLED = &H0002
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `MDITILE_ZORDER = &H0004
'#endif /* _WIN32_WINNT >= 0x0500 */
' // Size = 36 bytes
TYPE MDICREATESTRUCTA DWORD
 szClass AS ASCIIZ PTR
 szTitle AS ASCIIZ PTR
 hOwner AS DWORD
 x AS LONG ' int
 y AS LONG ' int
 cx AS LONG ' int
 cy AS LONG ' int
 style AS DWORD
 lParam AS LONG
END TYPE
' // Size = 36 bytes
TYPE MDICREATESTRUCTW DWORD
 szClass AS WSTRINGZ PTR
 szTitle AS WSTRINGZ PTR
 hOwner AS DWORD
 x AS LONG ' int
 y AS LONG ' int
 cx AS LONG ' int
 cy AS LONG ' int
 style AS DWORD
 lParam AS LONG
END TYPE
#IF %DEF(%UNICODE)
MACRO MDICREATESTRUCT = MDICREATESTRUCTW
#ELSE
MACRO MDICREATESTRUCT = MDICREATESTRUCTA
#ENDIF
' // Size = 8 bytes
TYPE CLIENTCREATESTRUCT DWORD
 hWindowMenu AS DWORD
 idFirstChild AS DWORD ' UINT
END TYPE
DECLARE FUNCTION DefFrameProcA LIB "user32.dll" ALIAS "DefFrameProcA" ( BYVAL hWnd AS QUAD , BYVAL hWndMDIClient AS QUAD , BYVAL uMsg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
DECLARE FUNCTION DefFrameProcW LIB "user32.dll" ALIAS "DefFrameProcW" ( BYVAL hWnd AS QUAD , BYVAL hWndMDIClient AS QUAD , BYVAL uMsg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO DefFrameProc = DefFrameProcW
#ELSE
 MACRO DefFrameProc = DefFrameProcA
#ENDIF
DECLARE FUNCTION DefMDIChildProcA LIB "user32.dll" ALIAS "DefMDIChildProcA" ( BYVAL hWnd AS QUAD , BYVAL uMsg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
DECLARE FUNCTION DefMDIChildProcW LIB "user32.dll" ALIAS "DefMDIChildProcW" ( BYVAL hWnd AS QUAD , BYVAL uMsg AS QUAD , BYVAL wParam AS QUAD , BYVAL lParam AS LONG ) AS LONG ' LRESULT
#IF %DEF(%UNICODE)
 MACRO DefMDIChildProc = DefMDIChildProcW
#ELSE
 MACRO DefMDIChildProc = DefMDIChildProcA
#ENDIF
'#IF NOT %DEF(%NOMSG) '---------------------------------------------------------
'#ifndef NOMSG
DECLARE FUNCTION TranslateMDISysAccel LIB "user32.dll" ALIAS "TranslateMDISysAccel" ( BYVAL hWnd AS QUAD , BYREF lpMsg AS tagMSG ) AS LONG
'#endif /* !NOMSG */
'#ENDIF ' #IF NOT %DEF(%NOMSG) '----------------------------------------------
DECLARE FUNCTION ArrangeIconicWindows LIB "user32.dll" ALIAS "ArrangeIconicWindows" ( BYVAL hWnd AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION CreateMDIWindowA LIB "user32.dll" ALIAS "CreateMDIWindowA" ( BYREF lpClassName AS ASCIIZ , BYREF lpWindowName AS ASCIIZ , BYVAL dwStyle AS QUAD , BYVAL X AS LONG , BYVAL Y AS LONG , BYVAL nWidth AS LONG , BYVAL nHeight AS LONG , BYVAL hwndParent AS QUAD , BYVAL hInstance AS QUAD , BYVAL lParam AS LONG ) AS QUAD
DECLARE FUNCTION CreateMDIWindowW LIB "user32.dll" ALIAS "CreateMDIWindowW" ( BYREF lpClassName AS WSTRINGZ
 , BYREF lpWindowName AS WSTRINGZ
 , BYVAL dwStyle AS DWORD
 , BYVAL X AS LONG
 , BYVAL Y AS LONG
 , BYVAL nWidth AS LONG
 , BYVAL nHeight AS LONG
 , BYVAL hwndParent AS DWORD
 , BYVAL hInstance AS DWORD
 , BYVAL lParam AS LONG
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO CreateMDIWindow = CreateMDIWindowW
#ELSE
 MACRO CreateMDIWindow = CreateMDIWindowA
#ENDIF
'#if(WINVER >= 0x0400)
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION TileWindows LIB "User32.dll" ALIAS "TileWindows" (BYVAL hwndParent AS QUAD, BYVAL dwHow AS QUAD, lpRect AS RECT, BYVAL cKids AS QUAD, BYVAL lpKids AS QUAD PTR) AS WORD
#ELSE
DECLARE FUNCTION TileWindows LIB "user32.dll" ALIAS "TileWindows" ( BYVAL hwndParent AS QUAD , BYVAL wHow AS QUAD , BYREF lpRect AS RECT , OPTIONAL BYVAL cKids AS QUAD , OPTIONAL BYREF lpKids AS QUAD ) AS WORD ' WORD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION CascadeWindows LIB "User32.dll" ALIAS "CascadeWindows" (BYVAL hwndParent AS QUAD, BYVAL uHow AS QUAD, lpRect AS RECT, BYVAL cKids AS QUAD, BYVAL lpKids AS QUAD PTR) AS WORD
#ELSE
DECLARE FUNCTION CascadeWindows LIB "user32.dll" ALIAS "CascadeWindows" ( BYVAL hwndParent AS QUAD , BYVAL wHow AS QUAD , BYREF lpRect AS RECT , BYVAL cKids AS QUAD , BYREF lpKids AS QUAD ) AS WORD ' WORD
#ENDIF
'#endif /* WINVER >= 0x0400 */
'#endif /* !NOMDI */
'#ENDIF ' #IF NOT %DEF(%NOMDI) ' ---------------------------------------------
'#endif /* !NOUSER */
'#ENDIF ' #IF NOT %DEF(%NOUSER) ' --------------------------------------------
'/****** Help support ********************************************************/
'#IF NOT %DEF(%NOHELP) ' -------------------------------------------------------
'#ifndef NOHELP
'typedef DWORD HELPPOLY;
TYPE MULTIKEYHELPA BYTE
 mkSize AS DWORD
 mkKeylist AS STRING * 1 ' CHAR
 szKeyphrase AS ASCIIZ * 128 ' CHAR szKeyphrase[1] ' arbitrary string length: change as needed
END TYPE
TYPE MULTIKEYHELPW BYTE
 mkSize AS DWORD ' DWORD mkSize
 mkKeylist AS WSTRING * 1 ' WCHAR mkKeylist
 szKeyphrase AS WSTRINGZ * 128 ' WCHAR szKeyphrase[1] ' arbitrary string length: change as needed
END TYPE
#IF %DEF(%UNICODE)
MACRO MULTIKEYHELP = MULTIKEYHELPW
#ELSE
MACRO MULTIKEYHELP = MULTIKEYHELPA
#ENDIF
' // Size = 28 bytes
TYPE HELPWININFOA DWORD
 wStructSize AS LONG ' int
 x AS LONG ' int
 y AS LONG ' int
 dx AS LONG ' int
 dy AS LONG ' int
 wMax AS LONG ' int
' rgchMember AS ASCIIZ * 2 ' CHAR rgchMember[2]
 rgchMember AS ASCIIZ * 128
END TYPE
' // Size = 28 bytes
TYPE HELPWININFOW DWORD
 wStructSize AS LONG ' int
 x AS LONG ' int
 y AS LONG ' int
 dx AS LONG ' int
 dy AS LONG ' int
 wMax AS LONG ' int
' rgchMember AS WSTRINGZ * 2 ' WCHAR rgchMember[2]
 rgchMember AS WSTRINGZ * 128
END TYPE
#IF %DEF(%UNICODE)
MACRO HELPWININFO = HELPWININFOW
#ELSE
MACRO HELPWININFO = HELPWININFOA
#ENDIF
'/*
' * Commands to pass to WinHelp()
' */
%EQUATE `HELP_CONTEXT = &H0001 ' // Display topic in ulTopic
%EQUATE `HELP_QUIT = &H0002 ' // Terminate help
%EQUATE `HELP_INDEX = &H0003 ' // Display index
%EQUATE `HELP_CONTENTS = &H0003
%EQUATE `HELP_HELPONHELP = &H0004 ' // Display help on using help
%EQUATE `HELP_SETINDEX = &H0005 ' // Set current Index for multi index help
%EQUATE `HELP_SETCONTENTS = &H0005
%EQUATE `HELP_CONTEXTPOPUP = &H0008
%EQUATE `HELP_FORCEFILE = &H0009
%EQUATE `HELP_KEY = &H0101 ' // Display topic for keyword in offabData
%EQUATE `HELP_COMMAND = &H0102
%EQUATE `HELP_PARTIALKEY = &H0105
%EQUATE `HELP_MULTIKEY = &H0201
%EQUATE `HELP_SETWINPOS = &H0203
'#if(WINVER >= 0x0400)
%EQUATE `HELP_CONTEXTMENU = &H000a
%EQUATE `HELP_FINDER = &H000b
%EQUATE `HELP_WM_HELP = &H000c
%EQUATE `HELP_SETPOPUP_POS = &H000d
%EQUATE `HELP_TCARD = &H8000
%EQUATE `HELP_TCARD_DATA = &H0010
%EQUATE `HELP_TCARD_OTHER_CALLER = &H0011
'// These are in winhelp.h in Win95.
%EQUATE `IDH_NO_HELP = 28440
%EQUATE `IDH_MISSING_CONTEXT = 28441 ' // Control doesn't have matching help context
%EQUATE `IDH_GENERIC_HELP_BUTTON = 28442 ' // Property sheet help button
%EQUATE `IDH_OK = 28443
%EQUATE `IDH_CANCEL = 28444
%EQUATE `IDH_HELP = 28445
'#endif /* WINVER >= 0x0400 */
DECLARE FUNCTION WinHelpA LIB "user32.dll" ALIAS "WinHelpA" ( BYVAL hWndMain AS QUAD , BYREF lpszHelp AS ASCIIZ , BYVAL uCommand AS QUAD , BYVAL dwData AS QUAD ) AS LONG
DECLARE FUNCTION WinHelpW LIB "user32.dll" ALIAS "WinHelpW" ( BYVAL hWndMain AS QUAD
 , BYREF lpszHelp AS WSTRINGZ
 , BYVAL uCommand AS DWORD
 , BYVAL dwData AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO WinHelp = WinHelpW
#ELSE
 MACRO WinHelp = WinHelpA
#ENDIF
'#endif /* !NOHELP */
'#ENDIF ' #IF NOT %DEF(%NOHELP) ' --------------------------------------------
'#if(WINVER >= 0x0500)
%EQUATE `GR_GDIOBJECTS = 0& ' Count of GDI objects
%EQUATE `GR_USEROBJECTS = 1& ' Count of USER objects
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0601)
%EQUATE `GR_GDIOBJECTS_PEAK = 2 ' /* Peak count of GDI objects */
%EQUATE `GR_USEROBJECTS_PEAK = 4 ' /* Peak count of USER objects */
'#endif /* WINVER >= 0x0601 */
'#if(WINVER >= 0x0601)
%EQUATE `GR_GLOBAL = -2 ' ((HANDLE)-2)
'#endif /* WINVER >= 0x0601 */
'#if(WINVER >= 0x0500)
DECLARE FUNCTION GetGuiResources LIB "user32.dll" ALIAS "GetGuiResources" ( BYVAL hProcess AS QUAD , BYVAL uiFlags AS QUAD ) AS QUAD
'#endif /* WINVER >= 0x0500 */
'#IF NOT %DEF(%NOSYSPARAMSINFO) ' ----------------------------------------------
'#ifndef NOSYSPARAMSINFO
'/*
' * Parameter for SystemParametersInfo
' */
%EQUATE `SPI_GETBEEP = &H0001
%EQUATE `SPI_SETBEEP = &H0002
%EQUATE `SPI_GETMOUSE = &H0003
%EQUATE `SPI_SETMOUSE = &H0004
%EQUATE `SPI_GETBORDER = &H0005
%EQUATE `SPI_SETBORDER = &H0006
%EQUATE `SPI_GETKEYBOARDSPEED = &H000A
%EQUATE `SPI_SETKEYBOARDSPEED = &H000B
%EQUATE `SPI_LANGDRIVER = &H000C
%EQUATE `SPI_ICONHORIZONTALSPACING = &H000D
%EQUATE `SPI_GETSCREENSAVETIMEOUT = &H000E
%EQUATE `SPI_SETSCREENSAVETIMEOUT = &H000F
%EQUATE `SPI_GETSCREENSAVEACTIVE = &H0010
%EQUATE `SPI_SETSCREENSAVEACTIVE = &H0011
%EQUATE `SPI_GETGRIDGRANULARITY = &H0012
%EQUATE `SPI_SETGRIDGRANULARITY = &H0013
%EQUATE `SPI_SETDESKWALLPAPER = &H0014
%EQUATE `SPI_SETDESKPATTERN = &H0015
%EQUATE `SPI_GETKEYBOARDDELAY = &H0016
%EQUATE `SPI_SETKEYBOARDDELAY = &H0017
%EQUATE `SPI_ICONVERTICALSPACING = &H0018
%EQUATE `SPI_GETICONTITLEWRAP = &H0019
%EQUATE `SPI_SETICONTITLEWRAP = &H001A
%EQUATE `SPI_GETMENUDROPALIGNMENT = &H001B
%EQUATE `SPI_SETMENUDROPALIGNMENT = &H001C
%EQUATE `SPI_SETDOUBLECLKWIDTH = &H001D
%EQUATE `SPI_SETDOUBLECLKHEIGHT = &H001E
%EQUATE `SPI_GETICONTITLELOGFONT = &H001F
%EQUATE `SPI_SETDOUBLECLICKTIME = &H0020
%EQUATE `SPI_SETMOUSEBUTTONSWAP = &H0021
%EQUATE `SPI_SETICONTITLELOGFONT = &H0022
%EQUATE `SPI_GETFASTTASKSWITCH = &H0023
%EQUATE `SPI_SETFASTTASKSWITCH = &H0024
'#if(WINVER >= = &H0400)
%EQUATE `SPI_SETDRAGFULLWINDOWS = &H0025
%EQUATE `SPI_GETDRAGFULLWINDOWS = &H0026
%EQUATE `SPI_GETNONCLIENTMETRICS = &H0029
%EQUATE `SPI_SETNONCLIENTMETRICS = &H002A
%EQUATE `SPI_GETMINIMIZEDMETRICS = &H002B
%EQUATE `SPI_SETMINIMIZEDMETRICS = &H002C
%EQUATE `SPI_GETICONMETRICS = &H002D
%EQUATE `SPI_SETICONMETRICS = &H002E
%EQUATE `SPI_SETWORKAREA = &H002F
%EQUATE `SPI_GETWORKAREA = &H0030
%EQUATE `SPI_SETPENWINDOWS = &H0031
%EQUATE `SPI_GETHIGHCONTRAST = &H0042
%EQUATE `SPI_SETHIGHCONTRAST = &H0043
%EQUATE `SPI_GETKEYBOARDPREF = &H0044
%EQUATE `SPI_SETKEYBOARDPREF = &H0045
%EQUATE `SPI_GETSCREENREADER = &H0046
%EQUATE `SPI_SETSCREENREADER = &H0047
%EQUATE `SPI_GETANIMATION = &H0048
%EQUATE `SPI_SETANIMATION = &H0049
%EQUATE `SPI_GETFONTSMOOTHING = &H004A
%EQUATE `SPI_SETFONTSMOOTHING = &H004B
%EQUATE `SPI_SETDRAGWIDTH = &H004C
%EQUATE `SPI_SETDRAGHEIGHT = &H004D
%EQUATE `SPI_SETHANDHELD = &H004E
%EQUATE `SPI_GETLOWPOWERTIMEOUT = &H004F
%EQUATE `SPI_GETPOWEROFFTIMEOUT = &H0050
%EQUATE `SPI_SETLOWPOWERTIMEOUT = &H0051
%EQUATE `SPI_SETPOWEROFFTIMEOUT = &H0052
%EQUATE `SPI_GETLOWPOWERACTIVE = &H0053
%EQUATE `SPI_GETPOWEROFFACTIVE = &H0054
%EQUATE `SPI_SETLOWPOWERACTIVE = &H0055
%EQUATE `SPI_SETPOWEROFFACTIVE = &H0056
%EQUATE `SPI_SETCURSORS = &H0057
%EQUATE `SPI_SETICONS = &H0058
%EQUATE `SPI_GETDEFAULTINPUTLANG = &H0059
%EQUATE `SPI_SETDEFAULTINPUTLANG = &H005A
%EQUATE `SPI_SETLANGTOGGLE = &H005B
%EQUATE `SPI_GETWINDOWSEXTENSION = &H005C
%EQUATE `SPI_SETMOUSETRAILS = &H005D
%EQUATE `SPI_GETMOUSETRAILS = &H005E
%EQUATE `SPI_SETSCREENSAVERRUNNING = &H0061
%EQUATE `SPI_SCREENSAVERRUNNING = %SPI_SETSCREENSAVERRUNNING
'#endif /* WINVER >= = &H0400 */
%EQUATE `SPI_GETFILTERKEYS = &H0032
%EQUATE `SPI_SETFILTERKEYS = &H0033
%EQUATE `SPI_GETTOGGLEKEYS = &H0034
%EQUATE `SPI_SETTOGGLEKEYS = &H0035
%EQUATE `SPI_GETMOUSEKEYS = &H0036
%EQUATE `SPI_SETMOUSEKEYS = &H0037
%EQUATE `SPI_GETSHOWSOUNDS = &H0038
%EQUATE `SPI_SETSHOWSOUNDS = &H0039
%EQUATE `SPI_GETSTICKYKEYS = &H003A
%EQUATE `SPI_SETSTICKYKEYS = &H003B
%EQUATE `SPI_GETACCESSTIMEOUT = &H003C
%EQUATE `SPI_SETACCESSTIMEOUT = &H003D
'#if(WINVER >= = &H0400)
%EQUATE `SPI_GETSERIALKEYS = &H003E
%EQUATE `SPI_SETSERIALKEYS = &H003F
'#endif /* WINVER >= = &H0400 */
%EQUATE `SPI_GETSOUNDSENTRY = &H0040
%EQUATE `SPI_SETSOUNDSENTRY = &H0041
'#if(_WIN32_WINNT >= = &H0400)
%EQUATE `SPI_GETSNAPTODEFBUTTON = &H005F
%EQUATE `SPI_SETSNAPTODEFBUTTON = &H0060
'#endif /* _WIN32_WINNT >= = &H0400 */
'#if (_WIN32_WINNT >= = &H0400) || (_WIN32_WINDOWS > = &H0400)
%EQUATE `SPI_GETMOUSEHOVERWIDTH = &H0062
%EQUATE `SPI_SETMOUSEHOVERWIDTH = &H0063
%EQUATE `SPI_GETMOUSEHOVERHEIGHT = &H0064
%EQUATE `SPI_SETMOUSEHOVERHEIGHT = &H0065
%EQUATE `SPI_GETMOUSEHOVERTIME = &H0066
%EQUATE `SPI_SETMOUSEHOVERTIME = &H0067
%EQUATE `SPI_GETWHEELSCROLLLINES = &H0068
%EQUATE `SPI_SETWHEELSCROLLLINES = &H0069
%EQUATE `SPI_GETMENUSHOWDELAY = &H006A
%EQUATE `SPI_SETMENUSHOWDELAY = &H006B
'#if (_WIN32_WINNT >= 0x0600)
%EQUATE `SPI_GETWHEELSCROLLCHARS = &H006C
%EQUATE `SPI_SETWHEELSCROLLCHARS = &H006D
'#endif
%EQUATE `SPI_GETSHOWIMEUI = &H006E
%EQUATE `SPI_SETSHOWIMEUI = &H006F
'#endif
'#if(WINVER >= 0x0500)
%EQUATE `SPI_GETMOUSESPEED = &H0070
%EQUATE `SPI_SETMOUSESPEED = &H0071
%EQUATE `SPI_GETSCREENSAVERRUNNING = &H0072
%EQUATE `SPI_GETDESKWALLPAPER = &H0073
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0600)
%EQUATE `SPI_GETAUDIODESCRIPTION = &H0074
%EQUATE `SPI_SETAUDIODESCRIPTION = &H0075
%EQUATE `SPI_GETSCREENSAVESECURE = &H0076
%EQUATE `SPI_SETSCREENSAVESECURE = &H0077
'#endif /* WINVER >= 0x0600 */
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `SPI_GETHUNGAPPTIMEOUT = &H0078
%EQUATE `SPI_SETHUNGAPPTIMEOUT = &H0079
%EQUATE `SPI_GETWAITTOKILLTIMEOUT = &H007A
%EQUATE `SPI_SETWAITTOKILLTIMEOUT = &H007B
%EQUATE `SPI_GETWAITTOKILLSERVICETIMEOUT = &H007C
%EQUATE `SPI_SETWAITTOKILLSERVICETIMEOUT = &H007D
%EQUATE `SPI_GETMOUSEDOCKTHRESHOLD = &H007E
%EQUATE `SPI_SETMOUSEDOCKTHRESHOLD = &H007F
%EQUATE `SPI_GETPENDOCKTHRESHOLD = &H0080
%EQUATE `SPI_SETPENDOCKTHRESHOLD = &H0081
%EQUATE `SPI_GETWINARRANGING = &H0082
%EQUATE `SPI_SETWINARRANGING = &H0083
%EQUATE `SPI_GETMOUSEDRAGOUTTHRESHOLD = &H0084
%EQUATE `SPI_SETMOUSEDRAGOUTTHRESHOLD = &H0085
%EQUATE `SPI_GETPENDRAGOUTTHRESHOLD = &H0086
%EQUATE `SPI_SETPENDRAGOUTTHRESHOLD = &H0087
%EQUATE `SPI_GETMOUSESIDEMOVETHRESHOLD = &H0088
%EQUATE `SPI_SETMOUSESIDEMOVETHRESHOLD = &H0089
%EQUATE `SPI_GETPENSIDEMOVETHRESHOLD = &H008A
%EQUATE `SPI_SETPENSIDEMOVETHRESHOLD = &H008B
%EQUATE `SPI_GETDRAGFROMMAXIMIZE = &H008C
%EQUATE `SPI_SETDRAGFROMMAXIMIZE = &H008D
%EQUATE `SPI_GETSNAPSIZING = &H008E
%EQUATE `SPI_SETSNAPSIZING = &H008F
%EQUATE `SPI_GETDOCKMOVING = &H0090
%EQUATE `SPI_SETDOCKMOVING = &H0091
'#endif /* _WIN32_WINNT >= 0x0601 */
'#if(WINVER >= 0x0500)
%EQUATE `SPI_GETACTIVEWINDOWTRACKING = &H1000
%EQUATE `SPI_SETACTIVEWINDOWTRACKING = &H1001
%EQUATE `SPI_GETMENUANIMATION = &H1002
%EQUATE `SPI_SETMENUANIMATION = &H1003
%EQUATE `SPI_GETCOMBOBOXANIMATION = &H1004
%EQUATE `SPI_SETCOMBOBOXANIMATION = &H1005
%EQUATE `SPI_GETLISTBOXSMOOTHSCROLLING = &H1006
%EQUATE `SPI_SETLISTBOXSMOOTHSCROLLING = &H1007
%EQUATE `SPI_GETGRADIENTCAPTIONS = &H1008
%EQUATE `SPI_SETGRADIENTCAPTIONS = &H1009
%EQUATE `SPI_GETKEYBOARDCUES = &H100A
%EQUATE `SPI_SETKEYBOARDCUES = &H100B
%EQUATE `SPI_GETMENUUNDERLINES = %SPI_GETKEYBOARDCUES
%EQUATE `SPI_SETMENUUNDERLINES = %SPI_SETKEYBOARDCUES
%EQUATE `SPI_GETACTIVEWNDTRKZORDER = &H100C
%EQUATE `SPI_SETACTIVEWNDTRKZORDER = &H100D
%EQUATE `SPI_GETHOTTRACKING = &H100E
%EQUATE `SPI_SETHOTTRACKING = &H100F
%EQUATE `SPI_GETMENUFADE = &H1012
%EQUATE `SPI_SETMENUFADE = &H1013
%EQUATE `SPI_GETSELECTIONFADE = &H1014
%EQUATE `SPI_SETSELECTIONFADE = &H1015
%EQUATE `SPI_GETTOOLTIPANIMATION = &H1016
%EQUATE `SPI_SETTOOLTIPANIMATION = &H1017
%EQUATE `SPI_GETTOOLTIPFADE = &H1018
%EQUATE `SPI_SETTOOLTIPFADE = &H1019
%EQUATE `SPI_GETCURSORSHADOW = &H101A
%EQUATE `SPI_SETCURSORSHADOW = &H101B
'#if(_WIN32_WINNT >= = &H0501)
%EQUATE `SPI_GETMOUSESONAR = &H101C
%EQUATE `SPI_SETMOUSESONAR = &H101D
%EQUATE `SPI_GETMOUSECLICKLOCK = &H101E
%EQUATE `SPI_SETMOUSECLICKLOCK = &H101F
%EQUATE `SPI_GETMOUSEVANISH = &H1020
%EQUATE `SPI_SETMOUSEVANISH = &H1021
%EQUATE `SPI_GETFLATMENU = &H1022
%EQUATE `SPI_SETFLATMENU = &H1023
%EQUATE `SPI_GETDROPSHADOW = &H1024
%EQUATE `SPI_SETDROPSHADOW = &H1025
%EQUATE `SPI_GETBLOCKSENDINPUTRESETS = &H1026
%EQUATE `SPI_SETBLOCKSENDINPUTRESETS = &H1027
'#endif /* _WIN32_WINNT >= = &H0501 */
%EQUATE `SPI_GETUIEFFECTS = &H103E
%EQUATE `SPI_SETUIEFFECTS = &H103F
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `SPI_GETDISABLEOVERLAPPEDCONTENT = &H1040
%EQUATE `SPI_SETDISABLEOVERLAPPEDCONTENT = &H1041
%EQUATE `SPI_GETCLIENTAREAANIMATION = &H1042
%EQUATE `SPI_SETCLIENTAREAANIMATION = &H1043
%EQUATE `SPI_GETCLEARTYPE = &H1048
%EQUATE `SPI_SETCLEARTYPE = &H1049
%EQUATE `SPI_GETSPEECHRECOGNITION = &H104A
%EQUATE `SPI_SETSPEECHRECOGNITION = &H104B
'#endif /* _WIN32_WINNT >= 0x0600 */
%EQUATE `SPI_GETFOREGROUNDLOCKTIMEOUT = &H2000
%EQUATE `SPI_SETFOREGROUNDLOCKTIMEOUT = &H2001
%EQUATE `SPI_GETACTIVEWNDTRKTIMEOUT = &H2002
%EQUATE `SPI_SETACTIVEWNDTRKTIMEOUT = &H2003
%EQUATE `SPI_GETFOREGROUNDFLASHCOUNT = &H2004
%EQUATE `SPI_SETFOREGROUNDFLASHCOUNT = &H2005
%EQUATE `SPI_GETCARETWIDTH = &H2006
%EQUATE `SPI_SETCARETWIDTH = &H2007
'#if(_WIN32_WINNT >= = &H0501)
%EQUATE `SPI_GETMOUSECLICKLOCKTIME = &H2008
%EQUATE `SPI_SETMOUSECLICKLOCKTIME = &H2009
%EQUATE `SPI_GETFONTSMOOTHINGTYPE = &H200A
%EQUATE `SPI_SETFONTSMOOTHINGTYPE = &H200B
'/* constants for SPI_GETFONTSMOOTHINGTYPE and SPI_SETFONTSMOOTHINGTYPE: */
%EQUATE `FE_FONTSMOOTHINGSTANDARD = &H0001
%EQUATE `FE_FONTSMOOTHINGCLEARTYPE = &H0002
'%FE_FONTSMOOTHINGDOCKING = &H8000 ' // Removed in the Windows 7 SDK
%EQUATE `SPI_GETFONTSMOOTHINGCONTRAST = &H200C
%EQUATE `SPI_SETFONTSMOOTHINGCONTRAST = &H200D
%EQUATE `SPI_GETFOCUSBORDERWIDTH = &H200E
%EQUATE `SPI_SETFOCUSBORDERWIDTH = &H200F
%EQUATE `SPI_GETFOCUSBORDERHEIGHT = &H2010
%EQUATE `SPI_SETFOCUSBORDERHEIGHT = &H2011
%EQUATE `SPI_GETFONTSMOOTHINGORIENTATION = &H2012
%EQUATE `SPI_SETFONTSMOOTHINGORIENTATION = &H2013
'/* constants for SPI_GETFONTSMOOTHINGORIENTATION and SPI_SETFONTSMOOTHINGORIENTATION: */
%EQUATE `FE_FONTSMOOTHINGORIENTATIONBGR = &H0000
%EQUATE `FE_FONTSMOOTHINGORIENTATIONRGB = &H0001
'#endif /* _WIN32_WINNT >= = &H0501 */
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `SPI_GETMINIMUMHITRADIUS = &H2014
%EQUATE `SPI_SETMINIMUMHITRADIUS = &H2015
%EQUATE `SPI_GETMESSAGEDURATION = &H2016
%EQUATE `SPI_SETMESSAGEDURATION = &H2017
'#endif /* _WIN32_WINNT >= 0x0600 */
'#endif /* WINVER >= = &H0500 */
'/*
' * Flags
' */
%EQUATE `SPIF_UPDATEINIFILE = &H0001
%EQUATE `SPIF_SENDWININICHANGE = &H0002
%EQUATE `SPIF_SENDCHANGE = %SPIF_SENDWININICHANGE
%EQUATE `METRICS_USEDEFAULT = -1&
' Note: If the iPaddedBorderWidth member of the NONCLIENTMETRICS structure is present,
' this structure is 4 bytes larger than for an application that is compiled with
' WINVER less than or equal to &H0502.
' If an application that is compiled for Windows Server 2008 or Windows Vista
' must also run on Windows Server 2003 or Windows XP/2000, use the GetVersionEx
' function to check the operating system version at run time and, if the
' application is running on Windows Server 2003 or Windows XP/2000, subtract the
' size of the iPaddedBorderWidth member from the cbSize member of the
' NONCLIENTMETRICS structure before calling the SystemParametersInfo function,
' e.g. cbSize = SIZEOF(NONCLIENTMETRICS) - 4.
' // Size = 344 bytes
TYPE NONCLIENTMETRICSA DWORD
 cbSize AS DWORD ' UINT
 iBorderWidth AS LONG ' int
 iScrollWidth AS LONG ' int
 iScrollHeight AS LONG ' int
 iCaptionWidth AS LONG ' int
 iCaptionHeight AS LONG ' int
 lfCaptionFont AS LOGFONTA ' LOGFONTA
 iSMCaptionWidth AS LONG ' int
 iSMCaptionHeight AS LONG ' int
 lfSMCaptionFont AS LOGFONTA ' LOGFONTA
 iMenuWidth AS LONG ' int
 iMenuHeight AS LONG ' int
 lfMenuFont AS LOGFONTA ' LOGFONTA
 lfStatusFont AS LOGFONTA ' LOGFONTA
 lfMessageFont AS LOGFONTA ' LOGFONTA
#IF %WINVER >= &H0600
 iPaddedBorderWidth AS LONG
#ENDIF ' /* WINVER >= 0x0600 */
END TYPE
' // Size = 504 bytes
TYPE NONCLIENTMETRICSW DWORD
 cbSize AS DWORD ' UINT
 iBorderWidth AS LONG ' int
 iScrollWidth AS LONG ' int
 iScrollHeight AS LONG ' int
 iCaptionWidth AS LONG ' int
 iCaptionHeight AS LONG ' int
 lfCaptionFont AS LOGFONTW ' LOGFONTW
 iSMCaptionWidth AS LONG ' int
 iSMCaptionHeight AS LONG ' int
 lfSMCaptionFont AS LOGFONTW ' LOGFONTW
 iMenuWidth AS LONG ' int
 iMenuHeight AS LONG ' int
 lfMenuFont AS LOGFONTW ' LOGFONTW
 lfStatusFont AS LOGFONTW ' LOGFONTW
 lfMessageFont AS LOGFONTW ' LOGFONTW
#IF %WINVER >= &H0600
 iPaddedBorderWidth AS LONG
#ENDIF ' /* WINVER >= 0x0600 */
END TYPE
#IF %DEF(%UNICODE)
MACRO NONCLIENTMETRICS = NONCLIENTMETRICSW
#ELSE
MACRO NONCLIENTMETRICS = NONCLIENTMETRICSA
#ENDIF
%EQUATE `ARW_BOTTOMLEFT = &H0000
%EQUATE `ARW_BOTTOMRIGHT = &H0001
%EQUATE `ARW_TOPLEFT = &H0002
%EQUATE `ARW_TOPRIGHT = &H0003
%EQUATE `ARW_STARTMASK = &H0003
%EQUATE `ARW_STARTRIGHT = &H0001
%EQUATE `ARW_STARTTOP = &H0002
%EQUATE `ARW_LEFT = &H0000
%EQUATE `ARW_RIGHT = &H0000
%EQUATE `ARW_UP = &H0004
%EQUATE `ARW_DOWN = &H0004
%EQUATE `ARW_HIDE = &H0008
' // Size = 20 bytes
TYPE MINIMIZEDMETRICS DWORD
 cbSize AS DWORD ' UINT
 iWidth AS LONG ' int
 iHorzGap AS LONG ' int
 iVertGap AS LONG ' int
 iArrange AS LONG ' int
END TYPE
'#IF %DEF(%WINGDI) ' -----------------------------------------------------------
'#IF NOT %DEF(%NOGDI) ' --------------------------------------------------------
'#ifdef _WINGDI_
'#ifndef NOGDI
' // Size = 76 bytes
TYPE ICONMETRICSA DWORD
 cbSize AS DWORD ' UINT
 iHorzSpacing AS LONG ' int
 iVertSpacing AS LONG ' int
 iTitleWrap AS LONG ' int
 lfFont AS LOGFONT ' LOGFONTA
END TYPE
' // Size = 108 bytes
TYPE ICONMETRICSW DWORD
 cbSize AS DWORD ' UINT
 iHorzSpacing AS LONG ' int
 iVertSpacing AS LONG ' int
 iTitleWrap AS LONG ' int
 lfFont AS LOGFONTW ' LOGFONTW
END TYPE
#IF %DEF(%UNICODE)
MACRO ICONMETRICS = ICONMETRICSW
#ELSE
MACRO ICONMETRICS = ICONMETRICSA
#ENDIF
'#endif /* NOGDI */
'#endif /* _WINGDI_ */
'#ENDIF ' #IF NOT %DEF(%NOGDI) ' ---------------------------------------------
'#ENDIF ' #IF DEF(%WINGDI) ' -------------------------------------------------
' // Size = 8 bytes
TYPE ANIMATIONINFO DWORD
 cbSize AS DWORD ' UINT
 iMinAnimate AS LONG ' int
END TYPE
' // Size = 28 bytes
TYPE SERIALKEYSA DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 lpszActivePort AS ASCIIZ PTR
 lpszPort AS ASCIIZ PTR
 iBaudRate AS DWORD ' UINT
 iPortState AS DWORD ' UINT
 iActive AS DWORD ' UINT
END TYPE
' // Size = 28 bytes
TYPE SERIALKEYSW DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 lpszActivePort AS WSTRINGZ PTR
 lpszPort AS WSTRINGZ PTR
 iBaudRate AS DWORD ' UINT
 iPortState AS DWORD ' UINT
 iActive AS DWORD ' UINT
END TYPE
#IF %DEF(%UNICODE)
MACRO SERIALKEYS = SERIALKEYSW
#ELSE
MACRO SERIALKEYS = SERIALKEYSA
#ENDIF
'/* flags for SERIALKEYS dwFlags field */
%EQUATE `SERKF_SERIALKEYSON = &H00000001
%EQUATE `SERKF_AVAILABLE = &H00000002
%EQUATE `SERKF_INDICATOR = &H00000004
' // Size = 12 bytes
TYPE HIGHCONTRASTA DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 lpszDefaultScheme AS ASCIIZ PTR
END TYPE
' // Size = 12 bytes
TYPE HIGHCONTRASTW DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 lpszDefaultScheme AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
MACRO HIGHCONTRAST = HIGHCONTRASTW
#ELSE
MACRO HIGHCONTRAST = HIGHCONTRASTA
#ENDIF
'/* flags for HIGHCONTRAST dwFlags field */
%EQUATE `HCF_HIGHCONTRASTON = &H00000001
%EQUATE `HCF_AVAILABLE = &H00000002
%EQUATE `HCF_HOTKEYACTIVE = &H00000004
%EQUATE `HCF_CONFIRMHOTKEY = &H00000008
%EQUATE `HCF_HOTKEYSOUND = &H00000010
%EQUATE `HCF_INDICATOR = &H00000020
%EQUATE `HCF_HOTKEYAVAILABLE = &H00000040
%EQUATE `HCF_LOGONDESKTOP = &H00000100
%EQUATE `HCF_DEFAULTDESKTOP = &H00000200
'/* Flags for ChangeDisplaySettings */
%EQUATE `CDS_UPDATEREGISTRY = &H00000001
%EQUATE `CDS_TEST = &H00000002
%EQUATE `CDS_FULLSCREEN = &H00000004
%EQUATE `CDS_GLOBAL = &H00000008
%EQUATE `CDS_SET_PRIMARY = &H00000010
%EQUATE `CDS_VIDEOPARAMETERS = &H00000020
'#if(WINVER >= 0x0600)
%EQUATE `CDS_ENABLE_UNSAFE_MODES = &H00000100
%EQUATE `CDS_DISABLE_UNSAFE_MODES = &H00000200
'#endif /* WINVER >= 0x0600 */
%EQUATE `CDS_RESET = &H40000000
%EQUATE `CDS_RESET_EX = &H20000000
%EQUATE `CDS_NORESET = &H10000000
'#include <tvout.h>
#INCLUDE ONCE "Legacy/System/Tvout.inc"
'/* Return values for ChangeDisplaySettings */
%EQUATE `DISP_CHANGE_SUCCESSFUL = 0&
%EQUATE `DISP_CHANGE_RESTART = 1&
%EQUATE `DISP_CHANGE_FAILED = -1&
%EQUATE `DISP_CHANGE_BADMODE = -2&
%EQUATE `DISP_CHANGE_NOTUPDATED = -3&
%EQUATE `DISP_CHANGE_BADFLAGS = -4&
%EQUATE `DISP_CHANGE_BADPARAM = -5&
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `DISP_CHANGE_BADDUALVIEW = -6&
'#endif /* _WIN32_WINNT >= 0x0501 */
'#ifdef _WINGDI_
'#ifndef NOGDI
DECLARE FUNCTION ChangeDisplaySettingsA LIB "user32.dll" ALIAS "ChangeDisplaySettingsA" ( BYREF lpDevMode AS DEVMODEA , BYVAL dwFlags AS QUAD ) AS LONG ' long
DECLARE FUNCTION ChangeDisplaySettingsW LIB "user32.dll" ALIAS "ChangeDisplaySettingsW" ( BYREF lpDevMode AS DEVMODEW , BYVAL dwFlags AS QUAD ) AS LONG ' long
#IF %DEF(%UNICODE)
 MACRO ChangeDisplaySettings = ChangeDisplaySettingsW
#ELSE
 MACRO ChangeDisplaySettings = ChangeDisplaySettingsA
#ENDIF
DECLARE FUNCTION ChangeDisplaySettingsExA LIB "user32.dll" ALIAS "ChangeDisplaySettingsExA" ( BYREF lpszDeviceName AS ASCIIZ , BYREF lpDevMode AS DEVMODEA , BYVAL hwnd AS QUAD , BYVAL dwflags AS QUAD , OPTIONAL BYREF lParam AS ANY ) AS LONG ' long
DECLARE FUNCTION ChangeDisplaySettingsExW LIB "user32.dll" ALIAS "ChangeDisplaySettingsExW" ( BYREF lpszDeviceName AS WSTRINGZ , BYREF lpDevMode AS DEVMODEW , BYVAL hwnd AS QUAD , BYVAL dwflags AS QUAD , OPTIONAL BYREF lParam AS ANY ) AS LONG ' long
#IF %DEF(%UNICODE)
 MACRO ChangeDisplaySettingsEx = ChangeDisplaySettingsExW
#ELSE
 MACRO ChangeDisplaySettingsEx = ChangeDisplaySettingsExA
#ENDIF
%EQUATE `ENUM_CURRENT_SETTINGS = &HFFFFFFFF ' ((DWORD)-1)
%EQUATE `ENUM_REGISTRY_SETTINGS = &HFFFFFFFE ' ((DWORD)-2)
DECLARE FUNCTION EnumDisplaySettingsA LIB "user32.dll" ALIAS "EnumDisplaySettingsA" ( BYREF lpszDeviceName AS ASCIIZ , BYVAL iModeNum AS QUAD , BYREF lpDevMode AS DEVMODEA ) AS LONG
DECLARE FUNCTION EnumDisplaySettingsW LIB "user32.dll" ALIAS "EnumDisplaySettingsW" ( BYREF lpszDeviceName AS WSTRINGZ
 , BYVAL iModeNum AS DWORD
 , BYREF lpDevMode AS DEVMODEW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO EnumDisplaySettings = EnumDisplaySettingsW
#ELSE
 MACRO EnumDisplaySettings = EnumDisplaySettingsA
#ENDIF
'#if(WINVER >= 0x0500)
DECLARE FUNCTION EnumDisplaySettingsExA LIB "user32.dll" ALIAS "EnumDisplaySettingsExA" ( BYREF lpszDeviceName AS ASCIIZ , BYVAL iModeNum AS QUAD , BYREF lpDevMode AS DEVMODEA , BYVAL dwFlags AS QUAD ) AS LONG
DECLARE FUNCTION EnumDisplaySettingsExW LIB "user32.dll" ALIAS "EnumDisplaySettingsExW" ( BYREF lpszDeviceName AS WSTRINGZ
 , BYVAL iModeNum AS DWORD
 , BYREF lpDevMode AS DEVMODEW
 , BYVAL dwFlags AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO EnumDisplaySettingsEx = EnumDisplaySettingsExW
#ELSE
 MACRO EnumDisplaySettingsEx = EnumDisplaySettingsExA
#ENDIF
'/* Flags for EnumDisplaySettingsEx */
%EQUATE `EDS_RAWMODE = &H00000002
%EQUATE `EDS_ROTATEDMODE = &H00000004
DECLARE FUNCTION EnumDisplayDevicesA LIB "user32.dll" ALIAS "EnumDisplayDevicesA" ( BYREF lpDevice AS ASCIIZ , BYVAL iDevNum AS QUAD , BYREF lpDisplayDevice AS DISPLAY_DEVICEA , BYVAL dwFlags AS QUAD ) AS LONG
DECLARE FUNCTION EnumDisplayDevicesW LIB "user32.dll" ALIAS "EnumDisplayDevicesW" ( BYREF lpDevice AS WSTRINGZ
 , BYVAL iDevNum AS DWORD
 , BYREF lpDisplayDevice AS DISPLAY_DEVICEW
 , BYVAL dwFlags AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO EnumDisplayDevices = EnumDisplayDevicesW
#ELSE
 MACRO EnumDisplayDevices = EnumDisplayDevicesA
#ENDIF
'/* Flags for EnumDisplayDevices */
%EQUATE `EDD_GET_DEVICE_INTERFACE_NAME = &H00000001
'#endif /* WINVER >= 0x0500 */
'#if(WINVER >= 0x0601)
DECLARE FUNCTION GetDisplayConfigBufferSizes LIB "user32.dll" ALIAS "GetDisplayConfigBufferSizes" ( BYVAL flags AS QUAD , BYREF numPathArrayElements AS QUAD , BYREF numModeInfoArrayElements AS QUAD ) AS LONG
DECLARE FUNCTION SetDisplayConfig LIB "user32.dll" ALIAS "SetDisplayConfig" ( BYVAL numPathArrayElements AS QUAD
 , BYREF pathArray AS DISPLAYCONFIG_PATH_INFO
 , BYVAL numModeInfoArrayElements AS DWORD
 , BYREF modeInfoArray AS DISPLAYCONFIG_MODE_INFO
 , BYVAL flags AS DWORD
 ) AS LONG
DECLARE FUNCTION QueryDisplayConfig LIB "user32.dll" ALIAS "QueryDisplayConfig" ( BYVAL flags AS DWORD
 , BYREF numPathArrayElements AS DWORD
 , BYREF pathArray AS DISPLAYCONFIG_PATH_INFO
 , BYREF numModeInfoArrayElements AS DWORD
 , BYREF modeInfoArray AS DISPLAYCONFIG_MODE_INFO
 , BYREF currentTopologyId AS DWORD
 ) AS LONG
DECLARE FUNCTION DisplayConfigGetDeviceInfo LIB "user32.dll" ALIAS "DisplayConfigGetDeviceInfo" ( BYREF requestPacket AS DISPLAYCONFIG_DEVICE_INFO_HEADER
 ) AS LONG
DECLARE FUNCTION DisplayConfigSetDeviceInfo LIB "user32.dll" ALIAS "DisplayConfigSetDeviceInfo" ( BYREF setPacket AS DISPLAYCONFIG_DEVICE_INFO_HEADER
 ) AS LONG
'#endif /* WINVER >= 0x0601 */
'#endif /* NOGDI */
'#endif /* _WINGDI_ */
DECLARE FUNCTION SystemParametersInfoA LIB "user32.dll" ALIAS "SystemParametersInfoA" ( BYVAL uiAction AS QUAD , BYVAL uiParam AS QUAD , BYREF pvParam AS ANY , BYVAL fWinIni AS QUAD ) AS LONG
DECLARE FUNCTION SystemParametersInfoW LIB "user32.dll" ALIAS "SystemParametersInfoW" ( BYVAL uiAction AS QUAD
 , BYVAL uiParam AS DWORD
 , BYREF pvParam AS ANY
 , BYVAL fWinIni AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SystemParametersInfo = SystemParametersInfoW
#ELSE
 MACRO SystemParametersInfo = SystemParametersInfoA
#ENDIF
'#endif /* !NOSYSPARAMSINFO */
'#ENDIF ' #IF NOT %DEF(%NOSYSPARAMSINFO) ' -----------------------------------
'/*
' * Accessibility support
' */
' // Size = 24 bytes
TYPE FILTERKEYS DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 iWaitMSec AS DWORD ' DWORD // Acceptance Delay
 iDelayMSec AS DWORD ' DWORD // Delay Until Repeat
 iRepeatMSec AS DWORD ' DWORD // Repeat Rate
 iBounceMSec AS DWORD ' DWORD // Debounce Time
END TYPE
'/*
' * FILTERKEYS dwFlags field
' */
%EQUATE `FKF_FILTERKEYSON = &H00000001
%EQUATE `FKF_AVAILABLE = &H00000002
%EQUATE `FKF_HOTKEYACTIVE = &H00000004
%EQUATE `FKF_CONFIRMHOTKEY = &H00000008
%EQUATE `FKF_HOTKEYSOUND = &H00000010
%EQUATE `FKF_INDICATOR = &H00000020
%EQUATE `FKF_CLICKON = &H00000040
' // Size = 8 bytes
TYPE STICKYKEYS DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
END TYPE
'/*
' * STICKYKEYS dwFlags field
' */
%EQUATE `SKF_STICKYKEYSON = &H00000001
%EQUATE `SKF_AVAILABLE = &H00000002
%EQUATE `SKF_HOTKEYACTIVE = &H00000004
%EQUATE `SKF_CONFIRMHOTKEY = &H00000008
%EQUATE `SKF_HOTKEYSOUND = &H00000010
%EQUATE `SKF_INDICATOR = &H00000020
%EQUATE `SKF_AUDIBLEFEEDBACK = &H00000040
%EQUATE `SKF_TRISTATE = &H00000080
%EQUATE `SKF_TWOKEYSOFF = &H00000100
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `SKF_LALTLATCHED = &H10000000
%EQUATE `SKF_LCTLLATCHED = &H04000000
%EQUATE `SKF_LSHIFTLATCHED = &H01000000
%EQUATE `SKF_RALTLATCHED = &H20000000
%EQUATE `SKF_RCTLLATCHED = &H08000000
%EQUATE `SKF_RSHIFTLATCHED = &H02000000
%EQUATE `SKF_LWINLATCHED = &H40000000
%EQUATE `SKF_RWINLATCHED = &H80000000
%EQUATE `SKF_LALTLOCKED = &H00100000
%EQUATE `SKF_LCTLLOCKED = &H00040000
%EQUATE `SKF_LSHIFTLOCKED = &H00010000
%EQUATE `SKF_RALTLOCKED = &H00200000
%EQUATE `SKF_RCTLLOCKED = &H00080000
%EQUATE `SKF_RSHIFTLOCKED = &H00020000
%EQUATE `SKF_LWINLOCKED = &H00400000
%EQUATE `SKF_RWINLOCKED = &H00800000
'#endif /* _WIN32_WINNT >= 0x0500 */
' // Size = 28 bytes
TYPE MOUSEKEYS DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 iMaxSpeed AS DWORD
 iTimeToMaxSpeed AS DWORD
 iCtrlSpeed AS DWORD
 dwReserved1 AS DWORD
 dwReserved2 AS DWORD
END TYPE
'/*
' * MOUSEKEYS dwFlags field
' */
%EQUATE `MKF_MOUSEKEYSON = &H00000001
%EQUATE `MKF_AVAILABLE = &H00000002
%EQUATE `MKF_HOTKEYACTIVE = &H00000004
%EQUATE `MKF_CONFIRMHOTKEY = &H00000008
%EQUATE `MKF_HOTKEYSOUND = &H00000010
%EQUATE `MKF_INDICATOR = &H00000020
%EQUATE `MKF_MODIFIERS = &H00000040
%EQUATE `MKF_REPLACENUMBERS = &H00000080
'#if(_WIN32_WINNT >= 0x0500)
%EQUATE `MKF_LEFTBUTTONSEL = &H10000000
%EQUATE `MKF_RIGHTBUTTONSEL = &H20000000
%EQUATE `MKF_LEFTBUTTONDOWN = &H01000000
%EQUATE `MKF_RIGHTBUTTONDOWN = &H02000000
%EQUATE `MKF_MOUSEMODE = &H80000000
'#endif /* _WIN32_WINNT >= 0x0500 */
' // Size = 12 bytes
TYPE ACCESSTIMEOUT DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 iTimeOutMSec AS DWORD
END TYPE
'/*
' * ACCESSTIMEOUT dwFlags field
' */
%EQUATE `ATF_TIMEOUTON = &H00000001
%EQUATE `ATF_ONOFFFEEDBACK = &H00000002
'/* values for SOUNDSENTRY iFSGrafEffect field */
%EQUATE `SSGF_NONE = 0
%EQUATE `SSGF_DISPLAY = 3
'/* values for SOUNDSENTRY iFSTextEffect field */
%EQUATE `SSTF_NONE = 0
%EQUATE `SSTF_CHARS = 1
%EQUATE `SSTF_BORDER = 2
%EQUATE `SSTF_DISPLAY = 3
'/* values for SOUNDSENTRY iWindowsEffect field */
%EQUATE `SSWF_NONE = 0
%EQUATE `SSWF_TITLE = 1
%EQUATE `SSWF_WINDOW = 2
%EQUATE `SSWF_DISPLAY = 3
%EQUATE `SSWF_CUSTOM = 4
' // Size = 48 bytes
TYPE SOUNDSENTRYA DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 iFSTextEffect AS DWORD
 iFSTextEffectMSec AS DWORD
 iFSTextEffectColorBits AS DWORD
 iFSGrafEffect AS DWORD
 iFSGrafEffectMSec AS DWORD
 iFSGrafEffectColor AS DWORD
 iWindowsEffect AS DWORD
 iWindowsEffectMSec AS DWORD
 lpszWindowsEffectDLL AS ASCIIZ PTR
 iWindowsEffectOrdinal AS DWORD
END TYPE
' // Size = 48 bytes
TYPE SOUNDSENTRYW DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
 iFSTextEffect AS DWORD
 iFSTextEffectMSec AS DWORD
 iFSTextEffectColorBits AS DWORD
 iFSGrafEffect AS DWORD
 iFSGrafEffectMSec AS DWORD
 iFSGrafEffectColor AS DWORD
 iWindowsEffect AS DWORD
 iWindowsEffectMSec AS DWORD
 lpszWindowsEffectDLL AS WSTRINGZ PTR
 iWindowsEffectOrdinal AS DWORD
END TYPE
#IF %DEF(%UNICODE)
MACRO SOUNDSENTRY_STRUCT = SOUNDSENTRYW
MACRO SOUNDSENTRY_TYPE = SOUNDSENTRYW
#ELSE
MACRO SOUNDSENTRY_STRUCT = SOUNDSENTRYA
MACRO SOUNDSENTRY_TYPE = SOUNDSENTRYA
#ENDIF
'/*
' * SOUNDSENTRY dwFlags field
' */
%EQUATE `SSF_SOUNDSENTRYON = &H00000001
%EQUATE `SSF_AVAILABLE = &H00000002
%EQUATE `SSF_INDICATOR = &H00000004
'#if(_WIN32_WINNT >= 0x0600)
DECLARE FUNCTION SoundSentry LIB "user32.dll" ALIAS "SoundSentry" () AS LONG
'#endif /* _WIN32_WINNT >= 0x0600 */
' // Size = 8 bytes
TYPE TOGGLEKEYS DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
END TYPE
'/*
' * TOGGLEKEYS dwFlags field
' */
%EQUATE `TKF_TOGGLEKEYSON = &H00000001
%EQUATE `TKF_AVAILABLE = &H00000002
%EQUATE `TKF_HOTKEYACTIVE = &H00000004
%EQUATE `TKF_CONFIRMHOTKEY = &H00000008
%EQUATE `TKF_HOTKEYSOUND = &H00000010
%EQUATE `TKF_INDICATOR = &H00000020
'#if(_WIN32_WINNT >= 0x0600)
' // Size = 12 bytes
TYPE AUDIODESCRIPTION DWORD
 cbSize AS DWORD ' UINT // sizeof(AudioDescriptionType)
 Enabled AS LONG ' BOOL // On/Off
 Locale AS DWORD ' DWORD // locale ID for language
END TYPE
'#endif /* _WIN32_WINNT >= 0x0600 */
'/*
' * Set debug level
' */
DECLARE SUB SetDebugErrorLevel LIB "user32.dll" ALIAS "SetDebugErrorLevel" ( BYVAL dwLevel AS QUAD )
'/*
' * SetLastErrorEx() types.
' */
%EQUATE `SLE_ERROR = &H00000001
%EQUATE `SLE_MINORERROR = &H00000002
%EQUATE `SLE_WARNING = &H00000003
DECLARE SUB SetLastErrorEx LIB "user32.dll" ALIAS "SetLastErrorEx" ( BYVAL dwErrCode AS QUAD , BYVAL dwType AS QUAD )
DECLARE FUNCTION InternalGetWindowText LIB "user32.dll" ALIAS "InternalGetWindowText" ( BYVAL hWnd AS QUAD , BYREF pString AS WSTRINGZ , BYVAL cchMaxCount AS LONG ) AS LONG ' int
' Although you can access this function by using LoadLibrary and GetProcAddress
' combined in Microsoft Windows versions prior to Windows XP, the function is
' not accessible using the standard Include file and library linkage. The header
' files included in Windows XP Service Pack 1 (SP1) and Windows Server 2003
' document this function and make it accessible using the appropriate Include
' file and library linkage. However, this function is deprecated and not intended
' for general use. It is recommended that you do not use it in new programs
' because it might be altered or unavailable in subsequent versions of Windows.
'#if defined(WINNT)
DECLARE FUNCTION EndTask LIB "user32.dll" ALIAS "EndTask" ( BYVAL hWnd AS QUAD , BYVAL fShutDown AS LONG , BYVAL fForce AS LONG ) AS LONG
'#endif
DECLARE FUNCTION CancelShutdown LIB "user32.dll" ALIAS "CancelShutdown" ( ) AS LONG
'#if(WINVER >= 0x0500)
'/*
' * Multimonitor API.
' */
%EQUATE `MONITOR_DEFAULTTONULL = &H00000000
%EQUATE `MONITOR_DEFAULTTOPRIMARY = &H00000001
%EQUATE `MONITOR_DEFAULTTONEAREST = &H00000002
DECLARE FUNCTION MonitorFromPoint LIB "user32.dll" ALIAS "MonitorFromPoint" ( BYVAL pt AS POINT , BYVAL dwFlags AS QUAD ) AS QUAD ' HMONITOR
' // Same as above, but using x, y coordinates
DECLARE FUNCTION MonitorFromXY LIB "user32.dll" ALIAS "MonitorFromPoint" ( BYVAL x AS LONG , BYVAL y AS LONG , BYVAL dwFlags AS QUAD ) AS QUAD ' HMONITOR
DECLARE FUNCTION MonitorFromRect LIB "user32.dll" ALIAS "MonitorFromRect" ( BYREF lprc AS RECT , BYVAL dwFlags AS QUAD ) AS QUAD ' HMONITOR
DECLARE FUNCTION MonitorFromWindow LIB "user32.dll" ALIAS "MonitorFromWindow" ( BYVAL hWnd AS QUAD , BYVAL dwFlags AS QUAD ) AS QUAD ' HMONITOR
%EQUATE `MONITORINFOF_PRIMARY = &H00000001
'#ifndef CCHDEVICENAME
'#define CCHDEVICENAME 32
#IF NOT %DEF(%CCHDEVICENAME)
%EQUATE `CCHDEVICENAME = 32&
#ENDIF
'#endif
' // Size = 40 bytes
TYPE MONITORINFO DWORD
 cbSize AS DWORD
 rcMonitor AS RECT ' RECT
 rcWork AS RECT ' RECT
 dwFlags AS DWORD
END TYPE
' // Size = 72 bytes
TYPE MONITORINFOEXA DWORD
 MONITORINFO
 szDevice AS ASCIIZ * %CCHDEVICENAME
END TYPE
' // Size = 104 bytes
TYPE MONITORINFOEXW DWORD
 MONITORINFO
 szDevice AS WSTRINGZ * %CCHDEVICENAME
END TYPE
#IF %DEF(%UNICODE)
MACRO MONITORINFOEX = MONITORINFOEXW
#ELSE
MACRO MONITORINFOEX = MONITORINFOEXA
#ENDIF
DECLARE FUNCTION GetMonitorInfoA LIB "user32.dll" ALIAS "GetMonitorInfoA" ( BYVAL hMonitor AS QUAD , BYREF lpmi AS ANY ) AS LONG
DECLARE FUNCTION GetMonitorInfoW LIB "user32.dll" ALIAS "GetMonitorInfoW" ( BYVAL hMonitor AS QUAD
 , BYREF lpmi AS ANY
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetMonitorInfo = GetMonitorInfoW
#ELSE
 MACRO GetMonitorInfo = GetMonitorInfoA
#ENDIF
'typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);
DECLARE FUNCTION EnumDisplayMonitors LIB "user32.dll" ALIAS "EnumDisplayMonitors" ( BYVAL hdc AS QUAD , BYREF lprcClip AS RECT , BYVAL lpfnEnum AS QUAD , BYVAL dwData AS LONG ) AS LONG
'#IF NOT %DEF(%NOWINABLE) ' ----------------------------------------------------
'#ifndef NOWINABLE
'/*
' * WinEvents - Active Accessibility hooks
' */
DECLARE SUB NotifyWinEvent LIB "user32.dll" ALIAS "NotifyWinEvent" ( BYVAL event AS QUAD , BYVAL hwnd AS QUAD , BYVAL idObject AS LONG , BYVAL idChild AS LONG )
'typedef VOID (CALLBACK* WINEVENTPROC)(
' HWINEVENTHOOK hWinEventHook,
' DWORD event,
' HWND hwnd,
' LONG idObject,
' LONG idChild,
' DWORD idEventThread,
' DWORD dwmsEventTime);
DECLARE FUNCTION SetWinEventHook LIB "user32.dll" ALIAS "SetWinEventHook" ( BYVAL eventMin AS QUAD , BYVAL eventMax AS QUAD , BYVAL hmodWinEventProc AS QUAD , BYVAL pfnWinEventProc AS QUAD , BYVAL idProcess AS QUAD , BYVAL idThread AS QUAD , BYVAL dwFlags AS QUAD ) AS QUAD ' HWINEVENTHOOK
'#if(_WIN32_WINNT >= 0x0501)
DECLARE FUNCTION IsWinEventHookInstalled LIB "user32.dll" ALIAS "IsWinEventHookInstalled" ( BYVAL event AS QUAD ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0501 */
'/*
' * dwFlags for SetWinEventHook
' */
%EQUATE `WINEVENT_OUTOFCONTEXT = &H0000 ' Events are ASYNC
%EQUATE `WINEVENT_SKIPOWNTHREAD = &H0001 ' Don't call back for events on installer's thread
%EQUATE `WINEVENT_SKIPOWNPROCESS = &H0002 ' Don't call back for events on installer's process
%EQUATE `WINEVENT_INCONTEXT = &H0004 ' Events are SYNC, this causes your dll to be injected into every process
DECLARE FUNCTION UnhookWinEvent LIB "user32.dll" ALIAS "UnhookWinEvent" ( BYVAL hWinEventHook AS QUAD ) AS LONG
'/*
' * idObject values for WinEventProc and NotifyWinEvent
' */
'/*
' * hwnd + idObject can be used with OLEACC.DLL's OleGetObjectFromWindow()
' * to get an interface pointer to the container. indexChild is the item
' * within the container in question. Setup a VARIANT with vt VT_I4 and
' * lVal the indexChild and pass that in to all methods. Then you
' * are raring to go.
' */
'/*
' * Common object IDs (cookies, only for sending WM_GETOBJECT to get at the
' * thing in question). Positive IDs are reserved for apps (app specific),
' * negative IDs are system things and are global, 0 means "just little old
' * me".
' */
%EQUATE `CHILDID_SELF = 0&
%EQUATE `INDEXID_OBJECT = 0&
%EQUATE `INDEXID_CONTAINER = 0&
'/*
' * Reserved IDs for system objects
' */
%EQUATE `OBJID_WINDOW = &H00000000& ' ((LONG)0x00000000)
%EQUATE `OBJID_SYSMENU = &HFFFFFFFF& ' ((LONG)0xFFFFFFFF)
%EQUATE `OBJID_TITLEBAR = &HFFFFFFFE& ' ((LONG)0xFFFFFFFE)
%EQUATE `OBJID_MENU = &HFFFFFFFD& ' ((LONG)0xFFFFFFFD)
%EQUATE `OBJID_CLIENT = &HFFFFFFFC& ' ((LONG)0xFFFFFFFC)
%EQUATE `OBJID_VSCROLL = &HFFFFFFFB& ' ((LONG)0xFFFFFFFB)
%EQUATE `OBJID_HSCROLL = &HFFFFFFFA& ' ((LONG)0xFFFFFFFA)
%EQUATE `OBJID_SIZEGRIP = &HFFFFFFF9& ' ((LONG)0xFFFFFFF9)
%EQUATE `OBJID_CARET = &HFFFFFFF8& ' ((LONG)0xFFFFFFF8)
%EQUATE `OBJID_CURSOR = &HFFFFFFF7& ' ((LONG)0xFFFFFFF7)
%EQUATE `OBJID_ALERT = &HFFFFFFF6& ' ((LONG)0xFFFFFFF6)
%EQUATE `OBJID_SOUND = &HFFFFFFF5& ' ((LONG)0xFFFFFFF5)
%EQUATE `OBJID_QUERYCLASSNAMEIDX = &HFFFFFFF4& ' ((LONG)0xFFFFFFF4)
%EQUATE `OBJID_NATIVEOM = &HFFFFFFF0& ' ((LONG)0xFFFFFFF0)
'/*
' * EVENT DEFINITION
' */
%EQUATE `EVENT_MIN = &H00000001
%EQUATE `EVENT_MAX = &H7FFFFFFF
'/*
' * EVENT_SYSTEM_SOUND
' * Sent when a sound is played. Currently nothing is generating this, we
' * this event when a system sound (for menus, etc) is played. Apps
' * generate this, if accessible, when a private sound is played. For
' * example, if Mail plays a "New Mail" sound.
' *
' * System Sounds:
' * (Generated by PlaySoundEvent in USER itself)
' * hwnd is NULL
' * idObject is OBJID_SOUND
' * idChild is sound child ID if one
' * App Sounds:
' * (PlaySoundEvent won't generate notification; up to app)
' * hwnd + idObject gets interface pointer to Sound object
' * idChild identifies the sound in question
' * are going to be cleaning up the SOUNDSENTRY feature in the control panel
' * and will use this at that time. Applications implementing WinEvents
' * are perfectly welcome to use it. Clients of IAccessible* will simply
' * turn around and get back a non-visual object that describes the sound.
' */
%EQUATE `EVENT_SYSTEM_SOUND = &H0001
'/*
' * EVENT_SYSTEM_ALERT
' * System Alerts:
' * (Generated by MessageBox() calls for example)
' * hwnd is hwndMessageBox
' * idObject is OBJID_ALERT
' * App Alerts:
' * (Generated whenever)
' * hwnd+idObject gets interface pointer to Alert
' */
%EQUATE `EVENT_SYSTEM_ALERT = &H0002
'/*
' * EVENT_SYSTEM_FOREGROUND
' * Sent when the foreground (active) window changes, even if it is changing
' * to another window in the same thread as the previous one.
' * hwnd is hwndNewForeground
' * idObject is OBJID_WINDOW
' * idChild is INDEXID_OBJECT
' */
%EQUATE `EVENT_SYSTEM_FOREGROUND = &H0003
'/*
' * Menu
' * hwnd is window (top level window or popup menu window)
' * idObject is ID of control (OBJID_MENU, OBJID_SYSMENU, OBJID_SELF for popup)
' * idChild is CHILDID_SELF
' *
' * EVENT_SYSTEM_MENUSTART
' * EVENT_SYSTEM_MENUEND
' * For MENUSTART, hwnd+idObject+idChild refers to the control with the menu bar,
' * or the control bringing up the context menu.
' *
' * Sent when entering into and leaving from menu mode (system, app bar, and
' * track popups).
' */
%EQUATE `EVENT_SYSTEM_MENUSTART = &H0004
%EQUATE `EVENT_SYSTEM_MENUEND = &H0005
'/*
' * EVENT_SYSTEM_MENUPOPUPSTART
' * EVENT_SYSTEM_MENUPOPUPEND
' * Sent when a menu popup comes up and just before it is taken down. Note
' * that for a call to TrackPopupMenu(), a client will see EVENT_SYSTEM_MENUSTART
' * followed almost immediately by EVENT_SYSTEM_MENUPOPUPSTART for the popup
' * being shown.
' *
' * For MENUPOPUP, hwnd+idObject+idChild refers to the NEW popup coming up, not the
' * parent item which is hierarchical. You can get the parent menu/popup by
' * asking for the accParent object.
' */
%EQUATE `EVENT_SYSTEM_MENUPOPUPSTART = &H0006
%EQUATE `EVENT_SYSTEM_MENUPOPUPEND = &H0007
'/*
' * EVENT_SYSTEM_CAPTURESTART
' * EVENT_SYSTEM_CAPTUREEND
' * Sent when a window takes the capture and releases the capture.
' */
%EQUATE `EVENT_SYSTEM_CAPTURESTART = &H0008
%EQUATE `EVENT_SYSTEM_CAPTUREEND = &H0009
'/*
' * Move Size
' * EVENT_SYSTEM_MOVESIZESTART
' * EVENT_SYSTEM_MOVESIZEEND
' * Sent when a window enters and leaves move-size dragging mode.
' */
%EQUATE `EVENT_SYSTEM_MOVESIZESTART = &H000A
%EQUATE `EVENT_SYSTEM_MOVESIZEEND = &H000B
'/*
' * Context Help
' * EVENT_SYSTEM_CONTEXTHELPSTART
' * EVENT_SYSTEM_CONTEXTHELPEND
' * Sent when a window enters and leaves context sensitive help mode.
' */
%EQUATE `EVENT_SYSTEM_CONTEXTHELPSTART = &H000C
%EQUATE `EVENT_SYSTEM_CONTEXTHELPEND = &H000D
'/*
' * Drag & Drop
' * EVENT_SYSTEM_DRAGDROPSTART
' * EVENT_SYSTEM_DRAGDROPEND
' * Send the START notification just before going into drag&drop loop. Send
' * the END notification just after canceling out.
' * Note that it is up to apps and OLE to generate this, since the system
' * doesn't know. Like EVENT_SYSTEM_SOUND, it will be a while before this
' * is prevalent.
' */
%EQUATE `EVENT_SYSTEM_DRAGDROPSTART = &H000E
%EQUATE `EVENT_SYSTEM_DRAGDROPEND = &H000F
'/*
' * Dialog
' * Send the START notification right after the dialog is completely
' * initialized and visible. Send the END right before the dialog
' * is hidden and goes away.
' * EVENT_SYSTEM_DIALOGSTART
' * EVENT_SYSTEM_DIALOGEND
' */
%EQUATE `EVENT_SYSTEM_DIALOGSTART = &H0010
%EQUATE `EVENT_SYSTEM_DIALOGEND = &H0011
'/*
' * EVENT_SYSTEM_SCROLLING
' * EVENT_SYSTEM_SCROLLINGSTART
' * EVENT_SYSTEM_SCROLLINGEND
' * Sent when beginning and ending the tracking of a scrollbar in a window,
' * and also for scrollbar controls.
' */
%EQUATE `EVENT_SYSTEM_SCROLLINGSTART = &H0012
%EQUATE `EVENT_SYSTEM_SCROLLINGEND = &H0013
'/*
' * Alt-Tab Window
' * Send the START notification right after the switch window is initialized
' * and visible. Send the END right before it is hidden and goes away.
' * EVENT_SYSTEM_SWITCHSTART
' * EVENT_SYSTEM_SWITCHEND
' */
%EQUATE `EVENT_SYSTEM_SWITCHSTART = &H0014
%EQUATE `EVENT_SYSTEM_SWITCHEND = &H0015
'/*
' * EVENT_SYSTEM_MINIMIZESTART
' * EVENT_SYSTEM_MINIMIZEEND
' * Sent when a window minimizes and just before it restores.
' */
%EQUATE `EVENT_SYSTEM_MINIMIZESTART = &H0016
%EQUATE `EVENT_SYSTEM_MINIMIZEEND = &H0017
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `EVENT_SYSTEM_DESKTOPSWITCH = &H0020
'#endif /* _WIN32_WINNT >= 0x0600 */
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `EVENT_SYSTEM_END = &H00FF
%EQUATE `EVENT_OEM_DEFINED_START = &H0101
%EQUATE `EVENT_OEM_DEFINED_END = &H01FF
%EQUATE `EVENT_UIA_EVENTID_START = &H4E00
%EQUATE `EVENT_UIA_EVENTID_END = &H4EFF
%EQUATE `EVENT_UIA_PROPID_START = &H7500
%EQUATE `EVENT_UIA_PROPID_END = &H75FF
'#endif /* _WIN32_WINNT >= 0x0601 */
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `EVENT_CONSOLE_CARET = &H4001
%EQUATE `EVENT_CONSOLE_UPDATE_REGION = &H4002
%EQUATE `EVENT_CONSOLE_UPDATE_SIMPLE = &H4003
%EQUATE `EVENT_CONSOLE_UPDATE_SCROLL = &H4004
%EQUATE `EVENT_CONSOLE_LAYOUT = &H4005
%EQUATE `EVENT_CONSOLE_START_APPLICATION = &H4006
%EQUATE `EVENT_CONSOLE_END_APPLICATION = &H4007
'/*
' * Flags for EVENT_CONSOLE_START/END_APPLICATION.
' */
'#if defined(_WIN64)
'#define CONSOLE_APPLICATION_16BIT 0x0000
'#else
'#define CONSOLE_APPLICATION_16BIT 0x0001
'#endif
%EQUATE `CONSOLE_APPLICATION_16BIT = &H0001
'/*
' * Flags for EVENT_CONSOLE_CARET
' */
%EQUATE `CONSOLE_CARET_SELECTION = &H0001
%EQUATE `CONSOLE_CARET_VISIBLE = &H0002
'#endif /* _WIN32_WINNT >= 0x0501 */
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `EVENT_CONSOLE_END = &H40FF
'#endif /* _WIN32_WINNT >= 0x0601 */
'/*
' * Object events
' *
' * The system AND apps generate these. The system generates these for
' * real windows. Apps generate these for objects within their window which
' * act like a separate control, e.g. an item in a list view.
' *
' * When the system generate them, dwParam2 is always WMOBJID_SELF. When
' * apps generate them, apps put the has-meaning-to-the-app-only ID value
' * in dwParam2.
' * For all events, if you want detailed accessibility information, callers
' * should
' * * Call AccessibleObjectFromWindow() with the hwnd, idObject parameters
' * of the event, and IID_IAccessible as the REFIID, to get back an
' * IAccessible* to talk to
' * * Initialize and fill in a VARIANT as VT_I4 with lVal the idChild
' * parameter of the event.
' * * If idChild isn't zero, call get_accChild() in the container to see
' * if the child is an object in its own right. If so, you will get
' * back an IDispatch* object for the child. You should release the
' * parent, and call QueryInterface() on the child object to get its
' * IAccessible*. Then you talk directly to the child. Otherwise,
' * if get_accChild() returns you nothing, you should continue to
' * use the child VARIANT. You will ask the container for the properties
' * of the child identified by the VARIANT. In other words, the
' * child in this case is accessible but not a full-blown object.
' * Like a button on a titlebar which is 'small' and has no children.
' */
'/*
' * For all EVENT_OBJECT events,
' * hwnd is the dude to Send the WM_GETOBJECT message to (unless NULL,
' * see above for system things)
' * idObject is the ID of the object that can resolve any queries a
' * client might have. It's a way to deal with windowless controls,
' * controls that are just drawn on the screen in some larger parent
' * window (like SDM), or standard frame elements of a window.
' * idChild is the piece inside of the object that is affected. This
' * allows clients to access things that are too small to have full
' * blown objects in their own right. Like the thumb of a scrollbar.
' * The hwnd/idObject pair gets you to the container, the dude you
' * probably want to talk to most of the time anyway. The idChild
' * can then be passed into the acc properties to get the name/value
' * of it as needed.
' *
' * Example #1:
' * System propagating a listbox selection change
' * EVENT_OBJECT_SELECTION
' * hwnd == listbox hwnd
' * idObject == OBJID_WINDOW
' * idChild == new selected item, or CHILDID_SELF if
' * nothing now selected within container.
' * Word '97 propagating a listbox selection change
' * hwnd == SDM window
' * idObject == SDM ID to get at listbox 'control'
' * idChild == new selected item, or CHILDID_SELF if
' * nothing
' *
' * Example #2:
' * System propagating a menu item selection on the menu bar
' * EVENT_OBJECT_SELECTION
' * hwnd == top level window
' * idObject == OBJID_MENU
' * idChild == ID of child menu bar item selected
' *
' * Example #3:
' * System propagating a dropdown coming off of said menu bar item
' * EVENT_OBJECT_CREATE
' * hwnd == popup item
' * idObject == OBJID_WINDOW
' * idChild == CHILDID_SELF
' *
' * Example #4:
' *
' * For EVENT_OBJECT_REORDER, the object referred to by hwnd/idObject is the
' * PARENT container in which the zorder is occurring. This is because if
' * one child is zordering, all of them are changing their relative zorder.
' */
%EQUATE `EVENT_OBJECT_CREATE = &H8000 ' hwnd + ID + idChild is created item
%EQUATE `EVENT_OBJECT_DESTROY = &H8001 ' hwnd + ID + idChild is destroyed item
%EQUATE `EVENT_OBJECT_SHOW = &H8002 ' hwnd + ID + idChild is shown item
%EQUATE `EVENT_OBJECT_HIDE = &H8003 ' hwnd + ID + idChild is hidden item
%EQUATE `EVENT_OBJECT_REORDER = &H8004 ' hwnd + ID + idChild is parent of zordering children
'/*
' * NOTE:
' * Minimize the number of notifications!
' *
' * When you are hiding a parent object, obviously all child objects are no
' * longer visible on screen. They still have the same "visible" status,
' * but are not truly visible. Hence do not send HIDE notifications for the
' * children also. One implies all. The same goes for SHOW.
' */
%EQUATE `EVENT_OBJECT_FOCUS = &H8005 ' hwnd + ID + idChild is focused item
%EQUATE `EVENT_OBJECT_SELECTION = &H8006 ' hwnd + ID + idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex
%EQUATE `EVENT_OBJECT_SELECTIONADD = &H8007 ' hwnd + ID + idChild is item added
%EQUATE `EVENT_OBJECT_SELECTIONREMOVE = &H8008 ' hwnd + ID + idChild is item removed
%EQUATE `EVENT_OBJECT_SELECTIONWITHIN = &H8009 ' hwnd + ID + idChild is parent of changed selected items
'/*
' * NOTES:
' * There is only one "focused" child item in a parent. This is the place
' * keystrokes are going at a given moment. Hence only send a notification
' * about where the NEW focus is going. A NEW item getting the focus already
' * implies that the OLD item is losing it.
' *
' * SELECTION however can be multiple. Hence the different SELECTION
' * notifications. Here's when to use each:
' *
' * (1) Send a SELECTION notification in the simple single selection
' * case (like the focus) when the item with the selection is
' * merely moving to a different item within a container. hwnd + ID
' * is the container control, idChildItem is the new child with the
' * selection.
' *
' * (2) Send a SELECTIONADD notification when a new item has simply been added
' * to the selection within a container. This is appropriate when the
' * number of newly selected items is very small. hwnd + ID is the
' * container control, idChildItem is the new child added to the selection.
' *
' * (3) Send a SELECTIONREMOVE notification when a new item has simply been
' * removed from the selection within a container. This is appropriate
' * when the number of newly selected items is very small, just like
' * SELECTIONADD. hwnd + ID is the container control, idChildItem is the
' * new child removed from the selection.
' *
' * (4) Send a SELECTIONWITHIN notification when the selected items within a
' * control have changed substantially. Rather than propagate a large
' * number of changes to reflect removal for some items, addition of
' * others, just tell somebody who cares that a lot happened. It will
' * be faster an easier for somebody watching to just turn around and
' * query the container control what the new bunch of selected items
' * are.
' */
%EQUATE `EVENT_OBJECT_STATECHANGE = &H800A ' hwnd + ID + idChild is item w/ state change
'/*
' * Examples of when to send an EVENT_OBJECT_STATECHANGE include
' * * It is being enabled/disabled (USER does for windows)
' * * It is being pressed/released (USER does for buttons)
' * * It is being checked/unchecked (USER does for radio/check buttons)
' */
%EQUATE `EVENT_OBJECT_LOCATIONCHANGE = &H800B ' hwnd + ID + idChild is moved/sized item
'/*
' * Note:
' * A LOCATIONCHANGE is not sent for every child object when the parent
' * changes shape/moves. Send one notification for the topmost object
' * that is changing. For example, if the user resizes a top level window,
' * USER will generate a LOCATIONCHANGE for it, but not for the menu bar,
' * title bar, scrollbars, etc. that are also changing shape/moving.
' *
' * In other words, it only generates LOCATIONCHANGE notifications for
' * real windows that are moving/sizing. It will not generate a LOCATIONCHANGE
' * for every non-floating child window when the parent moves (the children are
' * logically moving also on screen, but not relative to the parent).
' *
' * Now, if the app itself resizes child windows as a result of being
' * sized, USER will generate LOCATIONCHANGEs for those dudes also because
' * it doesn't know better.
' *
' * Note also that USER will generate LOCATIONCHANGE notifications for two
' * non-window sys objects:
' * (1) System caret
' * (2) Cursor
' */
%EQUATE `EVENT_OBJECT_NAMECHANGE = &H800C ' hwnd + ID + idChild is item w/ name change
%EQUATE `EVENT_OBJECT_DESCRIPTIONCHANGE = &H800D ' hwnd + ID + idChild is item w/ desc change
%EQUATE `EVENT_OBJECT_VALUECHANGE = &H800E ' hwnd + ID + idChild is item w/ value change
%EQUATE `EVENT_OBJECT_PARENTCHANGE = &H800F ' hwnd + ID + idChild is item w/ new parent
%EQUATE `EVENT_OBJECT_HELPCHANGE = &H8010 ' hwnd + ID + idChild is item w/ help change
%EQUATE `EVENT_OBJECT_DEFACTIONCHANGE = &H8011 ' hwnd + ID + idChild is item w/ def action change
%EQUATE `EVENT_OBJECT_ACCELERATORCHANGE = &H8012 ' hwnd + ID + idChild is item w/ keybd accel change
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `EVENT_OBJECT_INVOKED = &H8013 ' // hwnd + ID + idChild is item invoked
%EQUATE `EVENT_OBJECT_TEXTSELECTIONCHANGED = &H8014 ' // hwnd + ID + idChild is item w? test selection change
'/*
' * EVENT_OBJECT_CONTENTSCROLLED
' * Sent when ending the scrolling of a window object.
' *
' * Unlike the similar event (EVENT_SYSTEM_SCROLLEND), this event will be
' * associated with the scrolling window itself. There is no difference
' * between horizontal or vertical scrolling.
' *
' * This event should be posted whenever scroll action is completed, including
' * when it is scrolled by scroll bars, mouse wheel, or keyboard navigations.
' *
' * example:
' * hwnd == window that is scrolling
' * idObject == OBJID_CLIENT
' * idChild == CHILDID_SELF
' */
%EQUATE `EVENT_OBJECT_CONTENTSCROLLED = &H8015
'#endif /* _WIN32_WINNT >= 0x0600 */
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `EVENT_SYSTEM_ARRANGMENTPREVIEW = &H8016
'#endif /* _WIN32_WINNT >= 0x0601 */
'#if(_WIN32_WINNT >= 0x0601)
%EQUATE `EVENT_OBJECT_END = &H80FF
%EQUATE `EVENT_AIA_START = &HA000
%EQUATE `EVENT_AIA_END = &HAFFF
'#endif /* _WIN32_WINNT >= 0x0601 */
'/*
' * Child IDs
' */
'/*
' * System Sounds (idChild of system SOUND notification)
' */
%EQUATE `SOUND_SYSTEM_STARTUP = 1&
%EQUATE `SOUND_SYSTEM_SHUTDOWN = 2&
%EQUATE `SOUND_SYSTEM_BEEP = 3&
%EQUATE `SOUND_SYSTEM_ERROR = 4&
%EQUATE `SOUND_SYSTEM_QUESTION = 5&
%EQUATE `SOUND_SYSTEM_WARNING = 6&
%EQUATE `SOUND_SYSTEM_INFORMATION = 7&
%EQUATE `SOUND_SYSTEM_MAXIMIZE = 8&
%EQUATE `SOUND_SYSTEM_MINIMIZE = 9&
%EQUATE `SOUND_SYSTEM_RESTOREUP = 10&
%EQUATE `SOUND_SYSTEM_RESTOREDOWN = 11&
%EQUATE `SOUND_SYSTEM_APPSTART = 12&
%EQUATE `SOUND_SYSTEM_FAULT = 13&
%EQUATE `SOUND_SYSTEM_APPEND = 14&
%EQUATE `SOUND_SYSTEM_MENUCOMMAND = 15&
%EQUATE `SOUND_SYSTEM_MENUPOPUP = 16&
%EQUATE `CSOUND_SYSTEM = 16&
'/*
' * System Alerts (indexChild of system ALERT notification)
' */
%EQUATE `ALERT_SYSTEM_INFORMATIONAL = 1& ' MB_INFORMATION
%EQUATE `ALERT_SYSTEM_WARNING = 2& ' MB_WARNING
%EQUATE `ALERT_SYSTEM_ERROR = 3& ' MB_ERROR
%EQUATE `ALERT_SYSTEM_QUERY = 4& ' MB_QUESTION
%EQUATE `ALERT_SYSTEM_CRITICAL = 5& ' HardSysErrBox
%EQUATE `CALERT_SYSTEM = 6&
' // Size = 48 bytes
TYPE GUITHREADINFO DWORD
 cbSize AS DWORD
 flags AS DWORD
 hwndActive AS DWORD
 hwndFocus AS DWORD
 hwndCapture AS DWORD
 hwndMenuOwner AS DWORD
 hwndMoveSize AS DWORD
 hwndCaret AS DWORD
 rcCaret AS RECT ' RECT
END TYPE
%EQUATE `GUI_CARETBLINKING = &H00000001
%EQUATE `GUI_INMOVESIZE = &H00000002
%EQUATE `GUI_INMENUMODE = &H00000004
%EQUATE `GUI_SYSTEMMENUMODE = &H00000008
%EQUATE `GUI_POPUPMENUMODE = &H00000010
'#if(_WIN32_WINNT >= 0x0501)
'#if defined(_WIN64)
'#define GUI_16BITTASK 0x00000000
'#else
'#define GUI_16BITTASK 0x00000020
'#endif
%EQUATE `GUI_16BITTASK = &H00000020
DECLARE FUNCTION GetGUIThreadInfo LIB "user32.dll" ALIAS "GetGUIThreadInfo" ( BYVAL idThread AS QUAD , BYREF pgui AS GUITHREADINFO ) AS LONG
DECLARE FUNCTION BlockInput LIB "user32.dll" ALIAS "BlockInput" ( BYVAL fBlockIt AS LONG ) AS LONG 'BOOL fBlockIt
'#if(_WIN32_WINNT >= 0x0600)
%EQUATE `USER_DEFAULT_SCREEN_DPI = 96
DECLARE FUNCTION SetProcessDPIAware LIB "user32.dll" ALIAS "SetProcessDPIAware" ( ) AS LONG
DECLARE FUNCTION IsProcessDPIAware LIB "user32.dll" ALIAS "IsProcessDPIAware" ( ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0600 */
DECLARE FUNCTION GetWindowModuleFileNameA LIB "user32.dll" ALIAS "GetWindowModuleFileNameA" ( BYVAL hWnd AS QUAD , BYREF pszFileName AS ASCIIZ , BYVAL cchFileNameMax AS QUAD ) AS QUAD ' UINT
DECLARE FUNCTION GetWindowModuleFileNameW LIB "user32.dll" ALIAS "GetWindowModuleFileNameW" ( BYVAL hWnd AS QUAD , BYREF pszFileName AS WSTRINGZ , BYVAL cchFileNameMax AS QUAD ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO GetWindowModuleFileName = GetWindowModuleFileNameW
#ELSE
 MACRO GetWindowModuleFileName = GetWindowModuleFileNameA
#ENDIF
'#ifndef NO_STATE_FLAGS
'#IF NOT %DEF(%NO_STATE_FLAGS)
%EQUATE `STATE_SYSTEM_UNAVAILABLE = &H00000001 ' Disabled
%EQUATE `STATE_SYSTEM_SELECTED = &H00000002
%EQUATE `STATE_SYSTEM_FOCUSED = &H00000004
%EQUATE `STATE_SYSTEM_PRESSED = &H00000008
%EQUATE `STATE_SYSTEM_CHECKED = &H00000010
%EQUATE `STATE_SYSTEM_MIXED = &H00000020 ' 3-state checkbox or toolbar button
%EQUATE `STATE_SYSTEM_INDETERMINATE = %STATE_SYSTEM_MIXED
%EQUATE `STATE_SYSTEM_READONLY = &H00000040
%EQUATE `STATE_SYSTEM_HOTTRACKED = &H00000080
%EQUATE `STATE_SYSTEM_DEFAULT = &H00000100
%EQUATE `STATE_SYSTEM_EXPANDED = &H00000200
%EQUATE `STATE_SYSTEM_COLLAPSED = &H00000400
%EQUATE `STATE_SYSTEM_BUSY = &H00000800
%EQUATE `STATE_SYSTEM_FLOATING = &H00001000 ' Children "owned" not "contained" by parent
%EQUATE `STATE_SYSTEM_MARQUEED = &H00002000
%EQUATE `STATE_SYSTEM_ANIMATED = &H00004000
%EQUATE `STATE_SYSTEM_INVISIBLE = &H00008000
%EQUATE `STATE_SYSTEM_OFFSCREEN = &H00010000
%EQUATE `STATE_SYSTEM_SIZEABLE = &H00020000
%EQUATE `STATE_SYSTEM_MOVEABLE = &H00040000
%EQUATE `STATE_SYSTEM_SELFVOICING = &H00080000
%EQUATE `STATE_SYSTEM_FOCUSABLE = &H00100000
%EQUATE `STATE_SYSTEM_SELECTABLE = &H00200000
%EQUATE `STATE_SYSTEM_LINKED = &H00400000
%EQUATE `STATE_SYSTEM_TRAVERSED = &H00800000
%EQUATE `STATE_SYSTEM_MULTISELECTABLE = &H01000000 ' Supports multiple selection
%EQUATE `STATE_SYSTEM_EXTSELECTABLE = &H02000000 ' Supports extended selection
%EQUATE `STATE_SYSTEM_ALERT_LOW = &H04000000 ' This information is of low priority
%EQUATE `STATE_SYSTEM_ALERT_MEDIUM = &H08000000 ' This information is of medium priority
%EQUATE `STATE_SYSTEM_ALERT_HIGH = &H10000000 ' This information is of high priority
%EQUATE `STATE_SYSTEM_PROTECTED = &H20000000 ' access to this is restricted
%EQUATE `STATE_SYSTEM_VALID = &H3FFFFFFF
'#ENDIF
'#endif
%EQUATE `CCHILDREN_TITLEBAR = 5&
%EQUATE `CCHILDREN_SCROLLBAR = 5&
'/*
' * Information about the global cursor.
' */
' // Size = 20 bytes
TYPE CURSORINFO DWORD
 cbSize AS DWORD
 flags AS DWORD
 hCursor AS DWORD ' HCURSOR
 ptScreenPos AS POINT
END TYPE
%EQUATE `CURSOR_SHOWING = &H00000001
DECLARE FUNCTION GetCursorInfo LIB "user32.dll" ALIAS "GetCursorInfo" ( BYREF pci AS CURSORINFO ) AS LONG
'/*
' * Window information snapshot
' */
' // Size = 60 bytes
TYPE WINDOWINFO DWORD FILL
 cbSize AS DWORD
 rcWindow AS RECT ' RECT
 rcClient AS RECT ' RECT
 dwStyle AS DWORD
 dwExStyle AS DWORD
 dwWindowStatus AS DWORD
 cxWindowBorders AS DWORD ' UINT
 cyWindowBorders AS DWORD ' UINT
 atomWindowType AS WORD ' ATOM
 wCreatorVersion AS WORD ' WORD
END TYPE
%EQUATE `WS_ACTIVECAPTION = &H0001
DECLARE FUNCTION GetWindowInfo LIB "user32.dll" ALIAS "GetWindowInfo" ( BYVAL hWnd AS QUAD , BYREF pwi AS WINDOWINFO ) AS LONG
'/*
' * Titlebar information.
' */
' // Size = 44 bytes
TYPE TITLEBARINFO DWORD
 cbSize AS DWORD
 rcTitleBar AS RECT ' RECT
 rgstate (%CCHILDREN_TITLEBAR) AS DWORD ' DWORD rgstate[CCHILDREN_TITLEBAR + 1]
END TYPE
DECLARE FUNCTION GetTitleBarInfo LIB "user32.dll" ALIAS "GetTitleBarInfo" ( BYVAL hWnd AS QUAD , BYREF pti AS TITLEBARINFO ) AS LONG
'#if(WINVER >= 0x0600)
' // Size = 140 bytes
TYPE TITLEBARINFOEX DWORD
 cbSize AS DWORD
 rcTitleBar AS RECT
 rgstate(%CCHILDREN_TITLEBAR) AS DWORD
 rgrect(%CCHILDREN_TITLEBAR) AS RECT
END TYPE
'#endif /* WINVER >= 0x0600 */
'/*
' * Menubar information
' */
' // Size = 32 bytes
TYPE MENUBARINFO DWORD
 cbSize AS DWORD ' DWORD cbSize
 rcBar AS RECT ' RECT rcBar; // rect of bar, popup, item
 hMenu AS DWORD ' HMENU hMenu; // real menu handle of bar, popup
 hwndMenu AS DWORD ' hwnd of item submenu if one
 fBarFocused AS BIT * 1 IN DWORD ' BOOL fBarFocused:1; // bar, popup has the focus
 fFocused AS BIT * 1 ' BOOL fFocused:1; // item has the focus
END TYPE
DECLARE FUNCTION GetMenuBarInfo LIB "user32.dll" ALIAS "GetMenuBarInfo" ( BYVAL hWnd AS QUAD , BYVAL idObject AS LONG , BYVAL idItem AS LONG , BYREF pmbi AS MENUBARINFO ) AS LONG
'/*
' * Scrollbar information
' */
' // Size = 60 bytes
TYPE SCROLLBARINFO DWORD
 cbSize AS DWORD
 rcScrollBar AS RECT ' RECT
 dxyLineButton AS LONG ' int
 xyThumbTop AS LONG ' int
 xyThumbBottom AS LONG ' int
 reserved AS LONG ' int
 rgstate(%CCHILDREN_SCROLLBAR) AS DWORD ' DWORD rgstate[CCHILDREN_SCROLLBAR + 1]
END TYPE
DECLARE FUNCTION GetScrollBarInfo LIB "user32.dll" ALIAS "GetScrollBarInfo" ( BYVAL hWnd AS QUAD , BYVAL idObject AS LONG , BYREF psbi AS SCROLLBARINFO ) AS LONG
'/*
' * Combobox information
' */
' // Size = 52 bytes
TYPE COMBOBOXINFO DWORD
 cbSize AS DWORD
 rcItem AS RECT ' RECT
 rcButton AS RECT ' RECT
 stateButton AS DWORD
 hwndCombo AS DWORD
 hwndItem AS DWORD
 hwndList AS DWORD
END TYPE
DECLARE FUNCTION GetComboBoxInfo LIB "user32.dll" ALIAS "GetComboBoxInfo" ( BYVAL hWnd AS QUAD , BYREF pcbi AS COMBOBOXINFO ) AS LONG
'/*
' * The "real" ancestor window
' */
%EQUATE `GA_PARENT = 1&
%EQUATE `GA_ROOT = 2%
%EQUATE `GA_ROOTOWNER = 3&
DECLARE FUNCTION GetAncestor LIB "user32.dll" ALIAS "GetAncestor" ( BYVAL hWnd AS QUAD , BYVAL gaFlags AS QUAD ) AS QUAD
'/*
' * This gets the REAL child window at the point. If it is in the dead
' * space of a group box, it will try a sibling behind it. But static
' * fields will get returned. In other words, it is kind of a cross between
' * ChildWindowFromPointEx and WindowFromPoint.
' */
DECLARE FUNCTION RealChildWindowFromPoint LIB "user32.dll" ALIAS "RealChildWindowFromPoint" ( BYVAL hwndParent AS QUAD , BYVAL ptParentClientCoords AS POINT ) AS QUAD
' // Same as above, but using x, y coordinates
DECLARE FUNCTION RealChildWindowFromXY LIB "user32.dll" ALIAS "RealChildWindowFromPoint" ( BYVAL hwndParent AS QUAD , BYVAL x AS LONG , BYVAL y AS LONG ) AS QUAD
'/*
' * This gets the name of the window TYPE, not class. This allows us to
' * recognize ThunderButton32 et al.
' */
DECLARE FUNCTION RealGetWindowClassA LIB "user32.dll" ALIAS "RealGetWindowClassA" ( BYVAL hWnd AS QUAD , BYREF ptszClassName AS ASCIIZ , BYVAL cchClassNameMax AS QUAD ) AS QUAD ' UINT
'/*
' * This gets the name of the window TYPE, not class. This allows us to
' * recognize ThunderButton32 et al.
' */
DECLARE FUNCTION RealGetWindowClassW LIB "user32.dll" ALIAS "RealGetWindowClassW" ( BYVAL hWnd AS QUAD , BYREF ptszClassName AS WSTRINGZ , BYVAL cchClassNameMax AS QUAD ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO RealGetWindowClass = RealGetWindowClassW
#ELSE
 MACRO RealGetWindowClass = RealGetWindowClassA
#ENDIF
'/*
' * Alt-Tab Switch window information.
' */
' // Size = 40 bytes
TYPE ALTTABINFO DWORD
 cbSize AS DWORD
 cItems AS LONG ' int
 cColumns AS LONG ' int
 cRows AS LONG ' int
 iColFocus AS LONG ' int
 iRowFocus AS LONG ' int
 cxItem AS LONG ' int
 cyItem AS LONG ' int
 ptStart AS POINT
END TYPE
DECLARE FUNCTION GetAltTabInfoA LIB "user32.dll" ALIAS "GetAltTabInfoA" ( BYVAL hwnd AS QUAD , BYVAL iItem AS LONG , BYREF pati AS ALTTABINFO , BYREF pszItemText AS ASCIIZ , BYVAL cchItemText AS QUAD ) AS LONG
DECLARE FUNCTION GetAltTabInfoW LIB "user32.dll" ALIAS "GetAltTabInfoW" ( BYVAL hwnd AS QUAD
 , BYVAL iItem AS LONG
 , BYREF pati AS ALTTABINFO
 , BYREF pszItemText AS WSTRINGZ
 , BYVAL cchItemText AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetAltTabInfo = GetAltTabInfoW
#ELSE
 MACRO GetAltTabInfo = GetAltTabInfoA
#ENDIF
'/*
' * Listbox information.
' * Returns the number of items per row.
' */
DECLARE FUNCTION GetListBoxInfo LIB "user32.dll" ALIAS "GetListBoxInfo" ( BYVAL hWnd AS QUAD ) AS QUAD
'#endif /* NOWINABLE */
'#ENDIF ' #IF NOT %DEF(%NOWINABLE) ' -----------------------------------------
'#endif /* WINVER >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0500)
DECLARE FUNCTION LockWorkStation LIB "user32.dll" ALIAS "LockWorkStation" ( ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0500)
DECLARE FUNCTION UserHandleGrantAccess LIB "user32.dll" ALIAS "UserHandleGrantAccess" ( BYVAL hUserHandle AS QUAD , BYVAL hJob AS QUAD , BYVAL bGrant AS LONG ) AS LONG
'#endif /* _WIN32_WINNT >= 0x0500 */
'#if(_WIN32_WINNT >= 0x0501)
'/*
' * Raw Input Messages.
' */
'DECLARE_HANDLE(HRAWINPUT);
'/*
' * WM_INPUT wParam
' */
'/*
' * Use this macro to get the input code from wParam.
' */
'#define GET_RAWINPUT_CODE_WPARAM(wParam) ((wParam) & 0xff)
MACRO GET_RAWINPUT_CODE_WPARAM(wParam) = wParam AND %Hff
'/*
' * The input is in the regular message flow,
' * the app is required to call DefWindowProc
' * so that the system can perform clean ups.
' */
%EQUATE `RIM_INPUT = 0&
'/*
' * The input is sink only. The app is expected
' * to behave nicely.
' */
%EQUATE `RIM_INPUTSINK = 1&
'/*
' * Raw Input data header
' */
' // Size = 16 bytes
TYPE RAWINPUTHEADER DWORD
 dwType AS DWORD
 dwSize AS DWORD
 hDevice AS DWORD
 wParam AS DWORD ' WPARAM
END TYPE
'/*
' * Type of the raw input
' */
%EQUATE `RIM_TYPEMOUSE = 0&
%EQUATE `RIM_TYPEKEYBOARD = 1&
%EQUATE `RIM_TYPEHID = 2&
'/*
' * Raw format of the mouse input
' */
'typedef struct tagRAWMOUSE {
' /*
' * Indicator flags.
' */
' USHORT usFlags;
' /*
' * The transition state of the mouse buttons.
' */
' union {
' ULONG ulButtons;
' struct {
' USHORT usButtonFlags;
' USHORT usButtonData;
' };
' };
' /*
' * The raw state of the mouse buttons.
' */
' ULONG ulRawButtons;
' /*
' * The signed relative or absolute motion in the X direction.
' */
' LONG lLastX;
' /*
' * The signed relative or absolute motion in the Y direction.
' */
' LONG lLastY;
' /*
' * Device-specific additional information for the event.
' */
' ULONG ulExtraInformation;
'} RAWMOUSE, *PRAWMOUSE, *LPRAWMOUSE;
' // Size = 4 bytes
TYPE RAWMOUSEBUTTON WORD
 usButtonFlags AS WORD
 usButtonData AS WORD
END TYPE
' // Size = 4 bytes
UNION RAWMOUSE_UNION
 ulButtons AS DWORD
 RAWMOUSEBUTTON
END UNION
' // Size = 24 bytes
TYPE RAWMOUSE DWORD
 usFlags AS WORD ' // indicator flags
 RAWMOUSE_UNION ' // the transition state of the mouse buttons
 ulRawButtons AS DWORD ' // the raw state of the mouse buttons
 lLastX AS LONG ' // the signed relative or absolute motion in the X direction
 lLastY AS LONG ' // the signed relative or absolute motion in the Y direction
 ulExtraInformation AS DWORD ' // device-specific additional information for the event
END TYPE
'/*
' * Define the mouse button state indicators.
' */
%EQUATE `RI_MOUSE_LEFT_BUTTON_DOWN = &H0001 ' // Left Button changed to down.
%EQUATE `RI_MOUSE_LEFT_BUTTON_UP = &H0002 ' // Left Button changed to up.
%EQUATE `RI_MOUSE_RIGHT_BUTTON_DOWN = &H0004 ' // Right Button changed to down.
%EQUATE `RI_MOUSE_RIGHT_BUTTON_UP = &H0008 ' // Right Button changed to up.
%EQUATE `RI_MOUSE_MIDDLE_BUTTON_DOWN = &H0010 ' // Middle Button changed to down.
%EQUATE `RI_MOUSE_MIDDLE_BUTTON_UP = &H0020 ' // Middle Button changed to up.
%EQUATE `RI_MOUSE_BUTTON_1_DOWN = %RI_MOUSE_LEFT_BUTTON_DOWN
%EQUATE `RI_MOUSE_BUTTON_1_UP = %RI_MOUSE_LEFT_BUTTON_UP
%EQUATE `RI_MOUSE_BUTTON_2_DOWN = %RI_MOUSE_RIGHT_BUTTON_DOWN
%EQUATE `RI_MOUSE_BUTTON_2_UP = %RI_MOUSE_RIGHT_BUTTON_UP
%EQUATE `RI_MOUSE_BUTTON_3_DOWN = %RI_MOUSE_MIDDLE_BUTTON_DOWN
%EQUATE `RI_MOUSE_BUTTON_3_UP = %RI_MOUSE_MIDDLE_BUTTON_UP
%EQUATE `RI_MOUSE_BUTTON_4_DOWN = &H0040
%EQUATE `RI_MOUSE_BUTTON_4_UP = &H0080
%EQUATE `RI_MOUSE_BUTTON_5_DOWN = &H0100
%EQUATE `RI_MOUSE_BUTTON_5_UP = &H0200
'/*
' * If usButtonFlags has RI_MOUSE_WHEEL, the wheel delta is stored in usButtonData.
' * Take it as a signed value.
' */
%EQUATE `RI_MOUSE_WHEEL = &H0400
'/*
' * Define the mouse indicator flags.
' */
%EQUATE `MOUSE_MOVE_RELATIVE = 0
%EQUATE `MOUSE_MOVE_ABSOLUTE = 1
%EQUATE `MOUSE_VIRTUAL_DESKTOP = &H02 ' // the coordinates are mapped to the virtual desktop
%EQUATE `MOUSE_ATTRIBUTES_CHANGED = &H04 ' // requery for mouse attributes
'#if(WINVER >= 0x0600)
%EQUATE `MOUSE_MOVE_NOCOALESCE = &H08 ' // do not coalesce mouse moves
'#endif /* WINVER >= 0x0600 */
'/*
' * Raw format of the keyboard input
' */
'typedef struct tagRAWKEYBOARD {
' /*
' * The "make" scan code (key depression).
' */
' USHORT MakeCode;
' /*
' * The flags field indicates a "break" (key release) and other
' * miscellaneous scan code information defined in ntddkbd.h.
' */
' USHORT Flags;
' USHORT Reserved;
' /*
' * Windows message compatible information
' */
' USHORT VKey;
' UINT Message;
' /*
' * Device-specific additional information for the event.
' */
' ULONG ExtraInformation;
'} RAWKEYBOARD, *PRAWKEYBOARD, *LPRAWKEYBOARD;
' // Size = 16 bytes
TYPE RAWKEYBOARD DWORD FILL
 MakeCode AS WORD ' // the "make" scan code (key depression)
 Flags AS WORD ' // the flags field indicates a "break" (key release) and other
 Reserved AS WORD ' // miscellaneous scan code information defined in ntddkbd.h
 VKey AS WORD ' // Windows message compatible information
 Message AS DWORD
 ExtraInformation AS DWORD ' // device-specific additional information for the event
END TYPE
'/*
' * Define the keyboard overrun MakeCode.
' */
%EQUATE `KEYBOARD_OVERRUN_MAKE_CODE = &HFF
'/*
' * Define the keyboard input data Flags.
' */
%EQUATE `RI_KEY_MAKE = 0
%EQUATE `RI_KEY_BREAK = 1
%EQUATE `RI_KEY_E0 = 2
%EQUATE `RI_KEY_E1 = 4
%EQUATE `RI_KEY_TERMSRV_SET_LED = 8
%EQUATE `RI_KEY_TERMSRV_SHADOW = &H10
'/*
' * Raw format of the input from Human Input Devices
' */
' // Size = 12 bytes
TYPE RAWHID DWORD
 dwSizeHid AS DWORD ' DWORD // byte size of each report
 dwCount AS DWORD ' DWORD // number of input packed
 bRawData(0) AS BYTE ' BYTE bRawData[1]
END TYPE
'/*
' * RAWINPUT data structure.
' */
'typedef struct tagRAWINPUT {
' RAWINPUTHEADER header;
' union {
' RAWMOUSE mouse;
' RAWKEYBOARD keyboard;
' RAWHID hid;
' } data;
'} RAWINPUT, *PRAWINPUT, *LPRAWINPUT;
' // Size = 24 bytes
UNION RAWINPUT_UNION DWORD
 mouse AS RAWMOUSE ' RAWMOUSE
 keyboard AS RAWKEYBOARD ' RAWKEYBOARD
 hid AS RAWHID ' RAWHID
END UNION
UNION RAWINPUT_DATA_UNION DWORD
 data AS RAWINPUT_UNION
 RAWINPUT_UNION
END UNION
' // Size = 40 bytes
TYPE RAWINPUT DWORD
 header AS RAWINPUTHEADER
 RAWINPUT_DATA_UNION
END TYPE
'#ifdef _WIN64
'#define RAWINPUT_ALIGN(x) (((x) + sizeof(QWORD) - 1) & ~(sizeof(QWORD) - 1))
'#else // _WIN64
'#define RAWINPUT_ALIGN(x) (((x) + sizeof(DWORD) - 1) & ~(sizeof(DWORD) - 1))
'#endif // _WIN64
'#define NEXTRAWINPUTBLOCK(ptr) ((PRAWINPUT)RAWINPUT_ALIGN((ULONG_PTR)((PBYTE)(ptr) + (ptr)->header.dwSize)))
'/*
' * Flags for GetRawInputData
' */
%EQUATE `RID_INPUT = &H10000003
%EQUATE `RID_HEADER = &H10000005
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetRawInputData LIB "User32.dll" ALIAS "GetRawInputData" (BYVAL hRawInput AS QUAD, BYVAL uiCommand AS QUAD, BYVAL pData AS QUAD, pcbSize AS QUAD, BYVAL cbSizeHeader AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION GetRawInputData LIB "user32.dll" ALIAS "GetRawInputData" ( BYVAL hRawInput AS QUAD , BYVAL uiCommand AS QUAD , BYREF pData AS ANY , BYREF pcbSize AS QUAD , BYVAL cbSizeHeader AS QUAD ) AS QUAD ' UINT
#ENDIF
'/*
' * Raw Input Device Information
' */
%EQUATE `RIDI_PREPARSEDDATA = &H20000005
%EQUATE `RIDI_DEVICENAME = &H20000007 ' the return value is the character length, not the byte size
%EQUATE `RIDI_DEVICEINFO = &H2000000b
' // Size = 16 bytes
TYPE RID_DEVICE_INFO_MOUSE DWORD
 dwId AS DWORD
 dwNumberOfButtons AS DWORD
 dwSampleRate AS DWORD
 fHasHorizontalWheel AS LONG
END TYPE
' // Size = 24 bytes
TYPE RID_DEVICE_INFO_KEYBOARD DWORD
 dwType AS DWORD
 dwSubType AS DWORD
 dwKeyboardMode AS DWORD
 dwNumberOfFunctionKeys AS DWORD
 dwNumberOfIndicators AS DWORD
 dwNumberOfKeysTotal AS DWORD
END TYPE
' // Size = 16 bytes
TYPE RID_DEVICE_INFO_HID DWORD FILL
 dwVendorId AS DWORD
 dwProductId AS DWORD
 dwVersionNumber AS DWORD
 ' Top level collection UsagePage and Usage
 usUsagePage AS WORD ' USHORT
 usUsage AS WORD ' USHORT
END TYPE
'typedef struct tagRID_DEVICE_INFO {
' DWORD cbSize;
' DWORD dwType;
' union {
' RID_DEVICE_INFO_MOUSE mouse;
' RID_DEVICE_INFO_KEYBOARD keyboard;
' RID_DEVICE_INFO_HID hid;
' };
'} RID_DEVICE_INFO, *PRID_DEVICE_INFO, *LPRID_DEVICE_INFO;
' // Size = 24 bytes
UNION RID_DEVICE_INFO_UNION DWORD
 mouse AS RID_DEVICE_INFO_MOUSE
 keyboard AS RID_DEVICE_INFO_KEYBOARD
 hid AS RID_DEVICE_INFO_HID
END UNION
' // Size = 32 bytes
TYPE RID_DEVICE_INFO DWORD
 cbSize AS DWORD
 dwType AS DWORD
 RID_DEVICE_INFO_UNION
END TYPE
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetRawInputDeviceInfoA LIB "User32.dll" ALIAS "GetRawInputDeviceInfoA" (BYVAL hDevice AS QUAD, BYVAL uiCommand AS QUAD, BYVAL pData AS QUAD, pcbSize AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION GetRawInputDeviceInfoA LIB "user32.dll" ALIAS "GetRawInputDeviceInfoA" ( BYVAL hDevice AS QUAD , BYVAL uiCommand AS QUAD , BYREF pData AS ANY , BYREF pcbSize AS QUAD ) AS QUAD ' UINT
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetRawInputDeviceInfoW LIB "User32.dll" ALIAS "GetRawInputDeviceInfoW" (BYVAL hDevice AS QUAD, BYVAL uiCommand AS QUAD, BYVAL pData AS QUAD, pcbSize AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION GetRawInputDeviceInfoW LIB "user32.dll" ALIAS "GetRawInputDeviceInfoW" ( BYVAL hDevice AS QUAD , BYVAL uiCommand AS QUAD , BYREF pData AS ANY , BYREF pcbSize AS QUAD ) AS QUAD ' UINT
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetRawInputDeviceInfo = GetRawInputDeviceInfoW
#ELSE
 MACRO GetRawInputDeviceInfo = GetRawInputDeviceInfoA
#ENDIF
'/*
' * Raw Input Bulk Read: GetRawInputBuffer
' */
DECLARE FUNCTION GetRawInputBuffer LIB "user32.dll" ALIAS "GetRawInputBuffer" ( BYREF pData AS RAWINPUT , BYREF pcbSize AS QUAD , BYVAL cbSizeHeader AS QUAD ) AS QUAD ' UINT
'/*
' * Raw Input request APIs
' */
' // Size = 12 bytes
TYPE RAWINPUTDEVICE DWORD FILL
 usUsagePage AS WORD ' USHORT // Toplevel collection UsagePage
 usUsage AS WORD ' USHORT // Toplevel collection Usage
 dwFlags AS DWORD
 hwndTarget AS DWORD ' HWND // Target hwnd. NULL = follows keyboard focus
END TYPE
%EQUATE `RIDEV_REMOVE = &H00000001
%EQUATE `RIDEV_EXCLUDE = &H00000010
%EQUATE `RIDEV_PAGEONLY = &H00000020
%EQUATE `RIDEV_NOLEGACY = &H00000030
%EQUATE `RIDEV_CAPTUREMOUSE = &H00000200 ' // effective when mouse nolegacy is specified, otherwise it would be an error
%EQUATE `RIDEV_NOHOTKEYS = &H00000200 ' // effective for keyboard.
%EQUATE `RIDEV_APPKEYS = &H00000400 ' // effective for keyboard.
'#if(_WIN32_WINNT >= 0x0501)
%EQUATE `RIDEV_EXINPUTSINK = &H00001000
%EQUATE `RIDEV_DEVNOTIFY = &H00002000
'#endif /* _WIN32_WINNT >= 0x0501 */
%EQUATE `RIDEV_EXMODEMASK = &H000000F0
'#define RIDEV_EXMODE(mode) ((mode) & RIDEV_EXMODEMASK)
MACRO RIDEV_EXMODE(mode) = mode AND %RIDEV_EXMODEMASK
'#if(_WIN32_WINNT >= 0x0501)
'/*
' * Flags for the WM_INPUT_DEVICE_CHANGE message.
' */
%EQUATE `GIDC_ARRIVAL = 1
%EQUATE `GIDC_REMOVAL = 2
'#if (_WIN32_WINNT >= 0x0601)
'#define GET_DEVICE_CHANGE_WPARAM(wParam) (LOWORD(wParam))
MACRO GET_DEVICE_CHANGE_WPARAM(wParam) = LO(WORD, wParam)
'#elif (_WIN32_WINNT >= 0x0501)
'#define GET_DEVICE_CHANGE_LPARAM(lParam) (LOWORD(lParam))
MACRO GET_DEVICE_CHANGE_LPARAM(lParam) = LO(WORD, lParam)
'#endif /* (_WIN32_WINNT >= 0x0601) */
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION RegisterRawInputDevices LIB "User32.dll" ALIAS "RegisterRawInputDevices" (BYVAL pRawInputDevices AS RAWINPUTDEVICE PTR, BYVAL uiNumDevices AS QUAD, BYVAL cbSize AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION RegisterRawInputDevices LIB "user32.dll" ALIAS "RegisterRawInputDevices" ( BYREF pRawInputDevices AS RAWINPUTDEVICE , BYVAL uiNumDevices AS QUAD , BYVAL cbSize AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetRegisteredRawInputDevices LIB "User32.dll" ALIAS "GetRegisteredRawInputDevices" (BYVAL pRawInputDevices AS RAWINPUTDEVICE PTR, puiNumDevices AS QUAD, BYVAL cbSize AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION GetRegisteredRawInputDevices LIB "user32.dll" ALIAS "GetRegisteredRawInputDevices" ( BYREF pRawInputDevices AS RAWINPUTDEVICE , BYREF uiNumDevices AS QUAD , BYVAL cbSize AS QUAD ) AS QUAD ' UINT
#ENDIF
' // Size = 8 bytes
TYPE RAWINPUTDEVICELIST DWORD
 hDevice AS DWORD
 dwType AS DWORD
END TYPE
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetRawInputDeviceList LIB "User32.dll" ALIAS "GetRawInputDeviceList" (BYVAL pRawInputDeviceList AS RAWINPUTDEVICELIST PTR, puiNumDevices AS QUAD, BYVAL cbSize AS QUAD) AS QUAD
#ELSE
DECLARE FUNCTION GetRawInputDeviceList LIB "user32.dll" ALIAS "GetRawInputDeviceList" ( BYREF pRawInputDeviceList AS RAWINPUTDEVICELIST , BYREF puiNumDevices AS QUAD , BYVAL cbSize AS QUAD ) AS QUAD ' UINT
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION DefRawInputProc LIB "User32.dll" ALIAS "DefRawInputProc" (BYVAL paRawInput AS RAWINPUT PTR, BYVAL nInput AS LONG, BYVAL cbSizeHeader AS QUAD) AS LONG
#ELSE
DECLARE FUNCTION DefRawInputProc LIB "user32.dll" ALIAS "DefRawInputProc" ( BYREF paRawInput AS RAWINPUT , BYVAL nInput AS LONG , BYVAL cbSizeHeader AS QUAD ) AS LONG ' LRESULT
#ENDIF
'#endif /* _WIN32_WINNT >= 0x0501 */
'/*
' * Message Filter
' */
'#if(WINVER >= 0x0600)
%EQUATE `MSGFLT_ADD = 1
%EQUATE `MSGFLT_REMOVE = 2
DECLARE FUNCTION ChangeWindowMessageFilter LIB "user32.dll" ALIAS "ChangeWindowMessageFilter" ( BYVAL message AS QUAD , BYVAL dwFlag AS QUAD ) AS LONG
'#endif /* WINVER >= 0x0600 */
'#if(WINVER >= 0x0601)
'/*
' * Message filter info values (CHANGEFILTERSTRUCT.ExtStatus)
' */
%EQUATE `MSGFLTINFO_NONE = 0
%EQUATE `MSGFLTINFO_ALREADYALLOWED_FORWND = 1
%EQUATE `MSGFLTINFO_ALREADYDISALLOWED_FORWND = 2
%EQUATE `MSGFLTINFO_ALLOWED_HIGHER = 3
' // Size = 8 bytes
TYPE CHANGEFILTERSTRUCT DWORD
 cbSize AS DWORD
 ExtStatus AS DWORD
END TYPE
'/*
' * Message filter action values (action parameter to ChangeWindowMessageFilterEx)
' */
%EQUATE `MSGFLT_RESET = 0
%EQUATE `MSGFLT_ALLOW = 1
%EQUATE `MSGFLT_DISALLOW = 2
DECLARE FUNCTION ChangeWindowMessageFilterEx LIB "user32.dll" ALIAS "ChangeWindowMessageFilterEx" ( BYVAL hwnd AS QUAD , BYVAL message AS QUAD , BYVAL action AS QUAD , OPTIONAL BYREF pChangeFilterStruct AS CHANGEFILTERSTRUCT ) AS LONG
'#endif /* WINVER >= 0x0601 */
'#if(WINVER >= 0x0601)
'/*
' * Gesture defines and functions
' */
'/*
' * Gesture information handle
' */
'DECLARE_HANDLE(HGESTUREINFO);
'/*
' * Gesture flags - GESTUREINFO.dwFlags
' */
%EQUATE `GF_BEGIN = &H00000001
%EQUATE `GF_INERTIA = &H00000002
%EQUATE `GF_END = &H00000004
'/*
' * Gesture IDs
' */
%EQUATE `GID_BEGIN = 1
%EQUATE `GID_END = 2
%EQUATE `GID_ZOOM = 3
%EQUATE `GID_PAN = 4
%EQUATE `GID_ROTATE = 5
%EQUATE `GID_TWOFINGERTAP = 6
%EQUATE `GID_PRESSANDTAP = 7
%EQUATE `GID_ROLLOVER = %GID_PRESSANDTAP
'/*
' * Gesture information structure
' * - Pass the HGESTUREINFO received in the WM_GESTURE message lParam into the
' * GetGestureInfo function to retrieve this information.
' * - If cbExtraArgs is non-zero, pass the HGESTUREINFO received in the WM_GESTURE
' * message lParam into the GetGestureExtraArgs function to retrieve extended
' * argument information.
' */
' // Size = 48 bytes
TYPE GESTUREINFO QWORD FILL ' Must be 8 bytes aligned
 cbSize AS DWORD ' UINT // size, in bytes, of this structure (including variable length Args field)
 dwFlags AS DWORD ' DWORD // see GF_* flags
 dwID AS DWORD ' DWORD // gesture ID, see GID_* defines
 hwndTarget AS DWORD ' HWND // handle to window targeted by this gesture
 ptsLocation AS POINTS ' POINTS // current location of this gesture
 dwInstanceID AS DWORD ' DWORD // internally used
 dwSequenceID AS DWORD ' DWORD // internally used
 ullArguments AS QUAD ' ULONGLONG // arguments for gestures whose arguments fit in 8 BYTES
 cbExtraArgs AS DWORD ' UINT // size, in bytes, of extra arguments, if any, that accompany this gesture
 alignment__ AS DWORD ' // To keep 8 byte alignment
END TYPE
'/*
' * Gesture notification structure
' * - The WM_GESTURENOTIFY message lParam contains a pointer to this structure.
' * - The WM_GESTURENOTIFY message notifies a window that gesture recognition is
' * in progress and a gesture will be generated if one is recognized under the
' * current gesture settings.
' */
' // Size = 20 bytes
TYPE GESTURENOTIFYSTRUCT DWORD
 cbSize AS DWORD ' UINT // size, in bytes, of this structure
 dwFlags AS DWORD ' DWORD // unused
 hwndTarget AS DWORD ' HWND // handle to window targeted by the gesture
 ptsLocation AS POINTS ' POINTS // starting location
 dwInstanceID AS DWORD ' DWORD // internally used
END TYPE
'/*
' * Gesture argument helpers
' * - Angle should be a double in the range of -2pi to +2pi
' * - Argument should be an unsigned 16-bit value
' */
'#define GID_ROTATE_ANGLE_TO_ARGUMENT(_arg_) ((USHORT)((((_arg_) + 2.0 * 3.14159265) / (4.0 * 3.14159265)) * 65535.0))
MACRO GID_ROTATE_ANGLE_TO_ARGUMENT(arg) = BITS(WORD, (arg + 2.0 * 3.14159265) / (4.0 * 3.14159265)) * 65535.0
'#define GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_) ((((double)(_arg_) / 65535.0) * 4.0 * 3.14159265) - 2.0 * 3.14159265)
MACRO GID_ROTATE_ANGLE_FROM_ARGUMENT(arg) = ((arg / 65535.0) * 4.0 * 3.14159265) - 2.0 * 3.14159265
'/*
' * Gesture information retrieval
' * - HGESTUREINFO is received by a window in the lParam of a WM_GESTURE message.
' */
DECLARE FUNCTION GetGestureInfo LIB "user32.dll" ALIAS "GetGestureInfo" ( BYVAL hGestureInfo AS QUAD , BYREF pGestureInfo AS GESTUREINFO ) AS LONG
'/*
' * Gesture extra arguments retrieval
' * - HGESTUREINFO is received by a window in the lParam of a WM_GESTURE message.
' * - Size, in bytes, of the extra argument data is available in the cbExtraArgs
' * field of the GESTUREINFO structure retrieved using the GetGestureInfo function.
' */
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetGestureExtraArgs LIB "User32.dll" ALIAS "GetGestureExtraArgs" ( BYVAL hGestureInfo AS QUAD, ' HGESTUREINFO
 BYVAL cbExtraArgs AS DWORD, ' UINT
 BYVAL pExtraArgs AS BYTE PTR) AS LONG
#ELSE
DECLARE FUNCTION GetGestureExtraArgs LIB "user32.dll" ALIAS "GetGestureExtraArgs" ( BYVAL hGestureInfo AS QUAD , BYVAL cbExtraArgs AS QUAD , BYREF pExtraArgs AS ANY ) AS LONG
#ENDIF
'/*
' * Gesture information handle management
' * - If an application processes the WM_GESTURE message, then once it is done
' * with the associated HGESTUREINFO, the application is responsible for
' * closing the handle using this function. Failure to do so may result in
' * process memory leaks.
' * - If the message is instead passed to DefWindowProc, or is forwarded using
' * one of the PostMessage or SendMessage class of API functions, the handle
' * is transfered with the message and need not be closed by the application.
' */
DECLARE FUNCTION CloseGestureInfoHandle LIB "user32.dll" ALIAS "CloseGestureInfoHandle" ( BYVAL hGestureInfo AS QUAD ) AS LONG
'/*
' * Gesture configuration structure
' * - Used in SetGestureConfig and GetGestureConfig
' * - Note that any setting not included in either GESTURECONFIG.dwWant or
' * GESTURECONFIG.dwBlock will use the parent window's preferences or
' * system defaults.
' */
' // Size = 12 bytes
TYPE GESTURECONFIG DWORD
 dwID AS DWORD ' DWORD // gesture ID
 dwWant AS DWORD ' DWORD // settings related to gesture ID that are to be turned on
 dwBlock AS DWORD ' DWORD // settings related to gesture ID that are to be turned off
END TYPE
'/*
' * Gesture configuration flags - GESTURECONFIG.dwWant or GESTURECONFIG.dwBlock
' */
'/*
' * Common gesture configuration flags - set GESTURECONFIG.dwID to zero
' */
%EQUATE `GC_ALLGESTURES = &H00000001
'/*
' * Zoom gesture configuration flags - set GESTURECONFIG.dwID to GID_ZOOM
' */
%EQUATE `GC_ZOOM = &H00000001
'/*
' * Pan gesture configuration flags - set GESTURECONFIG.dwID to GID_PAN
' */
%EQUATE `GC_PAN = &H00000001
%EQUATE `GC_PAN_WITH_SINGLE_FINGER_VERTICALLY = &H00000002
%EQUATE `GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY = &H00000004
%EQUATE `GC_PAN_WITH_GUTTER = &H00000008
%EQUATE `GC_PAN_WITH_INERTIA = &H00000010
'/*
' * Rotate gesture configuration flags - set GESTURECONFIG.dwID to GID_ROTATE
' */
%EQUATE `GC_ROTATE = &H00000001
'/*
' * Two finger tap gesture configuration flags - set GESTURECONFIG.dwID to GID_TWOFINGERTAP
' */
%EQUATE `GC_TWOFINGERTAP = &H00000001
'/*
' * PressAndTap gesture configuration flags - set GESTURECONFIG.dwID to GID_PRESSANDTAP
' */
%EQUATE `GC_PRESSANDTAP = &H00000001
%EQUATE `GC_ROLLOVER = %GC_PRESSANDTAP
%EQUATE `GESTURECONFIGMAXCOUNT = 256 ' // Maximum number of gestures that can be included
 ' // in a single call to SetGestureConfig / GetGestureConfig
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetGestureConfig LIB "User32.dll" ALIAS "SetGestureConfig" ( BYVAL hwnd AS QUAD, ' window for which configuration is specified
 BYVAL dwReserved AS DWORD, ' reserved, must be 0
 BYVAL cIDs AS DWORD, ' count of GESTURECONFIG structures
 BYVAL pGestureConfig AS GESTURECONFIG PTR, ' array of GESTURECONFIG structures, dwIDs will be processed in the
 ' order specified and repeated occurances will overwrite previous ones
 BYVAL cbSize AS DWORD) ' sizeof(GESTURECONFIG)
 AS LONG
#ELSE
DECLARE FUNCTION SetGestureConfig LIB "user32.dll" ALIAS "SetGestureConfig" ( BYVAL hwnd AS QUAD , BYVAL dwReserved AS QUAD , BYVAL cIDs AS QUAD , BYREF pGestureConfig AS GESTURECONFIG , BYVAL cbSize AS QUAD ) AS LONG
#ENDIF
%EQUATE `GCF_INCLUDE_ANCESTORS = &H00000001 ' // If specified, GetGestureConfig returns consolidated configuration
 ' // for the specified window and it's parent window chain
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetGestureConfig LIB "User32.dll" ALIAS "GetGestureConfig" ( BYVAL hwnd AS QUAD, ' window for which configuration is required
 BYVAL dwReserved AS DWORD, ' reserved, must be 0
 BYVAL dwFlags AS DWORD, ' see GCF_* flags
 BYVAL pcIDs AS DWORD PTR, ' *pcIDs contains the size, in number of GESTURECONFIG structures,
 ' of the buffer pointed to by pGestureConfig
 BYVAL pGestureConfig AS GESTURECONFIG PTR, _ ' pointer to buffer to receive the returned array of GESTURECONFIG structures
 BYVAL cbSize AS DWORD) ' sizeof(GESTURECONFIG)
 AS LONG
#ELSE
DECLARE FUNCTION GetGestureConfig LIB "user32.dll" ALIAS "GetGestureConfig" ( BYVAL hwnd AS QUAD , BYVAL dwReserved AS QUAD , BYVAL dwFlags AS QUAD , BYREF pcIDs AS QUAD , BYREF pGestureConfig AS GESTURECONFIG , BYVAL cbSize AS QUAD ) AS LONG
#ENDIF
'#endif /* WINVER >= 0x0601 */
'#if(WINVER >= 0x0601)
'/*
' * GetSystemMetrics(SM_DIGITIZER) flag values
' */
%EQUATE `NID_INTEGRATED_TOUCH = &H00000001
%EQUATE `NID_EXTERNAL_TOUCH = &H00000002
%EQUATE `NID_INTEGRATED_PEN = &H00000004
%EQUATE `NID_EXTERNAL_PEN = &H00000008
%EQUATE `NID_MULTI_INPUT = &H00000040
%EQUATE `NID_READY = &H00000080
'#endif /* WINVER >= 0x0601 */
%EQUATE `MAX_STR_BLOCKREASON = 256
DECLARE FUNCTION ShutdownBlockReasonCreate LIB "user32.dll" ALIAS "ShutdownBlockReasonCreate" ( BYVAL hWnd AS QUAD , BYREF pwszReason AS WSTRINGZ ) AS LONG
DECLARE FUNCTION ShutdownBlockReasonQuery LIB "user32.dll" ALIAS "ShutdownBlockReasonQuery" ( BYVAL hWnd AS QUAD
 , BYREF pwszBuff AS WSTRINGZ
 , BYREF pcchBuff AS DWORD
 ) AS LONG
DECLARE FUNCTION ShutdownBlockReasonDestroy LIB "user32.dll" ALIAS "ShutdownBlockReasonDestroy" ( BYVAL hWnd AS DWORD
 ) AS LONG
#ENDIF
