include stdarg.inc
ifndef _WINBASE_
include winbase.inc
endif

.pragma pack(push, 8)

ifndef _WINUSER_
define _WINUSER_

ifndef WINVER
define WINVER 0x0500
endif
ifndef _WIN32_WINDOWS
define _WIN32_WINDOWS WINVER
endif
ifndef _WIN32_WINNT
define _WIN32_WINNT _WIN32_WINDOWS
endif

include stdarg.inc

.pragma comment(lib, user32)

ifndef NOUSER

HDWP			typedef HANDLE
MENUTEMPLATEA		equ <>
MENUTEMPLATEW		equ <>
ifdef _UNICODE
MENUTEMPLATE		typedef MENUTEMPLATEW
else
MENUTEMPLATE		typedef MENUTEMPLATEA
endif
LPMENUTEMPLATEA		typedef PVOID
LPMENUTEMPLATEW		typedef PVOID
ifdef _UNICODE
LPMENUTEMPLATE		typedef LPMENUTEMPLATEW
else
LPMENUTEMPLATE		typedef LPMENUTEMPLATEA
endif

CALLBACK(WNDPROC, :HWND, :UINT, :WPARAM, :LPARAM)

ifdef STRICT

CALLBACK(DLGPROC, :HWND, :UINT, :WPARAM, :LPARAM)
CALLBACK(TIMERPROC, :HWND, :UINT, :UINT_PTR, :DWORD)
CALLBACK(GRAYSTRINGPROC, :HDC, :LPARAM, :SINT)
CALLBACK(WNDENUMPROC, :HWND, :LPARAM)
CALLBACK(HOOKPROC, :SINT, :WPARAM, :LPARAM)
CALLBACK(SENDASYNCPROC, :HWND, :UINT, :ULONG_PTR, :LRESULT)
CALLBACK(PROPENUMPROCA, :HWND, :LPCSTR, :HANDLE)
CALLBACK(PROPENUMPROCW, :HWND, :LPCWSTR, :HANDLE)
CALLBACK(PROPENUMPROCEXA, :HWND, :LPSTR, :HANDLE, :ULONG_PTR)
CALLBACK(PROPENUMPROCEXW, :HWND, :LPWSTR, :HANDLE, :ULONG_PTR)
CALLBACK(EDITWORDBREAKPROCA, :LPSTR, :SINT, :SINT, :SINT)
CALLBACK(EDITWORDBREAKPROCW, :LPWSTR, :SINT, :SINT, :SINT)

if(WINVER GE 0x0400)
CALLBACK(DRAWSTATEPROC, hdc:HDC, lData:LPARAM, wData:WPARAM, x:SINT, cy:SINT)
endif

else

DLGPROC			typedef FARPROC
TIMERPROC		typedef FARPROC
GRAYSTRINGPROC		typedef FARPROC
WNDENUMPROC		typedef FARPROC
HOOKPROC		typedef FARPROC
SENDASYNCPROC		typedef FARPROC

EDITWORDBREAKPROCA	typedef FARPROC
EDITWORDBREAKPROCW	typedef FARPROC

PROPENUMPROCA		typedef FARPROC
PROPENUMPROCW		typedef FARPROC

PROPENUMPROCEXA		typedef FARPROC
PROPENUMPROCEXW		typedef FARPROC

if(WINVER GE 0x0400)
DRAWSTATEPROC		typedef FARPROC
endif
endif ; STRICT

ifdef _UNICODE
PROPENUMPROC		typedef PROPENUMPROCW
PROPENUMPROCEX		typedef PROPENUMPROCEXW
EDITWORDBREAKPROC	typedef EDITWORDBREAKPROCW
else
PROPENUMPROC		typedef PROPENUMPROCA
PROPENUMPROCEX		typedef PROPENUMPROCEXA
EDITWORDBREAKPROC	typedef EDITWORDBREAKPROCA
endif

ifdef STRICT
CALLBACK(NAMEENUMPROCA, :LPSTR, :LPARAM)
CALLBACK(NAMEENUMPROCW, :LPWSTR, :LPARAM)
WINSTAENUMPROCA		typedef NAMEENUMPROCA
DESKTOPENUMPROCA	typedef NAMEENUMPROCA
WINSTAENUMPROCW		typedef NAMEENUMPROCW
DESKTOPENUMPROCW	typedef NAMEENUMPROCW
else
NAMEENUMPROCA		typedef FARPROC
NAMEENUMPROCW		typedef FARPROC
WINSTAENUMPROCA		typedef FARPROC
DESKTOPENUMPROCA	typedef FARPROC
WINSTAENUMPROCW		typedef FARPROC
DESKTOPENUMPROCW	typedef FARPROC
endif

ifdef _UNICODE
WINSTAENUMPROC		typedef WINSTAENUMPROCW
DESKTOPENUMPROC		typedef DESKTOPENUMPROCW
else
WINSTAENUMPROC		typedef WINSTAENUMPROCA
DESKTOPENUMPROC		typedef DESKTOPENUMPROCA
endif

MAKEINTRESOURCEA macro i
	exitm<i>
	endm
MAKEINTRESOURCEW macro i
	exitm<i>
	endm
ifdef _UNICODE
MAKEINTRESOURCE		equ <MAKEINTRESOURCEW>
else
MAKEINTRESOURCE		equ <MAKEINTRESOURCEA>
endif

ifndef NORESOURCE

RT_CURSOR		equ 1
RT_BITMAP		equ 2
RT_ICON			equ 3
RT_MENU			equ 4
RT_DIALOG		equ 5
RT_STRING		equ 6
RT_FONTDIR		equ 7
RT_FONT			equ 8
RT_ACCELERATOR		equ 9
RT_RCDATA		equ 10
RT_MESSAGETABLE		equ 11

DIFFERENCE		equ 11
RT_GROUP_CURSOR		equ RT_CURSOR + DIFFERENCE;MAKEINTRESOURCE(RT_CURSOR + DIFFERENCE)
RT_GROUP_ICON		equ RT_ICON + DIFFERENCE;MAKEINTRESOURCE(RT_ICON + DIFFERENCE)
RT_VERSION		equ 16
RT_DLGINCLUDE		equ 17
if(WINVER GE 0x0400)
RT_PLUGPLAY		equ 19
RT_VXD			equ 20
RT_ANICURSOR		equ 21
RT_ANIICON		equ 22
endif
RT_HTML			equ 23

endif ; NORESOURCE

wvsprintfA proto WINAPI :LPSTR, :LPCSTR, :PVOID
wvsprintfW proto WINAPI :LPWSTR, :LPCWSTR, :PVOID
ifdef _UNICODE
wvsprintf		equ <wvsprintfW>
else
wvsprintf		equ <wvsprintfA>
endif
wsprintfA proto __Cdecl :LPSTR, :LPCSTR, :VARARG
wsprintfW proto __Cdecl :LPWSTR, :LPCWSTR, :VARARG
ifdef _UNICODE
wsprintf		equ <wsprintfW>
else
wsprintf		equ <wsprintfA>
endif

SETWALLPAPER_DEFAULT	equ (-1)

ifndef NOSCROLL

SB_HORZ			equ 0
SB_VERT			equ 1
SB_CTL			equ 2
SB_BOTH			equ 3

SB_LINEUP		equ 0
SB_LINELEFT		equ 0
SB_LINEDOWN		equ 1
SB_LINERIGHT		equ 1
SB_PAGEUP		equ 2
SB_PAGELEFT		equ 2
SB_PAGEDOWN		equ 3
SB_PAGERIGHT		equ 3
SB_THUMBPOSITION	equ 4
SB_THUMBTRACK		equ 5
SB_TOP			equ 6
SB_LEFT			equ 6
SB_BOTTOM		equ 7
SB_RIGHT		equ 7
SB_ENDSCROLL		equ 8

endif ; NOSCROLL

ifndef NOSHOWWINDOW

SW_HIDE			equ 0
SW_SHOWNORMAL		equ 1
SW_NORMAL		equ 1
SW_SHOWMINIMIZED	equ 2
SW_SHOWMAXIMIZED	equ 3
SW_MAXIMIZE		equ 3
SW_SHOWNOACTIVATE	equ 4
SW_SHOW			equ 5
SW_MINIMIZE		equ 6
SW_SHOWMINNOACTIVE	equ 7
SW_SHOWNA		equ 8
SW_RESTORE		equ 9
SW_SHOWDEFAULT		equ 10
SW_FORCEMINIMIZE	equ 11
SW_MAX			equ 11

HIDE_WINDOW		equ 0
SHOW_OPENWINDOW		equ 1
SHOW_ICONWINDOW		equ 2
SHOW_FULLSCREEN		equ 3
SHOW_OPENNOACTIVATE	equ 4

SW_PARENTCLOSING	equ 1
SW_OTHERZOOM		equ 2
SW_PARENTOPENING	equ 3
SW_OTHERUNZOOM		equ 4

endif ; NOSHOWWINDOW

if(WINVER GE 0x0500)
AW_HOR_POSITIVE		equ 0x00000001
AW_HOR_NEGATIVE		equ 0x00000002
AW_VER_POSITIVE		equ 0x00000004
AW_VER_NEGATIVE		equ 0x00000008
AW_CENTER		equ 0x00000010
AW_HIDE			equ 0x00010000
AW_ACTIVATE		equ 0x00020000
AW_SLIDE		equ 0x00040000
AW_BLEND		equ 0x00080000
endif

KF_EXTENDED		equ 0x0100
KF_DLGMODE		equ 0x0800
KF_MENUMODE		equ 0x1000
KF_ALTDOWN		equ 0x2000
KF_REPEAT		equ 0x4000
KF_UP			equ 0x8000

ifndef NOVIRTUALKEYCODES

VK_LBUTTON		equ 0x01
VK_RBUTTON		equ 0x02
VK_CANCEL		equ 0x03
VK_MBUTTON		equ 0x04
if(_WIN32_WINNT GE 0x0500)
VK_XBUTTON1		equ 0x05
VK_XBUTTON2		equ 0x06
endif
if defined(__UNIX__) or defined(__TTY__)
VK_BACK			equ 0x7F
else
VK_BACK			equ 0x08
endif
VK_TAB			equ 0x09
VK_CLEAR		equ 0x0C
ifdef __UNIX__
VK_RETURN		equ 0x0A
else
VK_RETURN		equ 0x0D
endif

VK_SHIFT		equ 0x10
VK_CONTROL		equ 0x11
VK_MENU			equ 0x12
VK_PAUSE		equ 0x13
VK_CAPITAL		equ 0x14

VK_KANA			equ 0x15
VK_HANGEUL		equ 0x15
VK_HANGUL		equ 0x15
VK_JUNJA		equ 0x17
VK_FINAL		equ 0x18
VK_HANJA		equ 0x19
VK_KANJI		equ 0x19

VK_ESCAPE		equ 0x1B

VK_CONVERT		equ 0x1C
VK_NONCONVERT		equ 0x1D
VK_ACCEPT		equ 0x1E
VK_MODECHANGE		equ 0x1F

VK_SPACE		equ 0x20
VK_PRIOR		equ 0x21
VK_NEXT			equ 0x22
VK_END			equ 0x23
VK_HOME			equ 0x24
VK_LEFT			equ 0x25
VK_UP			equ 0x26
VK_RIGHT		equ 0x27
VK_DOWN			equ 0x28
VK_SELECT		equ 0x29
VK_PRINT		equ 0x2A
VK_EXECUTE		equ 0x2B
VK_SNAPSHOT		equ 0x2C
VK_INSERT		equ 0x2D
VK_DELETE		equ 0x2E
VK_HELP			equ 0x2F

VK_LWIN			equ 0x5B
VK_RWIN			equ 0x5C
VK_APPS			equ 0x5D

VK_NUMPAD0		equ 0x60
VK_NUMPAD1		equ 0x61
VK_NUMPAD2		equ 0x62
VK_NUMPAD3		equ 0x63
VK_NUMPAD4		equ 0x64
VK_NUMPAD5		equ 0x65
VK_NUMPAD6		equ 0x66
VK_NUMPAD7		equ 0x67
VK_NUMPAD8		equ 0x68
VK_NUMPAD9		equ 0x69
VK_MULTIPLY		equ 0x6A
VK_ADD			equ 0x6B
VK_SEPARATOR		equ 0x6C
VK_SUBTRACT		equ 0x6D
VK_DECIMAL		equ 0x6E
VK_DIVIDE		equ 0x6F
VK_F1			equ 0x70
VK_F2			equ 0x71
VK_F3			equ 0x72
VK_F4			equ 0x73
VK_F5			equ 0x74
VK_F6			equ 0x75
VK_F7			equ 0x76
VK_F8			equ 0x77
VK_F9			equ 0x78
VK_F10			equ 0x79
VK_F11			equ 0x7A
VK_F12			equ 0x7B
VK_F13			equ 0x7C
VK_F14			equ 0x7D
VK_F15			equ 0x7E
VK_F16			equ 0x7F
VK_F17			equ 0x80
VK_F18			equ 0x81
VK_F19			equ 0x82
VK_F20			equ 0x83
VK_F21			equ 0x84
VK_F22			equ 0x85
VK_F23			equ 0x86
VK_F24			equ 0x87

VK_NUMLOCK		equ 0x90
VK_SCROLL		equ 0x91

VK_OEM_NEC_EQUAL	equ 0x92

VK_OEM_FJ_JISHO		equ 0x92
VK_OEM_FJ_MASSHOU	equ 0x93
VK_OEM_FJ_TOUROKU	equ 0x94
VK_OEM_FJ_LOYA		equ 0x95
VK_OEM_FJ_ROYA		equ 0x96

VK_LSHIFT		equ 0xA0
VK_RSHIFT		equ 0xA1
VK_LCONTROL		equ 0xA2
VK_RCONTROL		equ 0xA3
VK_LMENU		equ 0xA4
VK_RMENU		equ 0xA5
if(_WIN32_WINNT GE 0x0500)
VK_BROWSER_BACK		equ 0xA6
VK_BROWSER_FORWARD	equ 0xA7
VK_BROWSER_REFRESH	equ 0xA8
VK_BROWSER_STOP		equ 0xA9
VK_BROWSER_SEARCH	equ 0xAA
VK_BROWSER_FAVORITES	equ 0xAB
VK_BROWSER_HOME		equ 0xAC

VK_VOLUME_MUTE		equ 0xAD
VK_VOLUME_DOWN		equ 0xAE
VK_VOLUME_UP		equ 0xAF
VK_MEDIA_NEXT_TRACK	equ 0xB0
VK_MEDIA_PREV_TRACK	equ 0xB1
VK_MEDIA_STOP		equ 0xB2
VK_MEDIA_PLAY_PAUSE	equ 0xB3
VK_LAUNCH_MAIL		equ 0xB4
VK_LAUNCH_MEDIA_SELECT	equ 0xB5
VK_LAUNCH_APP1		equ 0xB6
VK_LAUNCH_APP2		equ 0xB7
endif

VK_OEM_1		equ 0xBA
VK_OEM_PLUS		equ 0xBB
VK_OEM_COMMA		equ 0xBC
VK_OEM_MINUS		equ 0xBD
VK_OEM_PERIOD		equ 0xBE
VK_OEM_2		equ 0xBF
VK_OEM_3		equ 0xC0
VK_OEM_4		equ 0xDB
VK_OEM_5		equ 0xDC
VK_OEM_6		equ 0xDD
VK_OEM_7		equ 0xDE
VK_OEM_8		equ 0xDF
VK_OEM_AX		equ 0xE1
VK_OEM_102		equ 0xE2
VK_ICO_HELP		equ 0xE3
VK_ICO_00		equ 0xE4

if(WINVER GE 0x0400)
VK_PROCESSKEY		equ 0xE5
endif
VK_ICO_CLEAR		equ 0xE6
if(_WIN32_WINNT GE 0x0500)
VK_PACKET		equ 0xE7
endif

VK_OEM_RESET		equ 0xE9
VK_OEM_JUMP		equ 0xEA
VK_OEM_PA1		equ 0xEB
VK_OEM_PA2		equ 0xEC
VK_OEM_PA3		equ 0xED
VK_OEM_WSCTRL		equ 0xEE
VK_OEM_CUSEL		equ 0xEF
VK_OEM_ATTN		equ 0xF0
VK_OEM_FINISH		equ 0xF1
VK_OEM_COPY		equ 0xF2
VK_OEM_AUTO		equ 0xF3
VK_OEM_ENLW		equ 0xF4
VK_OEM_BACKTAB		equ 0xF5

VK_ATTN			equ 0xF6
VK_CRSEL		equ 0xF7
VK_EXSEL		equ 0xF8
VK_EREOF		equ 0xF9
VK_PLAY			equ 0xFA
VK_ZOOM			equ 0xFB
VK_NONAME		equ 0xFC
VK_PA1			equ 0xFD
VK_OEM_CLEAR		equ 0xFE

endif ; NOVIRTUALKEYCODES

ifndef NOWH

WH_MIN			equ (-1)
WH_MSGFILTER		equ (-1)
WH_JOURNALRECORD	equ 0
WH_JOURNALPLAYBACK	equ 1
WH_KEYBOARD		equ 2
WH_GETMESSAGE		equ 3
WH_CALLWNDPROC		equ 4
WH_CBT			equ 5
WH_SYSMSGFILTER		equ 6
WH_MOUSE		equ 7
ifdef _WIN32_WINDOWS
WH_HARDWARE		equ 8
endif
WH_DEBUG		equ 9
WH_SHELL		equ 10
WH_FOREGROUNDIDLE	equ 11
if(WINVER GE 0x0400)
WH_CALLWNDPROCRET	equ 12
endif

if (_WIN32_WINNT GE 0x0400)
WH_KEYBOARD_LL		equ 13
WH_MOUSE_LL		equ 14
endif

if(WINVER GE 0x0400)
if (_WIN32_WINNT GE 0x0400)
WH_MAX			equ 14
else
WH_MAX			equ 12
endif
else
WH_MAX			equ 11
endif

WH_MINHOOK		equ WH_MIN
WH_MAXHOOK		equ WH_MAX

HC_ACTION		equ 0
HC_GETNEXT		equ 1
HC_SKIP			equ 2
HC_NOREMOVE		equ 3
HC_NOREM		equ HC_NOREMOVE
HC_SYSMODALON		equ 4
HC_SYSMODALOFF		equ 5

HCBT_MOVESIZE		equ 0
HCBT_MINMAX		equ 1
HCBT_QS			equ 2
HCBT_CREATEWND		equ 3
HCBT_DESTROYWND		equ 4
HCBT_ACTIVATE		equ 5
HCBT_CLICKSKIPPED	equ 6
HCBT_KEYSKIPPED		equ 7
HCBT_SYSCOMMAND		equ 8
HCBT_SETFOCUS		equ 9

CBT_CREATEWNDA		STRUC
lpcs			PVOID ?
hwndInsertAfter		HWND ?
CBT_CREATEWNDA		ENDS
LPCBT_CREATEWNDA	typedef ptr CBT_CREATEWNDA
CBT_CREATEWNDW		STRUC
lpcs			PVOID ?
hwndInsertAfter		HWND ?
CBT_CREATEWNDW		ENDS
LPCBT_CREATEWNDW	typedef ptr CBT_CREATEWNDW
ifdef _UNICODE
CBT_CREATEWND		typedef CBT_CREATEWNDW
LPCBT_CREATEWND		typedef LPCBT_CREATEWNDW
else
CBT_CREATEWND		typedef CBT_CREATEWNDA
LPCBT_CREATEWND		typedef LPCBT_CREATEWNDA
endif

CBTACTIVATESTRUCT	STRUC
fMouse			BOOL ?
hWndActive		HWND ?
CBTACTIVATESTRUCT	ENDS
LPCBTACTIVATESTRUCT	typedef ptr CBTACTIVATESTRUCT

if(_WIN32_WINNT GE 0x0501)
WTSSESSION_NOTIFICATION STRUC
cbSize			dd ?
dwSessionId		dd ?
WTSSESSION_NOTIFICATION ENDS
PWTSSESSION_NOTIFICATION typedef ptr WTSSESSION_NOTIFICATION

WTS_CONSOLE_CONNECT	equ 0x1
WTS_CONSOLE_DISCONNECT	equ 0x2
WTS_REMOTE_CONNECT	equ 0x3
WTS_REMOTE_DISCONNECT	equ 0x4
WTS_SESSION_LOGON	equ 0x5
WTS_SESSION_LOGOFF	equ 0x6
WTS_SESSION_LOCK	equ 0x7
WTS_SESSION_UNLOCK	equ 0x8
WTS_SESSION_REMOTE_CONTROL equ 0x9
WTS_SESSION_CREATE	equ 0xa
WTS_SESSION_TERMINATE	equ 0xb
endif

MSGF_DIALOGBOX		equ 0
MSGF_MESSAGEBOX		equ 1
MSGF_MENU		equ 2
MSGF_SCROLLBAR		equ 5
MSGF_NEXTWINDOW		equ 6
MSGF_MAX		equ 8
MSGF_USER		equ 4096

HSHELL_WINDOWCREATED	equ 1
HSHELL_WINDOWDESTROYED	equ 2
HSHELL_ACTIVATESHELLWINDOW equ 3

if(WINVER GE 0x0400)
HSHELL_WINDOWACTIVATED	equ 4
HSHELL_GETMINRECT	equ 5
HSHELL_REDRAW		equ 6
HSHELL_TASKMAN		equ 7
HSHELL_LANGUAGE		equ 8
HSHELL_SYSMENU		equ 9
HSHELL_ENDTASK		equ 10
endif
if(_WIN32_WINNT GE 0x0500)
HSHELL_ACCESSIBILITYSTATE equ 11
HSHELL_APPCOMMAND	equ 12
endif
if(_WIN32_WINNT GE 0x0501)
HSHELL_WINDOWREPLACED	equ 13
HSHELL_WINDOWREPLACING	equ 14
endif
if(_WIN32_WINNT GE 0x0602)
HSHELL_MONITORCHANGED	equ 16
endif

HSHELL_HIGHBIT		equ 0x8000
HSHELL_FLASH		equ (HSHELL_REDRAW OR HSHELL_HIGHBIT)
HSHELL_RUDEAPPACTIVATED equ (HSHELL_WINDOWACTIVATED OR HSHELL_HIGHBIT)

if(_WIN32_WINNT GE 0x0500)
APPCOMMAND_BROWSER_BACKWARD equ 1
APPCOMMAND_BROWSER_FORWARD equ 2
APPCOMMAND_BROWSER_REFRESH equ 3
APPCOMMAND_BROWSER_STOP equ 4
APPCOMMAND_BROWSER_SEARCH equ 5
APPCOMMAND_BROWSER_FAVORITES equ 6
APPCOMMAND_BROWSER_HOME equ 7
APPCOMMAND_VOLUME_MUTE	equ 8
APPCOMMAND_VOLUME_DOWN	equ 9
APPCOMMAND_VOLUME_UP	equ 10
APPCOMMAND_MEDIA_NEXTTRACK equ 11
APPCOMMAND_MEDIA_PREVIOUSTRACK equ 12
APPCOMMAND_MEDIA_STOP	equ 13
APPCOMMAND_MEDIA_PLAY_PAUSE equ 14
APPCOMMAND_LAUNCH_MAIL	equ 15
APPCOMMAND_LAUNCH_MEDIA_SELECT equ 16
APPCOMMAND_LAUNCH_APP1	equ 17
APPCOMMAND_LAUNCH_APP2	equ 18
APPCOMMAND_BASS_DOWN	equ 19
APPCOMMAND_BASS_BOOST	equ 20
APPCOMMAND_BASS_UP	equ 21
APPCOMMAND_TREBLE_DOWN	equ 22
APPCOMMAND_TREBLE_UP	equ 23
if(_WIN32_WINNT GE 0x0501)
APPCOMMAND_MICROPHONE_VOLUME_MUTE equ 24
APPCOMMAND_MICROPHONE_VOLUME_DOWN equ 25
APPCOMMAND_MICROPHONE_VOLUME_UP equ 26
APPCOMMAND_HELP		equ 27
APPCOMMAND_FIND		equ 28
APPCOMMAND_NEW		equ 29
APPCOMMAND_OPEN		equ 30
APPCOMMAND_CLOSE	equ 31
APPCOMMAND_SAVE		equ 32
APPCOMMAND_PRINT	equ 33
APPCOMMAND_UNDO		equ 34
APPCOMMAND_REDO		equ 35
APPCOMMAND_COPY		equ 36
APPCOMMAND_CUT		equ 37
APPCOMMAND_PASTE	equ 38
APPCOMMAND_REPLY_TO_MAIL equ 39
APPCOMMAND_FORWARD_MAIL equ 40
APPCOMMAND_SEND_MAIL	equ 41
APPCOMMAND_SPELL_CHECK	equ 42
APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE equ 43
APPCOMMAND_MIC_ON_OFF_TOGGLE equ 44
APPCOMMAND_CORRECTION_LIST equ 45
APPCOMMAND_MEDIA_PLAY	equ 46
APPCOMMAND_MEDIA_PAUSE	equ 47
APPCOMMAND_MEDIA_RECORD equ 48
APPCOMMAND_MEDIA_FAST_FORWARD equ 49
APPCOMMAND_MEDIA_REWIND equ 50
APPCOMMAND_MEDIA_CHANNEL_UP equ 51
APPCOMMAND_MEDIA_CHANNEL_DOWN equ 52
endif
if(_WIN32_WINNT GE 0x0600)
APPCOMMAND_DELETE	equ 53
APPCOMMAND_DWM_FLIP3D	equ 54
endif

FAPPCOMMAND_MOUSE	equ 0x8000
FAPPCOMMAND_KEY		equ 0
FAPPCOMMAND_OEM		equ 0x1000
FAPPCOMMAND_MASK	equ 0xF000

GET_APPCOMMAND_LPARAM macro lParam
	exitm<HIWORD(lParam) AND NOT FAPPCOMMAND_MASK>
	endm
GET_DEVICE_LPARAM macro lParam
	exitm<HIWORD(lParam) AND FAPPCOMMAND_MASK>
	endm
GET_MOUSEORKEY_LPARAM	equ GET_DEVICE_LPARAM
GET_FLAGS_LPARAM macro lParam
	exitm<LOWORD(lParam)>
	endm
GET_KEYSTATE_LPARAM macro lParam
	exitm<GET_FLAGS_LPARAM(lParam)>
	endm

endif ; _WIN32_WINNT GE 0x0500


SHELLHOOKINFO		STRUC
hwnd			HWND ?
rc			RECT <>
SHELLHOOKINFO		ENDS
LPSHELLHOOKINFO		typedef ptr SHELLHOOKINFO

EVENTMSG		STRUC
message			UINT ?
paramL			UINT ?
paramH			UINT ?
time			dd ?
hwnd			HWND ?
EVENTMSG		ENDS
PEVENTMSGMSG		typedef ptr EVENTMSG
NPEVENTMSGMSG		typedef ptr EVENTMSG
LPEVENTMSGMSG		typedef ptr EVENTMSG
PEVENTMSG		typedef ptr EVENTMSG
NPEVENTMSG		typedef ptr EVENTMSG
LPEVENTMSG		typedef ptr EVENTMSG

CWPSTRUCT		STRUC
lParam			LPARAM ?
wParam			WPARAM ?
message			UINT ?
hwnd			HWND ?
CWPSTRUCT		ENDS
PCWPSTRUCT		typedef ptr CWPSTRUCT
NPCWPSTRUCT		typedef ptr CWPSTRUCT
LPCWPSTRUCT		typedef ptr CWPSTRUCT

if(WINVER GE 0x0400)
CWPRETSTRUCT		STRUC
lResult			LRESULT ?
lParam			LPARAM ?
wParam			WPARAM ?
message			UINT ?
hwnd			HWND ?
CWPRETSTRUCT		ENDS
PCWPRETSTRUCT		typedef ptr CWPRETSTRUCT
NPCWPRETSTRUCT		typedef ptr CWPRETSTRUCT
LPCWPRETSTRUCT		typedef ptr CWPRETSTRUCT
endif

if (_WIN32_WINNT GE 0x0400)
LLKHF_EXTENDED		equ 0x00000001
LLKHF_INJECTED		equ 0x00000010
LLKHF_ALTDOWN		equ 0x00000020
LLKHF_UP		equ 0x00000080

LLMHF_INJECTED		equ 0x00000001
LLMHF_LOWER_IL_INJECTED equ 0x00000002

KBDLLHOOKSTRUCT		STRUC
vkCode			dd ?
scanCode		dd ?
flags			dd ?
time			dd ?
dwExtraInfo		ULONG_PTR ?
KBDLLHOOKSTRUCT		ENDS
LPKBDLLHOOKSTRUCT	typedef ptr KBDLLHOOKSTRUCT
PKBDLLHOOKSTRUCT	typedef ptr KBDLLHOOKSTRUCT

MSLLHOOKSTRUCT		STRUC
pt			POINT <>
mouseData		dd ?
flags			dd ?
time			dd ?
dwExtraInfo		ULONG_PTR ?
MSLLHOOKSTRUCT		ENDS
LPMSLLHOOKSTRUCT	typedef ptr MSLLHOOKSTRUCT
PMSLLHOOKSTRUCT		typedef ptr MSLLHOOKSTRUCT
endif

DEBUGHOOKINFO		STRUC
idThread		dd ?
idThreadInstaller	dd ?
lParam			LPARAM ?
wParam			WPARAM ?
code			SINT ?
DEBUGHOOKINFO		ENDS
PDEBUGHOOKINFO		typedef ptr DEBUGHOOKINFO
NPDEBUGHOOKINFO		typedef ptr DEBUGHOOKINFO
LPDEBUGHOOKINFO		typedef ptr DEBUGHOOKINFO

MOUSEHOOKSTRUCT		STRUC
pt			POINT <>
hwnd			HWND ?
wHitTestCode		UINT ?
dwExtraInfo		ULONG_PTR ?
MOUSEHOOKSTRUCT		ENDS
LPMOUSEHOOKSTRUCT	typedef ptr MOUSEHOOKSTRUCT
PMOUSEHOOKSTRUCT	typedef ptr MOUSEHOOKSTRUCT
if(WINVER GE 0x0400)
HARDWAREHOOKSTRUCT	STRUC
hwnd			HWND ?
message			UINT ?
wParam			WPARAM ?
lParam			LPARAM ?
HARDWAREHOOKSTRUCT	ENDS
LPHARDWAREHOOKSTRUCT	typedef ptr HARDWAREHOOKSTRUCT
PHARDWAREHOOKSTRUCT	typedef ptr HARDWAREHOOKSTRUCT
endif

endif ; NOWH

HKL_PREV		equ 0
HKL_NEXT		equ 1


KLF_ACTIVATE		equ 0x00000001
KLF_SUBSTITUTE_OK	equ 0x00000002
KLF_UNLOADPREVIOUS	equ 0x00000004
KLF_REORDER		equ 0x00000008
if(WINVER GE 0x0400)
KLF_REPLACELANG		equ 0x00000010
KLF_NOTELLSHELL		equ 0x00000080
endif
KLF_SETFORPROCESS	equ 0x00000100
if(_WIN32_WINNT GE 0x0500)
KLF_SHIFTLOCK		equ 0x00010000
KLF_RESET		equ 0x40000000
endif


if(WINVER GE 0x0500)
INPUTLANGCHANGE_SYSCHARSET equ 0x0001
INPUTLANGCHANGE_FORWARD	   equ 0x0002
INPUTLANGCHANGE_BACKWARD   equ 0x0004
endif

KL_NAMELENGTH		equ 9

LoadKeyboardLayoutA proto WINAPI :LPCSTR, :UINT
LoadKeyboardLayoutW proto WINAPI :LPCWSTR, :UINT
ifdef _UNICODE
LoadKeyboardLayout	equ <LoadKeyboardayoutW>
else
LoadKeyboardLayout	equ <LoadKeyboardayoutA>
endif

if(WINVER GE 0x0400)
ActivateKeyboardLayout proto WINAPI :HKL, :UINT
else
ActivateKeyboardLayout proto WINAPI :HKL, :UINT
endif
if(WINVER GE 0x0400)
ToUnicodeEx proto WINAPI :UINT, :UINT, :PBYTE, :LPWSTR, :SINT, :UINT, :HKL
endif
UnloadKeyboardLayout proto WINAPI :HKL
GetKeyboardLayoutNameA proto WINAPI :LPSTR
GetKeyboardLayoutNameW proto WINAPI :LPWSTR
ifdef _UNICODE
GetKeyboardLayoutName	equ <GetKeyboardayoutNameW>
else
GetKeyboardLayoutName	equ <GetKeyboardayoutNameA>
endif

if(WINVER GE 0x0400)
GetKeyboardLayoutList proto WINAPI :SINT, :ptr HKL
GetKeyboardLayout proto WINAPI :DWORD
endif

if(WINVER GE 0x0500)
MOUSEMOVEPOINT		STRUC
x			SINT ?
y			SINT ?
time			dd ?
dwExtraInfo		ULONG_PTR ?
MOUSEMOVEPOINT		ENDS
PMOUSEMOVEPOINT		typedef ptr MOUSEMOVEPOINT
LPMOUSEMOVEPOINT	typedef ptr MOUSEMOVEPOINT

GMMP_USE_DISPLAY_POINTS equ 1
GMMP_USE_DRIVER_POINTS	equ 2

GetMouseMovePoints proto WINAPI :UINT, :LPMOUSEMOVEPOINT, :LPMOUSEMOVEPOINT, :SINT, :DWORD
GetMouseMovePointsEx proto WINAPI :UINT, :LPMOUSEMOVEPOINT, :LPMOUSEMOVEPOINT, :SINT, :DWORD
endif

ifndef NODESKTOP

DESKTOP_READOBJECTS	equ 0x0001
DESKTOP_CREATEWINDOW	equ 0x0002
DESKTOP_CREATEMENU	equ 0x0004
DESKTOP_HOOKCONTROL	equ 0x0008
DESKTOP_JOURNALRECORD	equ 0x0010
DESKTOP_JOURNALPLAYBACK equ 0x0020
DESKTOP_ENUMERATE	equ 0x0040
DESKTOP_WRITEOBJECTS	equ 0x0080
DESKTOP_SWITCHDESKTOP	equ 0x0100

DF_ALLOWOTHERACCOUNTHOOK equ 0x0001

ifdef _WINGDI_
ifndef NOGDI

CreateDesktopA proto WINAPI :LPSTR, :LPSTR, :LPDEVMODEA, :DWORD, :ACCESS_MASK, :LPSECURITY_ATTRIBUTES
CreateDesktopW proto WINAPI :LPWSTR, :LPWSTR, :LPDEVMODEW, :DWORD, :ACCESS_MASK, :LPSECURITY_ATTRIBUTES
ifdef _UNICODE
CreateDesktop		equ <CreateDesktopW>
else
CreateDesktop		equ <CreateDesktopA>
endif

CreateDesktopExA proto WINAPI :LPCSTR, :LPCSTR, :ptr DEVMODEA, :DWORD, :ACCESS_MASK, :LPSECURITY_ATTRIBUTES, :ULONG, :ptr
CreateDesktopExW proto WINAPI :LPCWSTR, :LPCWSTR, :ptr DEVMODEW, :DWORD, :ACCESS_MASK, :LPSECURITY_ATTRIBUTES, :ULONG, :ptr
ifdef _UNICODE
CreateDesktopEx		equ <CreateDesktopExW>
else
CreateDesktopEx		equ <CreateDesktopExA>
endif
endif ; NOGDI
endif ; _WINGDI_

OpenDesktopA proto WINAPI :LPSTR, :DWORD, :BOOL, :ACCESS_MASK
OpenDesktopW proto WINAPI :LPWSTR, :DWORD, :BOOL, :ACCESS_MASK
ifdef _UNICODE
OpenDesktop		equ <OpenDesktopW>
else
OpenDesktop		equ <OpenDesktopA>
endif

OpenInputDesktop proto WINAPI :DWORD, :BOOL, :ACCESS_MASK
EnumDesktopsA proto WINAPI :HWINSTA, :DESKTOPENUMPROCA, :LPARAM
EnumDesktopsW proto WINAPI :HWINSTA, :DESKTOPENUMPROCW, :LPARAM
ifdef _UNICODE
EnumDesktops		equ <EnumDesktopsW>
else
EnumDesktops		equ <EnumDesktopsA>
endif

EnumDesktopWindows proto WINAPI :HDESK, :WNDENUMPROC, :LPARAM
SwitchDesktop proto WINAPI :HDESK
SetThreadDesktop proto WINAPI :HDESK
CloseDesktop proto WINAPI :HDESK
GetThreadDesktop proto WINAPI :DWORD

endif ; NODESKTOP

ifndef NOWINDOWSTATION

WINSTA_ENUMDESKTOPS	equ 0x0001
WINSTA_READATTRIBUTES	equ 0x0002
WINSTA_ACCESSCLIPBOARD	equ 0x0004
WINSTA_CREATEDESKTOP	equ 0x0008
WINSTA_WRITEATTRIBUTES	equ 0x0010
WINSTA_ACCESSGLOBALATOMS equ 0x0020
WINSTA_EXITWINDOWS	equ 0x0040
WINSTA_ENUMERATE	equ 0x0100
WINSTA_READSCREEN	equ 0x0200

WINSTA_ALL_ACCESS	equ (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)
CWF_CREATE_ONLY		equ 0x00000001
WSF_VISIBLE		equ 0x0001

CreateWindowStationA proto WINAPI :LPSTR, :DWORD, :ACCESS_MASK, :LPSECURITY_ATTRIBUTES
CreateWindowStationW proto WINAPI :LPWSTR, :DWORD, :ACCESS_MASK, :LPSECURITY_ATTRIBUTES
ifdef _UNICODE
CreateWindowStation	equ <CreateWindowStationW>
else
CreateWindowStation	equ <CreateWindowStationA>
endif

OpenWindowStationA proto WINAPI :LPSTR, :BOOL, :ACCESS_MASK
OpenWindowStationW proto WINAPI :LPWSTR, :BOOL, :ACCESS_MASK
ifdef _UNICODE
OpenWindowStation	equ <OpenWindowStationW>
else
OpenWindowStation	equ <OpenWindowStationA>
endif

EnumWindowStationsA proto WINAPI :WINSTAENUMPROCA, :LPARAM
EnumWindowStationsW proto WINAPI :WINSTAENUMPROCW, :LPARAM
ifdef _UNICODE
EnumWindowStations	equ <EnumWindowStationsW>
else
EnumWindowStations	equ <EnumWindowStationsA>
endif

CloseWindowStation proto WINAPI :HWINSTA
SetProcessWindowStation proto WINAPI :HWINSTA
GetProcessWindowStation proto WINAPI

endif ; NOWINDOWSTATION

ifndef NOSECURITY

SetUserObjectSecurity proto WINAPI :HANDLE, :PSECURITY_INFORMATION, :PSECURITY_DESCRIPTOR
GetUserObjectSecurity proto WINAPI :HANDLE, :PSECURITY_INFORMATION, :PSECURITY_DESCRIPTOR, :DWORD, :LPDWORD

UOI_FLAGS		equ 1
UOI_NAME		equ 2
UOI_TYPE		equ 3
UOI_USER_SID		equ 4
if(WINVER GE 0x0600)
UOI_HEAPSIZE		equ 5
UOI_IO			equ 6
endif

USEROBJECTFLAGS		STRUC
fInherit		BOOL ?
fReserved		BOOL ?
dwFlags			dd ?
USEROBJECTFLAGS		ENDS
PUSEROBJECTFLAGS	typedef ptr USEROBJECTFLAGS

GetUserObjectInformationA proto WINAPI :HANDLE, :SINT, :PVOID, :DWORD, :LPDWORD
GetUserObjectInformationW proto WINAPI :HANDLE, :SINT, :PVOID, :DWORD, :LPDWORD
ifdef _UNICODE
GetUserObjectInformation equ <GetUserObjectInformationW>
else
GetUserObjectInformation equ <GetUserObjectInformationA>
endif

SetUserObjectInformationA proto WINAPI :HANDLE, :SINT, :PVOID, :DWORD
SetUserObjectInformationW proto WINAPI :HANDLE, :SINT, :PVOID, :DWORD
ifdef _UNICODE
SetUserObjectInformation equ <SetUserObjectInformationW>
else
SetUserObjectInformation equ <SetUserObjectInformationA>
endif

endif ; NOSECURITY

if(WINVER GE 0x0400)
WNDCLASSEXA		STRUC
cbSize			UINT ?
style			UINT ?
lpfnWndProc		WNDPROC ?
cbClsExtra		SINT ?
cbWndExtra		SINT ?
hInstance		HINSTANCE ?
hIcon			HICON ?
hCursor			HCURSOR ?
hbrBackground		HBRUSH ?
lpszMenuName		LPCSTR ?
lpszClassName		LPCSTR ?
hIconSm			HICON ?
WNDCLASSEXA		ENDS
PWNDCLASSEXA		typedef ptr WNDCLASSEXA
NPWNDCLASSEXA		typedef ptr WNDCLASSEXA
LPWNDCLASSEXA		typedef ptr WNDCLASSEXA
WNDCLASSEXW		STRUC
cbSize			UINT ?
style			UINT ?
lpfnWndProc		WNDPROC ?
cbClsExtra		SINT ?
cbWndExtra		SINT ?
hInstance		HINSTANCE ?
hIcon			HICON ?
hCursor			HCURSOR ?
hbrBackground		HBRUSH ?
lpszMenuName		LPCWSTR ?
lpszClassName		LPCWSTR ?
hIconSm			HICON ?
WNDCLASSEXW		ENDS
PWNDCLASSEXW		typedef ptr WNDCLASSEXW
NPWNDCLASSEXW		typedef ptr WNDCLASSEXW
LPWNDCLASSEXW		typedef ptr WNDCLASSEXW
ifdef _UNICODE
WNDCLASSEX		typedef WNDCLASSEXW
PWNDCLASSEX		typedef PWNDCLASSEXW
NPWNDCLASSEX		typedef NPWNDCLASSEXW
LPWNDCLASSEX		typedef LPWNDCLASSEXW
else
WNDCLASSEX		typedef WNDCLASSEXA
PWNDCLASSEX		typedef PWNDCLASSEXA
NPWNDCLASSEX		typedef NPWNDCLASSEXA
LPWNDCLASSEX		typedef LPWNDCLASSEXA
endif
endif

WNDCLASSA		STRUC
style			UINT ?
lpfnWndProc		WNDPROC ?
cbClsExtra		SINT ?
cbWndExtra		SINT ?
hInstance		HINSTANCE ?
hIcon			HICON ?
hCursor			HCURSOR ?
hbrBackground		HBRUSH ?
lpszMenuName		LPCSTR ?
lpszClassName		LPCSTR ?
WNDCLASSA		ENDS
PWNDCLASSA		typedef ptr WNDCLASSA
NPWNDCLASSA		typedef ptr WNDCLASSA
LPWNDCLASSA		typedef ptr WNDCLASSA
WNDCLASSW		STRUC
style			UINT ?
lpfnWndProc		WNDPROC ?
cbClsExtra		SINT ?
cbWndExtra		SINT ?
hInstance		HINSTANCE ?
hIcon			HICON ?
hCursor			HCURSOR ?
hbrBackground		HBRUSH ?
lpszMenuName		LPCWSTR ?
lpszClassName		LPCWSTR ?
WNDCLASSW		ENDS
PWNDCLASSW		typedef ptr WNDCLASSW
NPWNDCLASSW		typedef ptr WNDCLASSW
LPWNDCLASSW		typedef ptr WNDCLASSW
ifdef _UNICODE
WNDCLASS		typedef WNDCLASSW
PWNDCLASS		typedef PWNDCLASSW
NPWNDCLASS		typedef NPWNDCLASSW
LPWNDCLASS		typedef LPWNDCLASSW
else
WNDCLASS		typedef WNDCLASSA
PWNDCLASS		typedef PWNDCLASSA
NPWNDCLASS		typedef NPWNDCLASSA
LPWNDCLASS		typedef LPWNDCLASSA
endif

IsHungAppWindow proto WINAPI :HWND
if (WINVER GE 0x0501)
DisableProcessWindowsGhosting proto WINAPI
endif

ifndef NOMSG

MSG			STRUC
hwnd			HWND ?
message			UINT ?
wParam			WPARAM ?
lParam			LPARAM ?
time			dd ?
pt			POINT <>
MSG			ENDS
PMSG			typedef ptr MSG
NPMSG			typedef ptr MSG
LPMSG			typedef ptr MSG

POINTSTOPOINT proto fastcall pt:ptr POINT, pts:ptr {
	movsx eax,dx
	mov   [pt].POINT.x,eax
	sar   edx,16
	mov   [pt].POINT.y,edx
	}
POINTTOPOINTS proto fastcall pt:ptr POINT {
	mov   eax,[pt].POINT.y
	shl   eax,16
	or    eax,[pt].POINT.x
	}

ifdef _WIN64
MAKEWPARAM macro l, h, reg:=<r8>
	exitm<MAKELONG(l, h, reg)>
	endm
else
MAKEWPARAM macro l, h, reg:=<eax>
	exitm<MAKELONG(l, h, reg)>
	endm
endif
ifdef _WIN64
MAKELPARAM macro l, h, reg:=<r9>
	exitm<MAKELONG(l, h, reg)>
	endm
else
MAKELPARAM macro l, h, reg:=<eax>
	exitm<MAKELONG(l, h, reg)>
	endm
endif
MAKELRESULT macro l,h
	exitm<MAKELONG(l, h, rax)>
	endm

endif ; NOMSG

IS_INTRESOURCE proto watcall _r:ptr {
	shr	_r,16
	mov	eax,0
	setz	al
	retm	<eax>
	}

ifndef NOWINOFFSETS

ifndef _WIN64
GWL_WNDPROC	    equ (-4)
GWL_HINSTANCE	    equ (-6)
GWL_HWNDPARENT	    equ (-8)
endif
GWL_STYLE	    equ (-16)
GWL_EXSTYLE	    equ (-20)
ifndef _WIN64
GWL_USERDATA	    equ (-21)
endif
GWL_ID		    equ (-12)

GWLP_WNDPROC	    equ (-4)
GWLP_HINSTANCE	    equ (-6)
GWLP_HWNDPARENT	    equ (-8)
GWLP_USERDATA	    equ (-21)
GWLP_ID		    equ (-12)

ifndef _WIN64
GCL_MENUNAME		equ (-8)
GCL_HBRBACKGROUND	equ (-10)
GCL_HCURSOR		equ (-12)
GCL_HICON		equ (-14)
GCL_HMODULE		equ (-16)
endif
GCL_CBWNDEXTRA		equ (-18)
GCL_CBCLSEXTRA		equ (-20)
ifndef _WIN64
GCL_WNDPROC		equ (-24)
endif
GCL_STYLE		equ (-26)
GCW_ATOM		equ (-32)
if(WINVER GE 0x0400)
ifndef _WIN64
GCL_HICONSM		equ (-34)
endif
endif

GCLP_MENUNAME		equ (-8)
GCLP_HBRBACKGROUND	equ (-10)
GCLP_HCURSOR		equ (-12)
GCLP_HICON		equ (-14)
GCLP_HMODULE		equ (-16)
GCLP_WNDPROC		equ (-24)
GCLP_HICONSM		equ (-34)

endif ; NOWINOFFSETS

ifndef NOWINMESSAGES

WM_NULL			equ 0x0000
WM_CREATE		equ 0x0001
WM_DESTROY		equ 0x0002
WM_MOVE			equ 0x0003
WM_SIZE			equ 0x0005

WM_ACTIVATE		equ 0x0006
WA_INACTIVE		equ 0
WA_ACTIVE		equ 1
WA_CLICKACTIVE		equ 2

WM_SETFOCUS		equ 0x0007
WM_KILLFOCUS		equ 0x0008
WM_ENABLE		equ 0x000A
WM_SETREDRAW		equ 0x000B
WM_SETTEXT		equ 0x000C
WM_GETTEXT		equ 0x000D
WM_GETTEXTLENGTH	equ 0x000E
WM_PAINT		equ 0x000F
WM_CLOSE		equ 0x0010
WM_QUERYENDSESSION	equ 0x0011
WM_QUIT			equ 0x0012
WM_QUERYOPEN		equ 0x0013
WM_ERASEBKGND		equ 0x0014
WM_SYSCOLORCHANGE	equ 0x0015
WM_ENDSESSION		equ 0x0016
WM_SHOWWINDOW		equ 0x0018
WM_WININICHANGE		equ 0x001A
if(WINVER GE 0x0400)
WM_SETTINGCHANGE	equ WM_WININICHANGE
endif

WM_DEVMODECHANGE	equ 0x001B
WM_ACTIVATEAPP		equ 0x001C
WM_FONTCHANGE		equ 0x001D
WM_TIMECHANGE		equ 0x001E
WM_CANCELMODE		equ 0x001F
WM_SETCURSOR		equ 0x0020
WM_MOUSEACTIVATE	equ 0x0021
WM_CHILDACTIVATE	equ 0x0022
WM_QUEUESYNC		equ 0x0023

WM_GETMINMAXINFO	equ 0x0024
MINMAXINFO		STRUC
ptReserved		POINT <>
ptMaxSize		POINT <>
ptMaxPosition		POINT <>
ptMinTrackSize		POINT <>
ptMaxTrackSize		POINT <>
MINMAXINFO		ENDS
PMINMAXINFO		typedef ptr MINMAXINFO
LPMINMAXINFO		typedef ptr MINMAXINFO

WM_PAINTICON		equ 0x0026
WM_ICONERASEBKGND	equ 0x0027
WM_NEXTDLGCTL		equ 0x0028
WM_SPOOLERSTATUS	equ 0x002A
WM_DRAWITEM		equ 0x002B
WM_MEASUREITEM		equ 0x002C
WM_DELETEITEM		equ 0x002D
WM_VKEYTOITEM		equ 0x002E
WM_CHARTOITEM		equ 0x002F
WM_SETFONT		equ 0x0030
WM_GETFONT		equ 0x0031
WM_SETHOTKEY		equ 0x0032
WM_GETHOTKEY		equ 0x0033
WM_QUERYDRAGICON	equ 0x0037
WM_COMPAREITEM		equ 0x0039
if(WINVER GE 0x0500)
ifndef _WIN32_WCE
WM_GETOBJECT		equ 0x003D
endif
endif
WM_COMPACTING		equ 0x0041
WM_COMMNOTIFY		equ 0x0044
WM_WINDOWPOSCHANGING	equ 0x0046
WM_WINDOWPOSCHANGED	equ 0x0047
WM_POWER		equ 0x0048

PWR_OK			equ 1
PWR_FAIL		equ (-1)
PWR_SUSPENDREQUEST	equ 1
PWR_SUSPENDRESUME	equ 2
PWR_CRITICALRESUME	equ 3

WM_COPYDATA		equ 0x004A
WM_CANCELJOURNAL	equ 0x004B

COPYDATASTRUCT		STRUC
dwData			ULONG_PTR ?
cbData			dd ?
lpData			PVOID ?
COPYDATASTRUCT		ENDS
PCOPYDATASTRUCT		typedef ptr COPYDATASTRUCT


if(WINVER GE 0x0400)
WM_NOTIFY		equ 0x004E
WM_INPUTLANGCHANGEREQUEST equ 0x0050
WM_INPUTLANGCHANGE	equ 0x0051
WM_TCARD		equ 0x0052
WM_HELP			equ 0x0053
WM_USERCHANGED		equ 0x0054
WM_NOTIFYFORMAT		equ 0x0055

NFR_ANSI		equ 1
NFR_UNICODE		equ 2
NF_QUERY		equ 3
NF_REQUERY		equ 4

WM_CONTEXTMENU		equ 0x007B
WM_STYLECHANGING	equ 0x007C
WM_STYLECHANGED		equ 0x007D
WM_DISPLAYCHANGE	equ 0x007E
WM_GETICON		equ 0x007F
WM_SETICON		equ 0x0080
endif

WM_NCCREATE		equ 0x0081
WM_NCDESTROY		equ 0x0082
WM_NCCALCSIZE		equ 0x0083
WM_NCHITTEST		equ 0x0084
WM_NCPAINT		equ 0x0085
WM_NCACTIVATE		equ 0x0086
WM_GETDLGCODE		equ 0x0087
WM_SYNCPAINT		equ 0x0088
WM_NCMOUSEMOVE		equ 0x00A0
WM_NCLBUTTONDOWN	equ 0x00A1
WM_NCLBUTTONUP		equ 0x00A2
WM_NCLBUTTONDBLCLK	equ 0x00A3
WM_NCRBUTTONDOWN	equ 0x00A4
WM_NCRBUTTONUP		equ 0x00A5
WM_NCRBUTTONDBLCLK	equ 0x00A6
WM_NCMBUTTONDOWN	equ 0x00A7
WM_NCMBUTTONUP		equ 0x00A8
WM_NCMBUTTONDBLCLK	equ 0x00A9
if(_WIN32_WINNT GE 0x0500)
WM_NCXBUTTONDOWN	equ 0x00AB
WM_NCXBUTTONUP		equ 0x00AC
WM_NCXBUTTONDBLCLK	equ 0x00AD
endif
if(_WIN32_WINNT GE 0x0501)
WM_INPUT_DEVICE_CHANGE	equ 0x00FE
endif
if(_WIN32_WINNT GE 0x0501)
WM_INPUT		equ 0x00FF
endif

WM_KEYFIRST		equ 0x0100
WM_KEYDOWN		equ 0x0100
WM_KEYUP		equ 0x0101
WM_CHAR			equ 0x0102
WM_DEADCHAR		equ 0x0103
WM_SYSKEYDOWN		equ 0x0104
WM_SYSKEYUP		equ 0x0105
WM_SYSCHAR		equ 0x0106
WM_SYSDEADCHAR		equ 0x0107
if(_WIN32_WINNT GE 0x0501)
WM_UNICHAR		equ 0x0109
WM_KEYLAST		equ 0x0109
UNICODE_NOCHAR		equ 0xFFFF
else
WM_KEYLAST		equ 0x0108
endif

if(WINVER GE 0x0400)
WM_IME_STARTCOMPOSITION equ 0x010D
WM_IME_ENDCOMPOSITION	equ 0x010E
WM_IME_COMPOSITION	equ 0x010F
WM_IME_KEYLAST		equ 0x010F
endif

WM_INITDIALOG		equ 0x0110
WM_COMMAND		equ 0x0111
WM_SYSCOMMAND		equ 0x0112
WM_TIMER		equ 0x0113
WM_HSCROLL		equ 0x0114
WM_VSCROLL		equ 0x0115
WM_INITMENU		equ 0x0116
WM_INITMENUPOPUP	equ 0x0117
if(WINVER GE 0x0601)
WM_GESTURE		equ 0x0119
WM_GESTURENOTIFY	equ 0x011A
endif
WM_MENUSELECT		equ 0x011F
WM_MENUCHAR		equ 0x0120
WM_ENTERIDLE		equ 0x0121
if(WINVER GE 0x0500)
ifndef _WIN32_WCE
WM_MENURBUTTONUP	equ 0x0122
WM_MENUDRAG		equ 0x0123
WM_MENUGETOBJECT	equ 0x0124
WM_UNINITMENUPOPUP	equ 0x0125
WM_MENUCOMMAND		equ 0x0126
if(_WIN32_WINNT GE 0x0500)
WM_CHANGEUISTATE	equ 0x0127
WM_UPDATEUISTATE	equ 0x0128
WM_QUERYUISTATE		equ 0x0129
UIS_SET			equ 1
UIS_CLEAR		equ 2
UIS_INITIALIZE		equ 3
UISF_HIDEFOCUS		equ 0x1
UISF_HIDEACCEL		equ 0x2
if(_WIN32_WINNT GE 0x0501)
UISF_ACTIVE		equ 0x4
endif
endif
endif
endif

WM_CTLCOLORMSGBOX	equ 0x0132
WM_CTLCOLOREDIT		equ 0x0133
WM_CTLCOLORLISTBOX	equ 0x0134
WM_CTLCOLORBTN		equ 0x0135
WM_CTLCOLORDLG		equ 0x0136
WM_CTLCOLORSCROLLBAR	equ 0x0137
WM_CTLCOLORSTATIC	equ 0x0138
MN_GETHMENU		equ 0x01E1

WM_MOUSEFIRST		equ 0x0200
WM_MOUSEMOVE		equ 0x0200
WM_LBUTTONDOWN		equ 0x0201
WM_LBUTTONUP		equ 0x0202
WM_LBUTTONDBLCLK	equ 0x0203
WM_RBUTTONDOWN		equ 0x0204
WM_RBUTTONUP		equ 0x0205
WM_RBUTTONDBLCLK	equ 0x0206
WM_MBUTTONDOWN		equ 0x0207
WM_MBUTTONUP		equ 0x0208
WM_MBUTTONDBLCLK	equ 0x0209
if (_WIN32_WINNT GE 0x0600)
WM_MOUSEHWHEEL		equ 0x020E
endif
if (_WIN32_WINNT GE 0x0400) OR (_WIN32_WINDOWS GT 0x0400)
WM_MOUSEWHEEL		equ 0x020A
endif
if (_WIN32_WINNT GE 0x0500)
WM_XBUTTONDOWN		equ 0x020B
WM_XBUTTONUP		equ 0x020C
WM_XBUTTONDBLCLK	equ 0x020D
endif
if (_WIN32_WINNT GE 0x0600)
WM_MOUSELAST		equ 0x020E
elseif (_WIN32_WINNT GE 0x0500)
WM_MOUSELAST		equ 0x020D
elseif (_WIN32_WINNT GE 0x0400) OR (_WIN32_WINDOWS GT 0x0400)
WM_MOUSELAST		equ 0x020A
else
WM_MOUSELAST		equ 0x0209
endif

if(_WIN32_WINNT GE 0x0400)
WHEEL_DELTA		equ 120
GET_WHEEL_DELTA_WPARAM macro wParam
	movzx	eax,word ptr wParam[2]
	retm	<eax>
	endm
endif
if(_WIN32_WINNT GE 0x0400)
WHEEL_PAGESCROLL	equ (UINT_MAX)
endif

WM_PARENTNOTIFY		equ 0x0210
WM_ENTERMENULOOP	equ 0x0211
WM_EXITMENULOOP		equ 0x0212

if(WINVER GE 0x0400)
WM_NEXTMENU		equ 0x0213

MDINEXTMENU		STRUC
hmenuIn			HMENU ?
hmenuNext		HMENU ?
hwndNext		HWND ?
MDINEXTMENU		ENDS
PMDINEXTMENU		typedef ptr MDINEXTMENU
LPMDINEXTMENU		typedef ptr MDINEXTMENU

WM_SIZING		equ 0x0214
WM_CAPTURECHANGED	equ 0x0215
WM_MOVING		equ 0x0216
WM_POWERBROADCAST	equ 0x0218

PBT_APMQUERYSUSPEND	equ 0x0000
PBT_APMQUERYSTANDBY	equ 0x0001
PBT_APMQUERYSUSPENDFAILED equ 0x0002
PBT_APMQUERYSTANDBYFAILED equ 0x0003
PBT_APMSUSPEND		equ 0x0004
PBT_APMSTANDBY		equ 0x0005
PBT_APMRESUMECRITICAL	equ 0x0006
PBT_APMRESUMESUSPEND	equ 0x0007
PBT_APMRESUMESTANDBY	equ 0x0008
PBTF_APMRESUMEFROMFAILURE equ 0x00000001
PBT_APMBATTERYLOW	equ 0x0009
PBT_APMPOWERSTATUSCHANGE equ 0x000A
PBT_APMOEMEVENT		equ 0x000B
PBT_APMRESUMEAUTOMATIC	equ 0x0012
if (_WIN32_WINNT GE 0x0502)
ifndef PBT_POWERSETTINGCHANGE
PBT_POWERSETTINGCHANGE	equ 0x8013
POWERBROADCAST_SETTING	STRUC
PowerSetting		GUID <>
DataLength		dd ?
Data			db ?
POWERBROADCAST_SETTING	ENDS
PPOWERBROADCAST_SETTING typedef ptr POWERBROADCAST_SETTING
endif
endif
WM_DEVICECHANGE		equ 0x0219

endif ; WINVER GE 0x0400

WM_MDICREATE		equ 0x0220
WM_MDIDESTROY		equ 0x0221
WM_MDIACTIVATE		equ 0x0222
WM_MDIRESTORE		equ 0x0223
WM_MDINEXT		equ 0x0224
WM_MDIMAXIMIZE		equ 0x0225
WM_MDITILE		equ 0x0226
WM_MDICASCADE		equ 0x0227
WM_MDIICONARRANGE	equ 0x0228
WM_MDIGETACTIVE		equ 0x0229

WM_MDISETMENU		equ 0x0230
WM_ENTERSIZEMOVE	equ 0x0231
WM_EXITSIZEMOVE		equ 0x0232
WM_DROPFILES		equ 0x0233
WM_MDIREFRESHMENU	equ 0x0234
if(WINVER GE 0x0602)
WM_POINTERDEVICECHANGE	equ 0x238
WM_POINTERDEVICEINRANGE equ 0x239
WM_POINTERDEVICEOUTOFRANGE equ 0x23A
endif
if(WINVER GE 0x0601)
WM_TOUCH		equ 0x0240
endif
if(WINVER GE 0x0602)
WM_NCPOINTERUPDATE	equ 0x0241
WM_NCPOINTERDOWN	equ 0x0242
WM_NCPOINTERUP		equ 0x0243
WM_POINTERUPDATE	equ 0x0245
WM_POINTERDOWN		equ 0x0246
WM_POINTERUP		equ 0x0247
WM_POINTERENTER		equ 0x0249
WM_POINTERLEAVE		equ 0x024A
WM_POINTERACTIVATE	equ 0x024B
WM_POINTERCAPTURECHANGED equ 0x024C
WM_TOUCHHITTESTING	equ 0x024D
WM_POINTERWHEEL		equ 0x024E
WM_POINTERHWHEEL	equ 0x024F
DM_POINTERHITTEST	equ 0x0250
endif

if(WINVER GE 0x0400)
WM_IME_SETCONTEXT	equ 0x0281
WM_IME_NOTIFY		equ 0x0282
WM_IME_CONTROL		equ 0x0283
WM_IME_COMPOSITIONFULL	equ 0x0284
WM_IME_SELECT		equ 0x0285
WM_IME_CHAR		equ 0x0286
endif
if(WINVER GE 0x0500)
WM_IME_REQUEST		equ 0x0288
endif
if(WINVER GE 0x0400)
WM_IME_KEYDOWN		equ 0x0290
WM_IME_KEYUP		equ 0x0291
endif
if(_WIN32_WINNT GE 0x0400)
WM_MOUSEHOVER		equ 0x02A1
WM_MOUSELEAVE		equ 0x02A3
endif
if(WINVER GE 0x0500)
WM_NCMOUSEHOVER		equ 0x02A0
WM_NCMOUSELEAVE		equ 0x02A2
endif
if(_WIN32_WINNT GE 0x0501)
WM_WTSSESSION_CHANGE	equ 0x02B1
WM_TABLET_FIRST		equ 0x02c0
WM_TABLET_LAST		equ 0x02df
endif
if(WINVER GE 0x0601)
WM_DPICHANGED		equ 0x02E0
endif

WM_CUT			equ 0x0300
WM_COPY			equ 0x0301
WM_PASTE		equ 0x0302
WM_CLEAR		equ 0x0303
WM_UNDO			equ 0x0304
WM_RENDERFORMAT		equ 0x0305
WM_RENDERALLFORMATS	equ 0x0306
WM_DESTROYCLIPBOARD	equ 0x0307
WM_DRAWCLIPBOARD	equ 0x0308
WM_PAINTCLIPBOARD	equ 0x0309
WM_VSCROLLCLIPBOARD	equ 0x030A
WM_SIZECLIPBOARD	equ 0x030B
WM_ASKCBFORMATNAME	equ 0x030C
WM_CHANGECBCHAIN	equ 0x030D
WM_HSCROLLCLIPBOARD	equ 0x030E
WM_QUERYNEWPALETTE	equ 0x030F
WM_PALETTEISCHANGING	equ 0x0310
WM_PALETTECHANGED	equ 0x0311
WM_HOTKEY		equ 0x0312

if(WINVER GE 0x0400)
WM_PRINT		equ 0x0317
WM_PRINTCLIENT		equ 0x0318
endif
if(_WIN32_WINNT GE 0x0500)
WM_APPCOMMAND		equ 0x0319
endif
if(_WIN32_WINNT GE 0x0501)
WM_THEMECHANGED		equ 0x031A
endif
if(_WIN32_WINNT GE 0x0501)
WM_CLIPBOARDUPDATE	equ 0x031D
endif
if(_WIN32_WINNT GE 0x0600)
WM_DWMCOMPOSITIONCHANGED equ 0x031E
WM_DWMNCRENDERINGCHANGED equ 0x031F
WM_DWMCOLORIZATIONCOLORCHANGED equ 0x0320
WM_DWMWINDOWMAXIMIZEDCHANGE equ 0x0321
endif
if(_WIN32_WINNT GE 0x0601)
WM_DWMSENDICONICTHUMBNAIL equ 0x0323
WM_DWMSENDICONICLIVEPREVIEWBITMAP equ 0x0326
endif
if(WINVER GE 0x0600)
WM_GETTITLEBARINFOEX	equ 0x033F
endif
if(WINVER GE 0x0400)
WM_HANDHELDFIRST	equ 0x0358
WM_HANDHELDLAST		equ 0x035F
WM_AFXFIRST		equ 0x0360
WM_AFXLAST		equ 0x037F
endif
WM_PENWINFIRST		equ 0x0380
WM_PENWINLAST		equ 0x038F
if(WINVER GE 0x0400)
WM_APP			equ 0x8000
endif

WM_USER			equ 0x0400

if(WINVER GE 0x0400)
WMSZ_LEFT		equ 1
WMSZ_RIGHT		equ 2
WMSZ_TOP		equ 3
WMSZ_TOPLEFT		equ 4
WMSZ_TOPRIGHT		equ 5
WMSZ_BOTTOM		equ 6
WMSZ_BOTTOMLEFT		equ 7
WMSZ_BOTTOMRIGHT	equ 8
endif

ifndef NONCMESSAGES
HTERROR			equ (-2)
HTTRANSPARENT		equ (-1)
HTNOWHERE		equ 0
HTCLIENT		equ 1
HTCAPTION		equ 2
HTSYSMENU		equ 3
HTGROWBOX		equ 4
HTSIZE			equ HTGROWBOX
HTMENU			equ 5
HTHSCROLL		equ 6
HTVSCROLL		equ 7
HTMINBUTTON		equ 8
HTMAXBUTTON		equ 9
HTLEFT			equ 10
HTRIGHT			equ 11
HTTOP			equ 12
HTTOPLEFT		equ 13
HTTOPRIGHT		equ 14
HTBOTTOM		equ 15
HTBOTTOMLEFT		equ 16
HTBOTTOMRIGHT		equ 17
HTBORDER		equ 18
HTREDUCE		equ HTMINBUTTON
HTZOOM			equ HTMAXBUTTON
HTSIZEFIRST		equ HTLEFT
HTSIZELAST		equ HTBOTTOMRIGHT
if(WINVER GE 0x0400)
HTOBJECT		equ 19
HTCLOSE			equ 20
HTHELP			equ 21
endif
SMTO_NORMAL		equ 0x0000
SMTO_BLOCK		equ 0x0001
SMTO_ABORTIFHUNG	equ 0x0002
if(WINVER GE 0x0500)
SMTO_NOTIMEOUTIFNOTHUNG equ 0x0008
endif
if(WINVER GE 0x0600)
SMTO_ERRORONEXIT	equ 0x0020
endif

endif ; NONCMESSAGES

MA_ACTIVATE		equ 1
MA_ACTIVATEANDEAT	equ 2
MA_NOACTIVATE		equ 3
MA_NOACTIVATEANDEAT	equ 4

ICON_SMALL		equ 0
ICON_BIG		equ 1

RegisterWindowMessageA proto WINAPI :LPCSTR
RegisterWindowMessageW proto WINAPI :LPCWSTR
ifdef _UNICODE
RegisterWindowMessage	equ <RegisterWindowMessageW>
else
RegisterWindowMessage	equ <RegisterWindowMessageA>
endif

SIZE_RESTORED		equ 0
SIZE_MINIMIZED		equ 1
SIZE_MAXIMIZED		equ 2
SIZE_MAXSHOW		equ 3
SIZE_MAXHIDE		equ 4

SIZENORMAL		equ SIZE_RESTORED
SIZEICONIC		equ SIZE_MINIMIZED
SIZEFULLSCREEN		equ SIZE_MAXIMIZED
SIZEZOOMSHOW		equ SIZE_MAXSHOW
SIZEZOOMHIDE		equ SIZE_MAXHIDE

WINDOWPOS		STRUC
hwnd			HWND ?
hwndInsertAfter		HWND ?
x			SINT ?
y			SINT ?
_cx			SINT ?
cy			SINT ?
flags			UINT ?
WINDOWPOS		ENDS
LPWINDOWPOS		typedef ptr WINDOWPOS
PWINDOWPOS		typedef ptr WINDOWPOS

NCCALCSIZE_PARAMS	STRUC
rgrc			RECT 3 dup(<>)
lppos			PWINDOWPOS ?
NCCALCSIZE_PARAMS	ENDS
LPNCCALCSIZE_PARAMS	typedef ptr NCCALCSIZE_PARAMS

WVR_ALIGNTOP		equ 0x0010
WVR_ALIGNLEFT		equ 0x0020
WVR_ALIGNBOTTOM		equ 0x0040
WVR_ALIGNRIGHT		equ 0x0080
WVR_HREDRAW		equ 0x0100
WVR_VREDRAW		equ 0x0200
WVR_REDRAW		equ (WVR_HREDRAW OR WVR_VREDRAW)
WVR_VALIDRECTS		equ 0x0400

ifndef NOKEYSTATES
MK_LBUTTON		equ 0x0001
MK_RBUTTON		equ 0x0002
MK_SHIFT		equ 0x0004
MK_CONTROL		equ 0x0008
MK_MBUTTON		equ 0x0010
if(_WIN32_WINNT GE 0x0500)
MK_XBUTTON1		equ 0x0020
MK_XBUTTON2		equ 0x0040
endif
endif

if(_WIN32_WINNT GE 0x0400)
ifndef NOTRACKMOUSEEVENT
TME_HOVER		equ 0x00000001
TME_LEAVE		equ 0x00000002
if(WINVER GE 0x0500)
TME_NONCLIENT		equ 0x00000010
endif
TME_QUERY		equ 0x40000000
TME_CANCEL		equ 0x80000000
HOVER_DEFAULT		equ 0xFFFFFFFF
TRACKMOUSEEVENT		STRUC
cbSize			dd ?
dwFlags			dd ?
hwndTrack		HWND ?
dwHoverTime		dd ?
TRACKMOUSEEVENT		ENDS
LPTRACKMOUSEEVENT	typedef ptr TRACKMOUSEEVENT

TrackMouseEvent proto WINAPI :LPTRACKMOUSEEVENT
endif
endif

endif ; NOWINMESSAGES

ifndef NOWINSTYLES

WS_OVERLAPPED		equ 0x00000000
WS_POPUP		equ 0x80000000
WS_CHILD		equ 0x40000000
WS_MINIMIZE		equ 0x20000000
WS_VISIBLE		equ 0x10000000
WS_DISABLED		equ 0x08000000
WS_CLIPSIBLINGS		equ 0x04000000
WS_CLIPCHILDREN		equ 0x02000000
WS_MAXIMIZE		equ 0x01000000
WS_CAPTION		equ 0x00C00000
WS_BORDER		equ 0x00800000
WS_DLGFRAME		equ 0x00400000
WS_VSCROLL		equ 0x00200000
WS_HSCROLL		equ 0x00100000
WS_SYSMENU		equ 0x00080000
WS_THICKFRAME		equ 0x00040000
WS_GROUP		equ 0x00020000
WS_TABSTOP		equ 0x00010000

WS_MINIMIZEBOX		equ 0x00020000
WS_MAXIMIZEBOX		equ 0x00010000

WS_TILED		equ WS_OVERLAPPED
WS_ICONIC		equ WS_MINIMIZE
WS_SIZEBOX		equ WS_THICKFRAME

WS_OVERLAPPEDWINDOW	equ WS_OVERLAPPED OR WS_CAPTION OR WS_SYSMENU OR \
			WS_THICKFRAME OR WS_MINIMIZEBOX OR WS_MAXIMIZEBOX
WS_POPUPWINDOW		equ WS_POPUP OR WS_BORDER OR WS_SYSMENU
WS_CHILDWINDOW		equ WS_CHILD
WS_TILEDWINDOW		equ WS_OVERLAPPEDWINDOW

WS_EX_DLGMODALFRAME	equ 0x00000001
WS_EX_NOPARENTNOTIFY	equ 0x00000004
WS_EX_TOPMOST		equ 0x00000008
WS_EX_ACCEPTFILES	equ 0x00000010
WS_EX_TRANSPARENT	equ 0x00000020
if(WINVER GE 0x0400)
WS_EX_MDICHILD		equ 0x00000040
WS_EX_TOOLWINDOW	equ 0x00000080
WS_EX_WINDOWEDGE	equ 0x00000100
WS_EX_CLIENTEDGE	equ 0x00000200
WS_EX_CONTEXTHELP	equ 0x00000400

WS_EX_RIGHT		equ 0x00001000
WS_EX_LEFT		equ 0x00000000
WS_EX_RTLREADING	equ 0x00002000
WS_EX_LTRREADING	equ 0x00000000
WS_EX_LEFTSCROLLBAR	equ 0x00004000
WS_EX_RIGHTSCROLLBAR	equ 0x00000000

WS_EX_CONTROLPARENT	equ 0x00010000
WS_EX_STATICEDGE	equ 0x00020000
WS_EX_APPWINDOW		equ 0x00040000

WS_EX_OVERLAPPEDWINDOW	equ WS_EX_WINDOWEDGE OR WS_EX_CLIENTEDGE
WS_EX_PALETTEWINDOW	equ WS_EX_WINDOWEDGE OR WS_EX_TOOLWINDOW OR WS_EX_TOPMOST
endif

if(_WIN32_WINNT GE 0x0500)
WS_EX_LAYERED		equ 0x00080000
endif

if(WINVER GE 0x0500)
WS_EX_NOINHERITLAYOUT	equ 0x00100000
WS_EX_LAYOUTRTL		equ 0x00400000
endif

if(_WIN32_WINNT GE 0x0501)
WS_EX_COMPOSITED	equ 0x02000000
endif
if(_WIN32_WINNT GE 0x0500)
WS_EX_NOACTIVATE	equ 0x08000000
endif

CS_VREDRAW		equ 0x0001
CS_HREDRAW		equ 0x0002
CS_DBLCLKS		equ 0x0008
CS_OWNDC		equ 0x0020
CS_CLASSDC		equ 0x0040
CS_PARENTDC		equ 0x0080
CS_NOCLOSE		equ 0x0200
CS_SAVEBITS		equ 0x0800
CS_BYTEALIGNCLIENT	equ 0x1000
CS_BYTEALIGNWINDOW	equ 0x2000
CS_GLOBALCLASS		equ 0x4000

CS_IME			equ 0x00010000
if(_WIN32_WINNT GE 0x0501)
CS_DROPSHADOW		equ 0x00020000
endif

endif ; NOWINSTYLES

if (WINVER GE 0x0400)

PRF_CHECKVISIBLE	equ 0x00000001
PRF_NONCLIENT		equ 0x00000002
PRF_CLIENT		equ 0x00000004
PRF_ERASEBKGND		equ 0x00000008
PRF_CHILDREN		equ 0x00000010
PRF_OWNED		equ 0x00000020

BDR_RAISEDOUTER		equ 0x0001
BDR_SUNKENOUTER		equ 0x0002
BDR_RAISEDINNER		equ 0x0004
BDR_SUNKENINNER		equ 0x0008

BDR_OUTER		equ (BDR_RAISEDOUTER or BDR_SUNKENOUTER)
BDR_INNER		equ (BDR_RAISEDINNER or BDR_SUNKENINNER)
BDR_RAISED		equ (BDR_RAISEDOUTER or BDR_RAISEDINNER)
BDR_SUNKEN		equ (BDR_SUNKENOUTER or BDR_SUNKENINNER)

EDGE_RAISED		equ BDR_RAISEDOUTER OR BDR_RAISEDINNER
EDGE_SUNKEN		equ BDR_SUNKENOUTER OR BDR_SUNKENINNER
EDGE_ETCHED		equ BDR_SUNKENOUTER OR BDR_RAISEDINNER
EDGE_BUMP		equ BDR_RAISEDOUTER OR BDR_SUNKENINNER

BF_LEFT			equ 0x0001
BF_TOP			equ 0x0002
BF_RIGHT		equ 0x0004
BF_BOTTOM		equ 0x0008

BF_TOPLEFT		equ BF_TOP OR BF_LEFT
BF_TOPRIGHT		equ BF_TOP OR BF_RIGHT
BF_BOTTOMLEFT		equ BF_BOTTOM OR BF_LEFT
BF_BOTTOMRIGHT		equ BF_BOTTOM OR BF_RIGHT
BF_RECT			equ BF_LEFT OR BF_TOP OR BF_RIGHT OR BF_BOTTOM

BF_DIAGONAL		equ 0x0010

BF_DIAGONAL_ENDTOPRIGHT equ (BF_DIAGONA OR BF_TOP OR BF_RIGHT)
BF_DIAGONAL_ENDTOPLEFT	equ (BF_DIAGONAL OR BF_TOP OR BF_LEFT)
BF_DIAGONAL_ENDBOTTOMLEFT equ (BF_DIAGONAL OR BF_BOTTOM OR BF_LEFT)
BF_DIAGONAL_ENDBOTTOMRIGHT equ (BF_DIAGONA OR BF_BOTTOM OR BF_RIGHT)

BF_MIDDLE		equ 0x0800
BF_SOFT			equ 0x1000
BF_ADJUST		equ 0x2000
BF_FLAT			equ 0x4000
BF_MONO			equ 0x8000

DrawEdge proto WINAPI :HDC, :LPRECT, :UINT, :UINT

DFC_CAPTION		equ 1
DFC_MENU		equ 2
DFC_SCROLL		equ 3
DFC_BUTTON		equ 4
if(WINVER GE 0x0500)
DFC_POPUPMENU		equ 5
endif

DFCS_CAPTIONCLOSE	equ 0x0000
DFCS_CAPTIONMIN		equ 0x0001
DFCS_CAPTIONMAX		equ 0x0002
DFCS_CAPTIONRESTORE	equ 0x0003
DFCS_CAPTIONHELP	equ 0x0004

DFCS_MENUARROW		equ 0x0000
DFCS_MENUCHECK		equ 0x0001
DFCS_MENUBULLET		equ 0x0002
DFCS_MENUARROWRIGHT	equ 0x0004
DFCS_SCROLLUP		equ 0x0000
DFCS_SCROLLDOWN		equ 0x0001
DFCS_SCROLLLEFT		equ 0x0002
DFCS_SCROLLRIGHT	equ 0x0003
DFCS_SCROLLCOMBOBOX	equ 0x0005
DFCS_SCROLLSIZEGRIP	equ 0x0008
DFCS_SCROLLSIZEGRIPRIGHT equ 0x0010

DFCS_BUTTONCHECK	equ 0x0000
DFCS_BUTTONRADIOIMAGE	equ 0x0001
DFCS_BUTTONRADIOMASK	equ 0x0002
DFCS_BUTTONRADIO	equ 0x0004
DFCS_BUTTON3STATE	equ 0x0008
DFCS_BUTTONPUSH		equ 0x0010

DFCS_INACTIVE		equ 0x0100
DFCS_PUSHED		equ 0x0200
DFCS_CHECKED		equ 0x0400

if(WINVER GE 0x0500)
DFCS_TRANSPARENT	equ 0x0800
DFCS_HOT		equ 0x1000
endif

DFCS_ADJUSTRECT		equ 0x2000
DFCS_FLAT		equ 0x4000
DFCS_MONO		equ 0x8000

DrawFrameControl proto WINAPI :HDC, :LPRECT, :UINT, :UINT

DC_ACTIVE		equ 0x0001
DC_SMALLCAP		equ 0x0002
DC_ICON			equ 0x0004
DC_TEXT			equ 0x0008
DC_INBUTTON		equ 0x0010
if(WINVER GE 0x0500)
DC_GRADIENT		equ 0x0020
endif
if(_WIN32_WINNT GE 0x0501)
DC_BUTTONS		equ 0x1000
endif

DrawCaption proto WINAPI :HWND, :HDC, :LPRECT, :UINT

IDANI_OPEN		equ 1
IDANI_CLOSE		equ 2
IDANI_CAPTION		equ 3

DrawAnimatedRects proto WINAPI :HWND, :SINT, :LPRECT, :LPRECT

endif ; WINVER GE 0x0400

ifndef NOCLIPBOARD

CF_TEXT			equ 1
CF_BITMAP		equ 2
CF_METAFILEPICT		equ 3
CF_SYLK			equ 4
CF_DIF			equ 5
CF_TIFF			equ 6
CF_OEMTEXT		equ 7
CF_DIB			equ 8
CF_PALETTE		equ 9
CF_PENDATA		equ 10
CF_RIFF			equ 11
CF_WAVE			equ 12
CF_UNICODETEXT		equ 13
CF_ENHMETAFILE		equ 14
if (WINVER GE 0x0400)
CF_HDROP		equ 15
CF_LOCALE		equ 16
endif
if (WINVER GE 0x0500)
CF_DIBV5		equ 17
endif
if (WINVER GE 0x0500)
CF_MAX			equ 18
elseif (WINVER GE 0x0400)
CF_MAX			equ 17
else
CF_MAX			equ 15
endif

CF_OWNERDISPLAY		equ 0x0080
CF_DSPTEXT		equ 0x0081
CF_DSPBITMAP		equ 0x0082
CF_DSPMETAFILEPICT	equ 0x0083
CF_DSPENHMETAFILE	equ 0x008E

CF_PRIVATEFIRST		equ 0x0200
CF_PRIVATELAST		equ 0x02FF

CF_GDIOBJFIRST		equ 0x0300
CF_GDIOBJLAST		equ 0x03FF

endif ; NOCLIPBOARD

FVIRTKEY		equ TRUE
FNOINVERT		equ 0x02
FSHIFT			equ 0x04
FCONTROL		equ 0x08
FALT			equ 0x10

ACCEL			STRUC
ifndef _MAC
fVirt			db ?
key			dw ?
cmd			dw ?
else
fVirt			dw ?
key			dw ?
cmd			dd ?
endif
ACCEL			ENDS
LPACCEL			typedef ptr ACCEL

PAINTSTRUCT		STRUC
hdc			HDC ?
fErase			BOOL ?
rcPaint			RECT <>
fRestore		BOOL ?
fIncUpdate		BOOL ?
rgbReserved		db 32 dup(?)
PAINTSTRUCT		ENDS
PPAINTSTRUCT		typedef ptr PAINTSTRUCT
NPPAINTSTRUCT		typedef ptr PAINTSTRUCT
LPPAINTSTRUCT		typedef ptr PAINTSTRUCT

CREATESTRUCTA		STRUC
lpCreateParams		LPVOID ?
hInstance		HINSTANCE ?
hMenu			HMENU ?
hwndParent		HWND ?
cy			SINT ?
_cx			SINT ?
y			SINT ?
x			SINT ?
style			LONG ?
lpszName		LPCSTR ?
lpszClass		LPCSTR ?
dwExStyle		dd ?
CREATESTRUCTA		ENDS
LPCREATESTRUCTA		typedef ptr CREATESTRUCTA
CREATESTRUCTW		STRUC
lpCreateParams		LPVOID ?
hInstance		HINSTANCE ?
hMenu			HMENU ?
hwndParent		HWND ?
cy			SINT ?
_cx			SINT ?
y			SINT ?
x			SINT ?
style			LONG ?
lpszName		LPCWSTR ?
lpszClass		LPCWSTR ?
dwExStyle		dd ?
CREATESTRUCTW		ENDS
LPCREATESTRUCTW		typedef ptr CREATESTRUCTW
ifdef _UNICODE
CREATESTRUCT		typedef CREATESTRUCTW
LPCREATESTRUCT		typedef LPCREATESTRUCTW
else
CREATESTRUCT		typedef CREATESTRUCTA
LPCREATESTRUCT		typedef LPCREATESTRUCTA
endif

WINDOWPLACEMENT		STRUC
length			UINT ?
flags			UINT ?
showCmd			UINT ?
ptMinPosition		POINT <>
ptMaxPosition		POINT <>
rcNormalPosition	RECT <>
ifdef _MAC
rcDevice		RECT <>
endif
WINDOWPLACEMENT		ENDS
LPWINDOWPLACEMENT	typedef ptr WINDOWPLACEMENT
PWINDOWPLACEMENT	typedef ptr WINDOWPLACEMENT

WPF_SETMINPOSITION	equ 0x0001
WPF_RESTORETOMAXIMIZED	equ 0x0002
if(WINVER GE 0x0400)
NMHDR			STRUC
hwndFrom		HWND ?
idFrom			UINT_PTR ?
code			UINT ?
NMHDR			ENDS
LPNMHDR			typedef ptr NMHDR

STYLESTRUCT		STRUC
styleOld		dd ?
styleNew		dd ?
STYLESTRUCT		ENDS
LPSTYLESTRUCT		typedef ptr STYLESTRUCT
endif


ODT_MENU		equ 1
ODT_LISTBOX		equ 2
ODT_COMBOBOX		equ 3
ODT_BUTTON		equ 4
if(WINVER GE 0x0400)
ODT_STATIC		equ 5
endif

ODA_DRAWENTIRE		equ 0x0001
ODA_SELECT		equ 0x0002
ODA_FOCUS		equ 0x0004

ODS_SELECTED		equ 0x0001
ODS_GRAYED		equ 0x0002
ODS_DISABLED		equ 0x0004
ODS_CHECKED		equ 0x0008
ODS_FOCUS		equ 0x0010
if(WINVER GE 0x0400)
ODS_DEFAULT		equ 0x0020
ODS_COMBOBOXEDIT	equ 0x1000
endif
if(WINVER GE 0x0500)
ODS_HOTLIGHT		equ 0x0040
ODS_INACTIVE		equ 0x0080
if(_WIN32_WINNT GE 0x0500)
ODS_NOACCEL		equ 0x0100
ODS_NOFOCUSRECT		equ 0x0200
endif
endif

MEASUREITEMSTRUCT	STRUC
CtlType			UINT ?
CtlID			UINT ?
itemID			UINT ?
itemWidth		UINT ?
itemHeight		UINT ?
itemData		ULONG_PTR ?
MEASUREITEMSTRUCT	ENDS
PMEASUREITEMSTRUCT	typedef ptr MEASUREITEMSTRUCT
LPMEASUREITEMSTRUCT	typedef ptr MEASUREITEMSTRUCT


DRAWITEMSTRUCT		STRUC
CtlType			UINT ?
CtlID			UINT ?
itemID			UINT ?
itemAction		UINT ?
itemState		UINT ?
hwndItem		HWND ?
hDC			HDC ?
rcItem			RECT <>
itemData		ULONG_PTR ?
DRAWITEMSTRUCT		ENDS
PDRAWITEMSTRUCT		typedef ptr DRAWITEMSTRUCT
LPDRAWITEMSTRUCT	typedef ptr DRAWITEMSTRUCT

DELETEITEMSTRUCT	STRUC
CtlType			UINT ?
CtlID			UINT ?
itemID			UINT ?
hwndItem		HWND ?
itemData		ULONG_PTR ?
DELETEITEMSTRUCT	ENDS
PDELETEITEMSTRUCT	typedef ptr DELETEITEMSTRUCT
LPDELETEITEMSTRUCT	typedef ptr DELETEITEMSTRUCT

COMPAREITEMSTRUCT	STRUC
CtlType			UINT ?
CtlID			UINT ?
hwndItem		HWND ?
itemID1			UINT ?
itemData1		ULONG_PTR ?
itemID2			UINT ?
itemData2		ULONG_PTR ?
dwLocaleId		dd ?
COMPAREITEMSTRUCT	ENDS
PCOMPAREITEMSTRUCT	typedef ptr COMPAREITEMSTRUCT
LPCOMPAREITEMSTRUCT	typedef ptr COMPAREITEMSTRUCT

ifndef NOMSG

GetMessageA proto WINAPI :LPMSG, :HWND, :UINT, :UINT
GetMessageW proto WINAPI :LPMSG, :HWND, :UINT, :UINT
ifdef _UNICODE
GetMessage		equ <GetMessageW>
else
GetMessage		equ <GetMessageA>
endif

TranslateMessage proto WINAPI :ptr MSG
DispatchMessageA proto WINAPI :ptr MSG
DispatchMessageW proto WINAPI :ptr MSG
ifdef _UNICODE
DispatchMessage		equ <DispatchMessageW>
else
DispatchMessage		equ <DispatchMessageA>
endif

SetMessageQueue proto WINAPI :SINT
PeekMessageA proto WINAPI :LPMSG, :HWND, :UINT, :UINT, :UINT
PeekMessageW proto WINAPI :LPMSG, :HWND, :UINT, :UINT, :UINT
ifdef _UNICODE
PeekMessage		equ <PeekMessageW>
else
PeekMessage		equ <PeekMessageA>
endif

PM_NOREMOVE		equ 0x0000
PM_REMOVE		equ 0x0001
PM_NOYIELD		equ 0x0002
if(WINVER GE 0x0500)
PM_QS_INPUT		equ (QS_INPUT SHL 16)
PM_QS_POSTMESSAGE	equ ((QS_POSTMESSAGE OR QS_HOTKEY OR QS_TIMER) SHL 16)
PM_QS_PAINT		equ (QS_PAINT SHL 16)
PM_QS_SENDMESSAGE	equ (QS_SENDMESSAGE SHL 16)
endif

endif ; NOMSG

RegisterHotKey proto WINAPI :HWND, :SINT, :UINT, :UINT
UnregisterHotKey proto WINAPI :HWND, :SINT

MOD_ALT			equ 0x0001
MOD_CONTROL		equ 0x0002
MOD_SHIFT		equ 0x0004
MOD_WIN			equ 0x0008
if(WINVER GE 0x0601)
MOD_NOREPEAT		equ 0x4000
endif

IDHOT_SNAPWINDOW	equ (-1)
IDHOT_SNAPDESKTOP	equ (-2)

ifdef WIN_INTERNAL
ifndef LSTRING
NOLSTRING equ 1
endif
ifndef LFILEIO
NOLFILEIO equ 1
endif
endif

if(_WIN32_WINNT GE 0x0400)
ENDSESSION_CLOSEAPP	equ 0x00000001
endif
if(_WIN32_WINNT GE 0x0400)
ENDSESSION_CRITICAL	equ 0x40000000
endif
if(_WIN32_WINNT GE 0x0400)
ENDSESSION_LOGOFF	equ 0x80000000
endif

EWX_LOGOFF		equ 0
EWX_SHUTDOWN		equ 0x00000001
EWX_REBOOT		equ 0x00000002
EWX_FORCE		equ 0x00000004
EWX_POWEROFF		equ 0x00000008
if(_WIN32_WINNT GE 0x0500)
EWX_FORCEIFHUNG		equ 0x00000010
endif
EWX_QUICKRESOLVE	equ 0x00000020
if(_WIN32_WINNT GE 0x0600)
EWX_RESTARTAPPS		equ 0x00000040
endif
EWX_HYBRID_SHUTDOWN	equ 0x00400000
EWX_BOOTOPTIONS		equ 0x01000000


ExitWindows macro dwReserved, Code
	exitm<ExitWindowsEx(EWX_LOGOFF, 0xFFFFFFFF)>
	endm

ExitWindowsEx proto WINAPI :UINT, :DWORD
SwapMouseButton proto WINAPI :BOOL
GetMessagePos proto WINAPI
GetMessageTime proto WINAPI
GetMessageExtraInfo proto WINAPI
if(_WIN32_WINNT GE 0x0602)
GetUnpredictedMessagePos proto WINAPI
endif
if(_WIN32_WINNT GE 0x0501)
IsWow64Message proto WINAPI
endif
if(WINVER GE 0x0400)
SetMessageExtraInfo proto WINAPI :LPARAM
endif
SendMessageA proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
SendMessageW proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
SendMessage		equ <SendMessageW>
else
SendMessage		equ <SendMessageA>
endif

SendMessageTimeoutA proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM, :UINT, :UINT, :LPDWORD
SendMessageTimeoutW proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM, :UINT, :UINT, :LPDWORD
ifdef _UNICODE
SendMessageTimeout	equ <SendMessageTimeoutW>
else
SendMessageTimeout	equ <SendMessageTimeoutA>
endif

SendNotifyMessageA proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
SendNotifyMessageW proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
SendNotifyMessage	equ <SendNotifyMessageW>
else
SendNotifyMessage	equ <SendNotifyMessageA>
endif

SendMessageCallbackA proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM, :SENDASYNCPROC, :ULONG_PTR
SendMessageCallbackW proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM, :SENDASYNCPROC, :ULONG_PTR
ifdef _UNICODE
SendMessageCallback	equ <SendMessageCallbackW>
else
SendMessageCallback	equ <SendMessageCallbackA>
endif

if (_WIN32_WINNT GE 0x0501)
BSMINFO			STRUC
cbSize			UINT ?
hdesk			HDESK ?
hwnd			HWND ?
luid			LUID <>
BSMINFO			ENDS
PBSMINFO		typedef ptr BSMINFO

BroadcastSystemMessageExA proto WINAPI :DWORD, :LPDWORD, :UINT, :WPARAM, :LPARAM, :PBSMINFO
BroadcastSystemMessageExW proto WINAPI :DWORD, :LPDWORD, :UINT, :WPARAM, :LPARAM, :PBSMINFO
ifdef _UNICODE
BroadcastSystemMessageEx equ <BroadcastSystemMessageExW>
else
BroadcastSystemMessageEx equ <BroadcastSystemMessageExA>
endif
endif

if (WINVER GE 0x0400)

ifdef _WIN32_WINNT
BroadcastSystemMessageA proto WINAPI :DWORD, :LPDWORD, :UINT, :WPARAM, :LPARAM
BroadcastSystemMessageW proto WINAPI :DWORD, :LPDWORD, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
BroadcastSystemMessage	equ <BroadcastSystemMessageW>
else
BroadcastSystemMessage	equ <BroadcastSystemMessageA>
endif
elseifdef _WIN32_WINDOWS
BroadcastSystemMessage proto WINAPI :DWORD, :LPDWORD, :UINT, :WPARAM, :LPARAM
endif

BSM_ALLCOMPONENTS	equ 0x00000000
BSM_VXDS		equ 0x00000001
BSM_NETDRIVER		equ 0x00000002
BSM_INSTALLABLEDRIVERS	equ 0x00000004
BSM_APPLICATIONS	equ 0x00000008
BSM_ALLDESKTOPS		equ 0x00000010

BSF_QUERY		equ 0x00000001
BSF_IGNORECURRENTTASK	equ 0x00000002
BSF_FLUSHDISK		equ 0x00000004
BSF_NOHANG		equ 0x00000008
BSF_POSTMESSAGE		equ 0x00000010
BSF_FORCEIFHUNG		equ 0x00000020
BSF_NOTIMEOUTIFNOTHUNG	equ 0x00000040
if(_WIN32_WINNT GE 0x0500)
BSF_ALLOWSFW		equ 0x00000080
BSF_SENDNOTIFYMESSAGE	equ 0x00000100
endif
if(_WIN32_WINNT GE 0x0501)
BSF_RETURNHDESK		equ 0x00000200
BSF_LUID		equ 0x00000400
endif
BROADCAST_QUERY_DENY	equ 0x424D5144

endif ; WINVER GE 0x0400


if (WINVER GE 0x0500)
HDEVNOTIFY	typedef ptr
PHDEVNOTIFY	typedef ptr HDEVNOTIFY

DEVICE_NOTIFY_WINDOW_HANDLE  equ 0x00000000
DEVICE_NOTIFY_SERVICE_HANDLE equ 0x00000001
if(_WIN32_WINNT GE 0x0501)
DEVICE_NOTIFY_ALL_INTERFACE_CLASSES equ 0x00000004
endif
RegisterDeviceNotificationA proto WINAPI :HANDLE, :LPVOID, :DWORD
RegisterDeviceNotificationW proto WINAPI :HANDLE, :LPVOID, :DWORD
ifdef _UNICODE
RegisterDeviceNotification equ <RegisterDeviceNotificationW>
else
RegisterDeviceNotification equ <RegisterDeviceNotificationA>
endif
UnregisterDeviceNotification proto WINAPI :HDEVNOTIFY

if (_WIN32_WINNT GE 0x0502)
ifndef _HPOWERNOTIFY_DEF_
define _HPOWERNOTIFY_DEF_
HPOWERNOTIFY	typedef PVOID
PHPOWERNOTIFY	typedef ptr HPOWERNOTIFY
endif
LPCGUID typedef ptr GUID
RegisterPowerSettingNotification proto WINAPI :HANDLE, :LPCGUID, :DWORD
UnregisterPowerSettingNotification proto WINAPI :HPOWERNOTIFY
RegisterSuspendResumeNotification proto WINAPI :HANDLE, :DWORD
UnregisterSuspendResumeNotification proto WINAPI :HPOWERNOTIFY
endif
endif ; WINVER GE 0x0500

endif ; NOUSER

PostMessageA proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
PostMessageW proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
PostMessage		equ <PostMessageW>
else
PostMessage		equ <PostMessageA>
endif

PostThreadMessageA proto WINAPI :DWORD, :UINT, :WPARAM, :LPARAM
PostThreadMessageW proto WINAPI :DWORD, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
PostThreadMessage	equ <PostThreadMessageW>
else
PostThreadMessage	equ <PostThreadMessageA>
endif

PostAppMessageA macro idThread,wMsg,wParam,lParam
	exitm <PostThreadMessageA(idThread,wMsg,wParam,lParam)>
	endm
PostAppMessageW macro idThread,wMsg,wParam,lParam
	exitm <PostThreadMessageW(idThread,wMsg,wParam,lParam)>
	endm
ifdef _UNICODE
PostAppMessage		equ <PostAppMessageW>
else
PostAppMessage		equ <PostAppMessageA>
endif

HWND_BROADCAST		equ 0xffff

if(WINVER GE 0x0500)
HWND_MESSAGE		equ (-3)
endif

AttachThreadInput proto WINAPI :DWORD, :DWORD, :BOOL
ReplyMessage proto WINAPI :LRESULT
WaitMessage proto WINAPI
WaitForInputIdle proto WINAPI :HANDLE, :DWORD

DefWindowProcA proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
DefWindowProcW proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
DefWindowProc equ <DefWindowProcW>
else
DefWindowProc equ <DefWindowProcA>
endif
PostQuitMessage proto WINAPI :SINT

ifdef STRICT

CallWindowProcA proto WINAPI :WNDPROC, :HWND, :UINT, :WPARAM, :LPARAM
CallWindowProcW proto WINAPI :WNDPROC, :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
CallWindowProc		equ <CallWindowProcW>
else
CallWindowProc		equ <CallWindowProcA>
endif

else ; STRICT

CallWindowProcA proto WINAPI :FARPROC, :HWND, :UINT, :WPARAM, :LPARAM
CallWindowProcW proto WINAPI :FARPROC, :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
CallWindowProc		equ <CallWindowProcW>
else
CallWindowProc		equ <CallWindowProcA>
endif

endif ; STRICT

InSendMessage proto WINAPI

if(WINVER GE 0x0500)
InSendMessageEx proto WINAPI :LPVOID

ISMEX_NOSEND		equ 0x00000000
ISMEX_SEND		equ 0x00000001
ISMEX_NOTIFY		equ 0x00000002
ISMEX_CALLBACK		equ 0x00000004
ISMEX_REPLIED		equ 0x00000008
endif

GetDoubleClickTime proto WINAPI
SetDoubleClickTime proto WINAPI :UINT
RegisterClassA proto WINAPI :ptr WNDCLASSA
RegisterClassW proto WINAPI :ptr WNDCLASSA
ifdef _UNICODE
RegisterClass		equ <RegisterClassW>
else
RegisterClass		equ <RegisterClassA>
endif

UnregisterClassA proto WINAPI :LPCSTR, :HINSTANCE
UnregisterClassW proto WINAPI :LPCWSTR, :HINSTANCE
ifdef _UNICODE
UnregisterClass		equ <UnregisterClassW>
else
UnregisterClass		equ <UnregisterClassA>
endif

GetClassInfoA proto WINAPI :HINSTANCE, :LPCSTR, :LPWNDCLASSA
GetClassInfoW proto WINAPI :HINSTANCE, :LPCWSTR, :LPWNDCLASSW
ifdef _UNICODE
GetClassInfo		equ <GetClassInfoW>
else
GetClassInfo		equ <GetClassInfoA>
endif

if(WINVER GE 0x0400)
RegisterClassExA proto WINAPI :ptr WNDCLASSEXA
RegisterClassExW proto WINAPI :ptr WNDCLASSEXW
ifdef _UNICODE
RegisterClassEx		equ <RegisterClassExW>
else
RegisterClassEx		equ <RegisterClassExA>
endif

GetClassInfoExA proto WINAPI :HINSTANCE, :LPCSTR, :LPWNDCLASSEXA
GetClassInfoExW proto WINAPI :HINSTANCE, :LPCWSTR,:LPWNDCLASSEXW
ifdef _UNICODE
GetClassInfoEx		equ <GetClassInfoExW>
else
GetClassInfoEx		equ <GetClassInfoExA>
endif

endif
CW_USEDEFAULT		equ 0x80000000
HWND_DESKTOP		equ 0
if(_WIN32_WINNT GE 0x0501)
CALLBACK(PREGISTERCLASSNAMEW, :LPCWSTR)
endif

CreateWindowExA proto WINAPI :DWORD, :LPCSTR, :LPCSTR, :DWORD, :SINT, :SINT, :SINT, :SINT, :HWND, :HMENU, :HINSTANCE, :LPVOID
CreateWindowExW proto WINAPI :DWORD, :LPCWSTR, :LPCWSTR, :DWORD, :SINT, :SINT, :SINT, :SINT, :HWND, :HMENU, :HINSTANCE, :LPVOID
ifdef _UNICODE
CreateWindowEx		equ <CreateWindowExW>
else
CreateWindowEx		equ <CreateWindowExA>
endif

CreateWindowA macro lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam
	exitm<CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)>
	endm

CreateWindowW macro lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam
	exitm<CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)>
	endm

ifdef _UNICODE
CreateWindow		equ <CreateWindowW>
else
CreateWindow		equ <CreateWindowA>
endif

IsWindow proto WINAPI :HWND
IsMenu proto WINAPI :HMENU
IsChild proto WINAPI :HWND, :HWND
DestroyWindow proto WINAPI :HWND
ShowWindow proto WINAPI :HWND, :SINT

if(WINVER GE 0x0500)
AnimateWindow proto WINAPI :HWND, :DWORD, :DWORD
endif

if (_WIN32_WINNT GE 0x0500)

if defined(_WINGDI_) AND NOT defined(NOGDI)
UpdateLayeredWindow proto WINAPI :HWND, :HDC, :ptr POINT, :ptr POINT, :HDC, :ptr POINT, :COLORREF, :ptr BLENDFUNCTION, :DWORD

LPBLENDFUNCTION		typedef ptr BLENDFUNCTION
UPDATELAYEREDWINDOWINFO STRUC
cbSize			DWORD ?
hdcDst			HDC ?
pptDst			LPPOINT ?
psize			LPPOINT ?
hdcSrc			HDC ?
pptSrc			LPPOINT ?
crKey			COLORREF ?
pblend			LPBLENDFUNCTION ?
dwFlags			DWORD ?
prcDirty		LPRECT ?
UPDATELAYEREDWINDOWINFO ENDS
PUPDATELAYEREDWINDOWINFO typedef ptr UPDATELAYEREDWINDOWINFO

if (_WIN32_WINNT LT 0x0502)
CALLBACK(UpdateLayeredWindowIndirect, :HWND, :ptr UPDATELAYEREDWINDOWINFO)
else
UpdateLayeredWindowIndirect proto WINAPI :HWND, :ptr UPDATELAYEREDWINDOWINFO
endif
endif ; defined(_WINGDI_) AND NOT defined(NOGDI)

if(_WIN32_WINNT GE 0x0501)
GetLayeredWindowAttributes proto WINAPI :HWND, :ptr COLORREF, :ptr BYTE, :ptr DWORD

PW_CLIENTONLY		equ 0x00000001

PrintWindow proto WINAPI :HWND, :HDC, :UINT
endif

SetLayeredWindowAttributes proto WINAPI :HWND, :COLORREF, :BYTE, :DWORD

LWA_COLORKEY		equ 0x00000001
LWA_ALPHA		equ 0x00000002

ULW_COLORKEY		equ 0x00000001
ULW_ALPHA		equ 0x00000002
ULW_OPAQUE		equ 0x00000004
ULW_EX_NORESIZE		equ 0x00000008

if(WINVER GE 0x0400)
ShowWindowAsync proto WINAPI :HWND, :SINT
endif

if(WINVER GE 0x0500)
FlashWindow proto WINAPI :HWND, :DWORD
else
FlashWindow proto WINAPI :HWND, :BOOL
endif

if(WINVER GE 0x0500)
FLASHWINFO		STRUC
cbSize			UINT ?
hwnd			HWND ?
dwFlags			DWORD ?
uCount			UINT ?
dwTimeout		DWORD ?
FLASHWINFO		ENDS
PFLASHWINFO		typedef ptr FLASHWINFO

FlashWindowEx proto WINAPI :PFLASHWINFO

FLASHW_STOP		equ 0
FLASHW_CAPTION		equ 0x00000001
FLASHW_TRAY		equ 0x00000002
FLASHW_ALL		equ (FLASHW_CAPTION OR FASHW_TRAY)
FLASHW_TIMER		equ 0x00000004
FLASHW_TIMERNOFG	equ 0x0000000C
endif

ShowOwnedPopups proto WINAPI :HWND, :BOOL
OpenIcon proto WINAPI :HWND
CloseWindow proto WINAPI :HWND
MoveWindow proto WINAPI :HWND, :SINT,:SINT, :SINT, :SINT, :BOOL

if (WINVER GE 0x0500)
SetWindowPos proto WINAPI :HWND, :HWND, :SINT, :SINT, :SINT, :SINT, :UINT
else
CALLBACK(SetWindowPos, :HWND, :HWND, :SINT, :SINT, :SINT, :SINT, :UINT)
endif

GetWindowPlacement proto WINAPI :HWND, :ptr WINDOWPLACEMENT
SetWindowPlacement proto WINAPI :HWND, :ptr WINDOWPLACEMENT

if(_WIN32_WINNT GE 0x0601)
WDA_NONE		equ 0x00000000
WDA_MONITOR		equ 0x00000001

GetWindowDisplayAffinity proto WINAPI :HWND, :LPDWORD
SetWindowDisplayAffinity proto WINAPI :HWND, :DWORD
endif

ifndef NODEFERWINDOWPOS
BeginDeferWindowPos proto WINAPI :SINT
DeferWindowPos proto WINAPI :HDWP, :HWND, :HWND, :SINT, :SINT, :SINT, :SINT, :UINT
EndDeferWindowPos proto WINAPI :HDWP
endif

IsWindowVisible proto WINAPI :HWND
IsIconic proto WINAPI :HWND
AnyPopup proto WINAPI
BringWindowToTop proto WINAPI :HWND
IsZoomed proto WINAPI :HWND

SWP_NOSIZE		equ 0x0001
SWP_NOMOVE		equ 0x0002
SWP_NOZORDER		equ 0x0004
SWP_NOREDRAW		equ 0x0008
SWP_NOACTIVATE		equ 0x0010
SWP_FRAMECHANGED	equ 0x0020
SWP_SHOWWINDOW		equ 0x0040
SWP_HIDEWINDOW		equ 0x0080
SWP_NOCOPYBITS		equ 0x0100
SWP_NOOWNERZORDER	equ 0x0200
SWP_NOSENDCHANGING	equ 0x0400

SWP_DRAWFRAME		equ SWP_FRAMECHANGED
SWP_NOREPOSITION	equ SWP_NOOWNERZORDER

if(WINVER GE 0x0400)
SWP_DEFERERASE		equ 0x2000
SWP_ASYNCWINDOWPOS	equ 0x4000
endif

HWND_TOP		equ (0)
HWND_BOTTOM		equ (1)
HWND_TOPMOST		equ (-1)
HWND_NOTOPMOST		equ (-2)

ifndef NOCTLMGR

.pragma pack(push, 2)

DLGTEMPLATE		STRUC
style			dd ?
dwExtendedStyle		dd ?
cdit			dw ?
x			dw ?
y			dw ?
_cx			dw ?
cy			dw ?
DLGTEMPLATE		ENDS
LPDLGTEMPLATEA		typedef ptr DLGTEMPLATE
LPDLGTEMPLATEW		typedef ptr DLGTEMPLATE
ifdef _UNICODE
LPDLGTEMPLATE		typedef LPDLGTEMPLATEW
else
LPDLGTEMPLATE		typedef LPDLGTEMPLATEA
endif
LPCDLGTEMPLATEA		typedef ptr DLGTEMPLATE
LPCDLGTEMPLATEW		typedef ptr DLGTEMPLATE
ifdef _UNICODE
LPCDLGTEMPLATE		typedef LPCDLGTEMPLATEW
else
LPCDLGTEMPLATE		typedef LPCDLGTEMPLATEA
endif

DLGITEMTEMPLATE		STRUC
style			dd ?
dwExtendedStyle		dd ?
x			dw ?
y			dw ?
_cx			dw ?
cy			dw ?
id			dw ?
DLGITEMTEMPLATE		ENDS
PDLGITEMTEMPLATEA	typedef ptr DLGITEMTEMPLATE
PDLGITEMTEMPLATEW	typedef ptr DLGITEMTEMPLATE
ifdef _UNICODE
PDLGITEMTEMPLATE	typedef PDLGITEMTEMPLATEW
else
PDLGITEMTEMPLATE	typedef PDLGITEMTEMPLATEA
endif
LPDLGITEMTEMPLATEA	typedef ptr DLGITEMTEMPLATE
LPDLGITEMTEMPLATEW	typedef ptr DLGITEMTEMPLATE
ifdef _UNICODE
LPDLGITEMTEMPLATE	typedef LPDLGITEMTEMPLATEW
else
LPDLGITEMTEMPLATE	typedef LPDLGITEMTEMPLATEA
endif

.pragma pack(pop)

CreateDialogParamA proto WINAPI :HINSTANCE, :LPCSTR, :HWND, :DLGPROC, :LPARAM
CreateDialogParamW proto WINAPI :HINSTANCE, :LPCWSTR,:HWND, :DLGPROC, :LPARAM
ifdef _UNICODE
CreateDialogParam	equ <CreateDialogParamW>
else
CreateDialogParam	equ <CreateDialogParamA>
endif

CreateDialogIndirectParamA proto WINAPI :HINSTANCE, :LPCDLGTEMPLATEA, :HWND, :DLGPROC, :LPARAM
CreateDialogIndirectParamW proto WINAPI :HINSTANCE, :LPCDLGTEMPLATEW, :HWND, :DLGPROC, :LPARAM
ifdef _UNICODE
CreateDialogIndirectParam equ <CreateDialogIndirectParamW>
else
CreateDialogIndirectParam equ <CreateDialogIndirectParamA>
endif

CreateDialogA macro hInstance,lpName,hWndParent,lpDialogFunc
	exitm<CreateDialogParamA(hInstance, lpName, hWndParent, lpDialogFunc, 0)>
	endm
CreateDialogW macro hInstance,lpName,hWndParent,lpDialogFunc
	exitm<CreateDialogParamW(hInstance, lpName, hWndParent, lpDialogFunc, 0)>
	endm

ifdef _UNICODE
CreateDialog		equ <CreateDialogW>
else
CreateDialog		equ <CreateDialogA>
endif

CreateDialogIndirectA macro hInstance, lpTemplate, hWndParent, lpDialogFunc
	exitm<CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)>
	endm

CreateDialogIndirectW macro hInstance, lpTemplate, hWndParent, lpDialogFunc
	exitm<CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)>
	endm
ifdef _UNICODE
CreateDialogIndirect	equ <CreateDialogIndirectW>
else
CreateDialogIndirect	equ <CreateDialogIndirectA>
endif

DialogBoxParamA proto WINAPI :HINSTANCE, :LPCSTR, :HWND, :DLGPROC, :LPARAM
DialogBoxParamW proto WINAPI :HINSTANCE, :LPCWSTR, :HWND, :DLGPROC, :LPARAM
ifdef _UNICODE
DialogBoxParam		equ <DialogBoxParamW>
else
DialogBoxParam		equ <DialogBoxParamA>
endif

DialogBoxIndirectParamA proto WINAPI :HINSTANCE, :LPCDLGTEMPLATEA, :HWND, :DLGPROC, :LPARAM
DialogBoxIndirectParamW proto WINAPI :HINSTANCE, :LPCDLGTEMPLATEW, :HWND, :DLGPROC, :LPARAM
ifdef _UNICODE
DialogBoxIndirectParam	equ <DialogBoxIndirectParamW>
else
DialogBoxIndirectParam	equ <DialogBoxIndirectParamA>
endif

DialogBoxA macro hInstance, lpTemplate, hWndParent, lpDialogFunc
	exitm<DialogBoxParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)>
	endm
DialogBoxW macro hInstance, lpTemplate, hWndParent, lpDialogFunc
	exitm<DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)>
	endm
ifdef _UNICODE
DialogBox		equ <DialogBoxW>
else
DialogBox		equ <DialogBoxA>
endif

DialogBoxIndirectA macro hInstance, lpTemplate, hWndParent, lpDialogFunc
	exitm<DialogBoxIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)>
	endm
DialogBoxIndirectW macro hInstance, lpTemplate, hWndParent, lpDialogFunc
	exitm<DialogBoxIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)>
	endm
ifdef _UNICODE
DialogBoxIndirect	equ <DialogBoxIndirectW>
else
DialogBoxIndirect	equ <DialogBoxIndirectA>
endif

EndDialog proto WINAPI :HWND, :INT_PTR
GetDlgItem proto WINAPI :HWND, :SINT
SetDlgItemInt proto WINAPI  :HWND, :SINT, :UINT, :BOOL
GetDlgItemInt proto WINAPI :HWND, :SINT, :LPBOOL, :BOOL

SetDlgItemTextA proto WINAPI :HWND, :SINT, :LPCSTR
SetDlgItemTextW proto WINAPI :HWND, :SINT, :LPCWSTR
ifdef _UNICODE
SetDlgItemText equ <SetDlgItemTextW>
else
SetDlgItemText equ <SetDlgItemTextA>
endif

GetDlgItemTextA proto WINAPI  :HWND, :SINT, :LPSTR, :SINT
GetDlgItemTextW proto WINAPI :HWND, :SINT, :LPWSTR, :SINT
ifdef _UNICODE
GetDlgItemText equ <GetDlgItemTextW>
else
GetDlgItemText equ <GetDlgItemTextA>
endif

CheckDlgButton proto WINAPI :HWND, :SINT, :UINT
CheckRadioButton proto WINAPI :HWND, :SINT, :SINT, :SINT
IsDlgButtonChecked proto WINAPI :HWND, :SINT

SendDlgItemMessageA proto WINAPI :HWND, :SINT, :UINT, :WPARAM, :LPARAM
SendDlgItemMessageW proto WINAPI :HWND, :SINT, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
SendDlgItemMessage equ <SendDlgItemMessageW>
else
SendDlgItemMessage equ <SendDlgItemMessageA>
endif

GetNextDlgGroupItem proto WINAPI :HWND, :HWND, :BOOL
GetNextDlgTabItem proto WINAPI :HWND, :HWND, :BOOL
GetDlgCtrlID proto WINAPI :HWND

GetDialogBaseUnits proto WINAPI

DefDlgProcA typedef proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
DefDlgProcW typedef proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
DefDlgProc typedef ptr DefDlgProcW
else
DefDlgProc typedef ptr DefDlgProcA
endif

ifndef _MAC
DLGWINDOWEXTRA		equ 30
else
DLGWINDOWEXTRA		equ 48
endif

endif ; NOCTLMGR


ifndef NOMSG
CallMsgFilterA proto WINAPI :LPMSG, :SINT
CallMsgFilterW proto WINAPI :LPMSG, :SINT
ifdef _UNICODE
CallMsgFilter equ <CallMsgFilterW>
else
CallMsgFilter equ <CallMsgFilterA>
endif
endif

ifndef NOCLIPBOARD

OpenClipboard proto WINAPI :HWND
CloseClipboard proto WINAPI
if(WINVER GE 0x0500)
GetClipboardSequenceNumber proto WINAPI
endif
GetClipboardOwner proto WINAPI
SetClipboardViewer proto WINAPI :HWND
GetClipboardViewer proto WINAPI
ChangeClipboardChain proto WINAPI :HWND, :HWND
SetClipboardData proto WINAPI :UINT, :HANDLE
GetClipboardData proto WINAPI :UINT

RegisterClipboardFormatA proto WINAPI :LPCSTR
RegisterClipboardFormatW proto WINAPI :LPCWSTR
ifdef _UNICODE
RegisterClipboardFormat equ <RegisterClipboardFormatW>
else
RegisterClipboardFormat equ <RegisterClipboardFormatA>
endif
CountClipboardFormats proto WINAPI
EnumClipboardFormats proto WINAPI :UINT
GetClipboardFormatNameA proto WINAPI :UINT, :LPSTR, :SINT
GetClipboardFormatNameW proto WINAPI :UINT, :LPWSTR, :SINT
ifdef _UNICODE
GetClipboardFormatName	equ <GetClipboardFormatNameW>
else
GetClipboardFormatName	equ <GetClipboardFormatNameA>
endif
EmptyClipboard proto WINAPI
IsClipboardFormatAvailable proto WINAPI :UINT
GetPriorityClipboardFormat proto WINAPI :ptr UINT, :SINT
GetOpenClipboardWindow proto WINAPI
if (WINVER GE 0x0600)
AddClipboardFormatListener proto WINAPI :HWND
RemoveClipboardFormatListener proto WINAPI :HWND
GetUpdatedClipboardFormats proto WINAPI :PUINT, :UINT, :PUINT
endif
endif ; NOCLIPBOARD


CharToOemA proto WINAPI :LPCSTR, :LPSTR
CharToOemW proto WINAPI :LPCWSTR, :LPSTR
ifdef _UNICODE
CharToOem equ <CharToOemW>
else
CharToOem equ <CharToOemA>
endif

OemToCharA proto WINAPI :LPCSTR, :LPSTR
OemToCharW proto WINAPI :LPCSTR, :LPWSTR
ifdef _UNICODE
OemToChar equ <OemToCharW>
else
OemToChar equ <OemToCharA>
endif

CharToOemBuffA proto WINAPI :LPCSTR, :LPSTR, :DWORD
CharToOemBuffW proto WINAPI :LPCWSTR, :LPSTR, :DWORD
ifdef _UNICODE
CharToOemBuff equ <CharToOemBuffW>
else
CharToOemBuff equ <CharToOemBuffA>
endif

OemToCharBuffA proto WINAPI :LPCSTR, :LPSTR, :DWORD
OemToCharBuffW proto WINAPI :LPCSTR, :LPWSTR, :DWORD
ifdef _UNICODE
OemToCharBuff equ <OemToCharBuffW>
else
OemToCharBuff equ <OemToCharBuffA>
endif

CharUpperA proto WINAPI :LPSTR
CharUpperW proto WINAPI :LPWSTR
ifdef _UNICODE
CharUpper equ <CharUpperW>
else
CharUpper equ <CharUpperA>
endif

CharUpperBuffA proto WINAPI :LPSTR, :DWORD
CharUpperBuffW proto WINAPI :LPWSTR,  :DWORD
ifdef _UNICODE
CharUpperBuff equ <CharUpperBuffW>
else
CharUpperBuff equ <CharUpperBuffA>
endif

CharLowerA proto WINAPI :LPSTR
CharLowerW proto WINAPI :LPWSTR
ifdef _UNICODE
CharLower equ <CharLowerW>
else
CharLower equ <CharLowerA>
endif

CharLowerBuffA proto WINAPI :LPSTR, :DWORD
CharLowerBuffW proto WINAPI :LPWSTR, :DWORD
ifdef _UNICODE
CharLowerBuff equ <CharLowerBuffW>
else
CharLowerBuff equ <CharLowerBuffA>
endif

CharNextA proto WINAPI :LPCSTR
CharNextW proto WINAPI :LPCWSTR
ifdef _UNICODE
CharNext equ <CharNextW>
else
CharNext equ <CharNextA>
endif

CharPrevA proto WINAPI :LPCSTR, :LPCSTR
CharPrevW proto WINAPI :LPCWSTR, :LPCWSTR
ifdef _UNICODE
CharPrev equ <CharPrevW>
else
CharPrev equ <CharPrevA>
endif

if(WINVER GE 0x0400)
CharNextExA proto WINAPI :WORD, :LPCSTR, :DWORD
CharPrevExA proto WINAPI :WORD, :LPCSTR, :LPCSTR, :DWORD
endif

AnsiToOem		equ <CharToOemA>
OemToAnsi		equ <OemToCharA>
AnsiToOemBuff		equ <CharToOemBuffA>
OemToAnsiBuff		equ <OemToCharBuffA>
AnsiUpper		equ <CharUpperA>
AnsiUpperBuff		equ <CharUpperBuffA>
AnsiLower		equ <CharLowerA>
AnsiLowerBuff		equ <CharLowerBuffA>
AnsiNext		equ <CharNextA>
AnsiPrev		equ <CharPrevA>

ifndef	NOLANGUAGE

IsCharAlphaA proto WINAPI :CHAR
IsCharAlphaW proto WINAPI :WCHAR
ifdef _UNICODE
IsCharAlpha equ <IsCharAlphaW>
else
IsCharAlpha equ <IsCharAlphaA>
endif

IsCharAlphaNumericA proto WINAPI :CHAR
IsCharAlphaNumericW proto WINAPI :WCHAR
ifdef _UNICODE
IsCharAlphaNumeric equ <IsCharAlphaNumericW>
else
IsCharAlphaNumeric equ <IsCharAlphaNumericA>
endif

IsCharUpperA proto WINAPI :CHAR
IsCharUpperW proto WINAPI :WCHAR
ifdef _UNICODE
IsCharUpper equ <IsCharUpperW>
else
IsCharUpper equ <IsCharUpperA>
endif

IsCharLowerA proto WINAPI :CHAR
IsCharLowerW proto WINAPI :WCHAR
ifdef _UNICODE
IsCharLower equ <IsCharLowerW>
else
IsCharLower equ <IsCharLowerA>
endif

endif

SetFocus proto WINAPI :HWND
GetActiveWindow proto WINAPI
GetFocus proto WINAPI
GetKBCodePage proto WINAPI

if (WINVER GE 0x0500)
GetKeyState proto WINAPI :SINT
else
CALLBACK(GetKeyState_T, :SINT)
externdef	GetKeyState:GetKeyState_T
endif

GetAsyncKeyState proto WINAPI :SINT
GetKeyboardState proto WINAPI :PBYTE
SetKeyboardState proto WINAPI :LPBYTE

GetKeyNameTextA proto WINAPI :LONG, :LPSTR, :SINT
GetKeyNameTextW proto WINAPI :LONG, :LPWSTR, :SINT
ifdef _UNICODE
GetKeyNameText equ <GetKeyNameTextW>
else
GetKeyNameText equ <GetKeyNameTextA>
endif

GetKeyboardType proto WINAPI :SINT
ToAscii proto WINAPI :UINT, :UINT, :PBYTE, :LPWORD, :UINT
if(WINVER GE 0x0400)
ToAsciiEx proto WINAPI :UINT, :UINT, :PBYTE, :LPWORD, :UINT, :HKL
endif
ToUnicode proto WINAPI :UINT, :UINT, :PBYTE, :LPWSTR, :SINT, :UINT
OemKeyScan proto WINAPI :WORD
VkKeyScanA proto WINAPI :CHAR
VkKeyScanW proto WINAPI :WCHAR
ifdef _UNICODE
VkKeyScan equ <VkKeyScanW>
else
VkKeyScan equ <VkKeyScanA>
endif

if(WINVER GE 0x0400)
VkKeyScanExA proto WINAPI :CHAR, :HKL
VkKeyScanExW proto WINAPI :WCHAR, :HKL
ifdef _UNICODE
VkKeyScanEx equ <VkKeyScanExW>
else
VkKeyScanEx equ <VkKeyScanExA>
endif
endif
KEYEVENTF_EXTENDEDKEY	equ 0x0001
KEYEVENTF_KEYUP		equ 0x0002
if(_WIN32_WINNT GE 0x0500)
KEYEVENTF_UNICODE	equ 0x0004
KEYEVENTF_SCANCODE	equ 0x0008
endif

keybd_event proto WINAPI :BYTE, :BYTE, :DWORD, :ULONG_PTR

MOUSEEVENTF_MOVE	equ 0x0001
MOUSEEVENTF_LEFTDOWN	equ 0x0002
MOUSEEVENTF_LEFTUP	equ 0x0004
MOUSEEVENTF_RIGHTDOWN	equ 0x0008
MOUSEEVENTF_RIGHTUP	equ 0x0010
MOUSEEVENTF_MIDDLEDOWN	equ 0x0020
MOUSEEVENTF_MIDDLEUP	equ 0x0040
MOUSEEVENTF_XDOWN	equ 0x0080
MOUSEEVENTF_XUP		equ 0x0100
MOUSEEVENTF_WHEEL	equ 0x0800
if (_WIN32_WINNT GE 0x0600)
MOUSEEVENTF_HWHEEL	equ 0x01000
endif
if(WINVER GE 0x0600)
MOUSEEVENTF_MOVE_NOCOALESCE equ 0x2000
endif
MOUSEEVENTF_VIRTUALDESK equ 0x4000
MOUSEEVENTF_ABSOLUTE	equ 0x8000

mouse_event proto WINAPI :DWORD, :DWORD, :DWORD, :DWORD, :ULONG_PTR

if (_WIN32_WINNT GT 0x0400)

MOUSEINPUT		STRUC
_dx			LONG ?
dy			LONG ?
mouseData		dd ?
dwFlags			dd ?
time			dd ?
dwExtraInfo		ULONG_PTR ?
MOUSEINPUT		ENDS
PMOUSEINPUT		typedef ptr MOUSEINPUT
LPMOUSEINPUT		typedef ptr MOUSEINPUT

KEYBDINPUT		STRUC
wVk			dw ?
wScan			dw ?
dwFlags			dd ?
time			dd ?
dwExtraInfo		ULONG_PTR ?
KEYBDINPUT		ENDS
PKEYBDINPUT		typedef ptr KEYBDINPUT
LPKEYBDINPUT		typedef ptr KEYBDINPUT

HARDWAREINPUT		STRUC
uMsg			dd ?
wParamL			dw ?
wParamH			dw ?
HARDWAREINPUT		ENDS
PHARDWAREINPUT		typedef ptr HARDWAREINPUT
LPHARDWAREINPUT		typedef ptr HARDWAREINPUT

INPUT_MOUSE		equ 0
INPUT_KEYBOARD		equ 1
INPUT_HARDWARE		equ 2

INPUT			STRUC
type			dd ?
UNION
  mi			MOUSEINPUT <>
  ki			KEYBDINPUT <>
  hi			HARDWAREINPUT <>
ENDS
INPUT			ENDS
PINPUT			typedef ptr INPUT
LPINPUT			typedef ptr INPUT

SendInput proto WINAPI :UINT, :LPINPUT, :SINT

endif

if(WINVER GE 0x0601)

HTOUCHINPUT		typedef HANDLE ; DECLARE_HANDLE(HTOUCHINPUT);

TOUCHINPUT		STRUC
x			LONG ?
y			LONG ?
hSource			HANDLE ?
dwID			dd ?
dwFlags			dd ?
dwMask			dd ?
dwTime			dd ?
dwExtraInfo		ULONG_PTR ?
cxContact		dd ?
cyContact		dd ?
TOUCHINPUT		ENDS
PTOUCHINPUT		typedef ptr TOUCHINPUT
PCTOUCHINPUT		typedef ptr TOUCHINPUT


TOUCH_COORD_TO_PIXEL macro l
	exitm<((l) / 100)>
	endm

TOUCHEVENTF_MOVE	equ 0x0001
TOUCHEVENTF_DOWN	equ 0x0002
TOUCHEVENTF_UP		equ 0x0004
TOUCHEVENTF_INRANGE	equ 0x0008
TOUCHEVENTF_PRIMARY	equ 0x0010
TOUCHEVENTF_NOCOALESCE	equ 0x0020
TOUCHEVENTF_PEN		equ 0x0040
TOUCHEVENTF_PALM	equ 0x0080

TOUCHINPUTMASKF_TIMEFROMSYSTEM equ 0x0001
TOUCHINPUTMASKF_EXTRAINFO      equ 0x0002
TOUCHINPUTMASKF_CONTACTAREA    equ 0x0004

GetTouchInputInfo proto WINAPI :HTOUCHINPUT, :UINT, :PTOUCHINPUT, :SINT
CloseTouchInputHandle proto WINAPI :HTOUCHINPUT

TWF_FINETOUCH		equ 0x00000001
TWF_WANTPALM		equ 0x00000002

RegisterTouchWindow proto WINAPI :HWND, :ULONG
UnregisterTouchWindow proto WINAPI :HWND
IsTouchWindow proto WINAPI :HWND, :PULONG

endif

if(WINVER GE 0x0602)

.enum tagPOINTER_INPUT_TYPE {
    PT_POINTER	= 0x00000001,
    PT_TOUCH	= 0x00000002,
    PT_PEN	= 0x00000003,
    PT_MOUSE	= 0x00000004,
if(WINVER GE 0x0603)
    PT_TOUCHPAD = 0x00000005,
endif
    }

POINTER_INPUT_TYPE	typedef DWORD
POINTER_FLAGS		typedef UINT32

POINTER_FLAG_NONE		equ 0x00000000
POINTER_FLAG_NEW		equ 0x00000001
POINTER_FLAG_INRANGE		equ 0x00000002
POINTER_FLAG_INCONTACT		equ 0x00000004
POINTER_FLAG_FIRSTBUTTON	equ 0x00000010
POINTER_FLAG_SECONDBUTTON	equ 0x00000020
POINTER_FLAG_THIRDBUTTON	equ 0x00000040
POINTER_FLAG_FOURTHBUTTON	equ 0x00000080
POINTER_FLAG_FIFTHBUTTON	equ 0x00000100
POINTER_FLAG_PRIMARY		equ 0x00002000
POINTER_FLAG_CONFIDENCE		equ 0x00004000
POINTER_FLAG_CANCELED		equ 0x00008000
POINTER_FLAG_DOWN		equ 0x00010000
POINTER_FLAG_UPDATE		equ 0x00020000
POINTER_FLAG_UP			equ 0x00040000
POINTER_FLAG_WHEEL		equ 0x00080000
POINTER_FLAG_HWHEEL		equ 0x00100000
POINTER_FLAG_CAPTURECHANGED	equ 0x00200000
POINTER_FLAG_HASTRANSFORM	equ 0x00400000

POINTER_MOD_SHIFT	equ (0x0004)
POINTER_MOD_CTRL	equ (0x0008)

.enum POINTER_BUTTON_CHANGE_TYPE {
    POINTER_CHANGE_NONE,
    POINTER_CHANGE_FIRSTBUTTON_DOWN,
    POINTER_CHANGE_FIRSTBUTTON_UP,
    POINTER_CHANGE_SECONDBUTTON_DOWN,
    POINTER_CHANGE_SECONDBUTTON_UP,
    POINTER_CHANGE_THIRDBUTTON_DOWN,
    POINTER_CHANGE_THIRDBUTTON_UP,
    POINTER_CHANGE_FOURTHBUTTON_DOWN,
    POINTER_CHANGE_FOURTHBUTTON_UP,
    POINTER_CHANGE_FIFTHBUTTON_DOWN,
    POINTER_CHANGE_FIFTHBUTTON_UP,
    }

POINTER_INFO		STRUC
pointerType		POINTER_INPUT_TYPE ?
pointerId		UINT32 ?
frameId			UINT32 ?
pointerFlags		POINTER_FLAGS ?
sourceDevice		HANDLE ?
hwndTarget		HWND ?
ptPixelLocation		POINT <>
ptHimetricLocation	POINT <>
ptPixelLocationRaw	POINT <>
ptHimetricLocationRaw	POINT <>
dwTime			DWORD ?
historyCount		UINT32 ?
InputData		INT32 ?
dwKeyStates		DWORD ?
PerformanceCount	UINT64 ?
ButtonChangeType	POINTER_BUTTON_CHANGE_TYPE ?
POINTER_INFO		ENDS

TOUCH_FLAGS		typedef UINT32
TOUCH_FLAG_NONE		equ 0x00000000
TOUCH_MASK		typedef UINT32

TOUCH_MASK_NONE		equ 0x00000000
TOUCH_MASK_CONTACTAREA	equ 0x00000001
TOUCH_MASK_ORIENTATION	equ 0x00000002
TOUCH_MASK_PRESSURE	equ 0x00000004

POINTER_TOUCH_INFO	STRUC
pointerInfo		POINTER_INFO <>
touchFlags		TOUCH_FLAGS ?
touchMask		TOUCH_MASK ?
rcContact		RECT <>
rcContactRaw		RECT <>
orientation		UINT32 ?
pressure		UINT32 ?
POINTER_TOUCH_INFO	ENDS

PEN_FLAGS		typedef UINT32
PEN_FLAG_NONE		equ 0x00000000
PEN_FLAG_BARREL		equ 0x00000001
PEN_FLAG_INVERTED	equ 0x00000002
PEN_FLAG_ERASER		equ 0x00000004

PEN_MASK		typedef UINT32
PEN_MASK_NONE		equ 0x00000000
PEN_MASK_PRESSURE	equ 0x00000001
PEN_MASK_ROTATION	equ 0x00000002
PEN_MASK_TILT_X		equ 0x00000004
PEN_MASK_TILT_Y		equ 0x00000008

POINTER_PEN_INFO	STRUC
pointerInfo		POINTER_INFO <>
penFlags		PEN_FLAGS ?
penMask			PEN_MASK ?
pressure		UINT32 ?
rotation		UINT32 ?
tiltX			INT32 ?
tiltY			INT32 ?
POINTER_PEN_INFO	ENDS

POINTER_MESSAGE_FLAG_NEW		equ 0x00000001
POINTER_MESSAGE_FLAG_INRANGE		equ 0x00000002
POINTER_MESSAGE_FLAG_INCONTACT		equ 0x00000004
POINTER_MESSAGE_FLAG_FIRSTBUTTON	equ 0x00000010
POINTER_MESSAGE_FLAG_SECONDBUTTON	equ 0x00000020
POINTER_MESSAGE_FLAG_THIRDBUTTON	equ 0x00000040
POINTER_MESSAGE_FLAG_FOURTHBUTTON	equ 0x00000080
POINTER_MESSAGE_FLAG_FIFTHBUTTON	equ 0x00000100
POINTER_MESSAGE_FLAG_PRIMARY		equ 0x00002000
POINTER_MESSAGE_FLAG_CONFIDENCE		equ 0x00004000
POINTER_MESSAGE_FLAG_CANCELED		equ 0x00008000

PA_ACTIVATE		equ MA_ACTIVATE
PA_NOACTIVATE		equ MA_NOACTIVATE

MAX_TOUCH_COUNT		equ 256

TOUCH_FEEDBACK_DEFAULT	equ 0x1
TOUCH_FEEDBACK_INDIRECT equ 0x2
TOUCH_FEEDBACK_NONE	equ 0x3

InitializeTouchInjection proto WINAPI :UINT32, :DWORD
InjectTouchInput proto WINAPI :UINT32, :ptr POINTER_TOUCH_INFO

GetPointerType proto WINAPI :UINT32, :ptr POINTER_INPUT_TYPE
GetPointerCursorId proto WINAPI :UINT32, :ptr UINT32
GetPointerInfo proto WINAPI :UINT32, :ptr POINTER_INFO
GetPointerInfoHistory proto WINAPI :UINT32, :ptr UINT32, :ptr POINTER_INFO
GetPointerFrameInfo proto WINAPI :UINT32, :ptr UINT32, :ptr POINTER_INFO
GetPointerFrameInfoHistory proto WINAPI :UINT32, :ptr UINT32, :ptr UINT32, :ptr POINTER_INFO
GetPointerTouchInfo proto WINAPI :UINT32, :ptr POINTER_TOUCH_INFO
GetPointerTouchInfoHistory proto WINAPI :UINT32, :ptr UINT32, :ptr POINTER_TOUCH_INFO
GetPointerFrameTouchInfo proto WINAPI :UINT32, :ptr UINT32, :ptr POINTER_TOUCH_INFO
GetPointerFrameTouchInfoHistory proto WINAPI :UINT32, :ptr UINT32, :ptr UINT32, :ptr POINTER_TOUCH_INFO
GetPointerPenInfo proto WINAPI :UINT32, :ptr POINTER_PEN_INFO
GetPointerPenInfoHistory proto WINAPI :UINT32, :ptr UINT32, :ptr POINTER_PEN_INFO
GetPointerFramePenInfo proto WINAPI :UINT32, :ptr UINT32, :ptr POINTER_PEN_INFO
GetPointerFramePenInfoHistory proto WINAPI :UINT32, :ptr UINT32, :ptr UINT32, :ptr POINTER_PEN_INFO
SkipPointerFrameMessages proto WINAPI :UINT32
RegisterPointerInputTarget proto WINAPI :HWND, :POINTER_INPUT_TYPE
UnregisterPointerInputTarget proto WINAPI :HWND, :POINTER_INPUT_TYPE

EnableMouseInPointer proto WINAPI :BOOL
IsMouseInPointerEnabled proto WINAPI

TOUCH_HIT_TESTING_DEFAULT equ 0x0
TOUCH_HIT_TESTING_CLIENT  equ 0x1
TOUCH_HIT_TESTING_NONE	  equ 0x2

RegisterTouchHitTestingWindow proto WINAPI :HWND, :ULONG

TOUCH_HIT_TESTING_PROXIMITY_EVALUATION STRUC
score			UINT16 ?
adjustedPoint		POINT <>
TOUCH_HIT_TESTING_PROXIMITY_EVALUATION ENDS
PTOUCH_HIT_TESTING_PROXIMITY_EVALUATION typedef ptr TOUCH_HIT_TESTING_PROXIMITY_EVALUATION

TOUCH_HIT_TESTING_INPUT STRUC
pointerId		UINT32 ?
point			POINT <>
boundingBox		RECT <>
nonOccludedBoundingBox	RECT <>
orientation		UINT32 ?
TOUCH_HIT_TESTING_INPUT ENDS
PTOUCH_HIT_TESTING_INPUT typedef ptr TOUCH_HIT_TESTING_INPUT

TOUCH_HIT_TESTING_PROXIMITY_CLOSEST  equ 0x0
TOUCH_HIT_TESTING_PROXIMITY_FARTHEST equ 0xFFF

EvaluateProximityToRect proto WINAPI :ptr, :ptr, :ptr
EvaluateProximityToPolygon proto WINAPI :UINT32, :ptr, :ptr, :ptr
PackTouchHitTestingProximityEvaluation proto WINAPI :ptr, :ptr

.enum FEEDBACK_TYPE {
    FEEDBACK_TOUCH_CONTACTVISUALIZATION = 1,
    FEEDBACK_PEN_BARRELVISUALIZATION	= 2,
    FEEDBACK_PEN_TAP			= 3,
    FEEDBACK_PEN_DOUBLETAP		= 4,
    FEEDBACK_PEN_PRESSANDHOLD		= 5,
    FEEDBACK_PEN_RIGHTTAP		= 6,
    FEEDBACK_TOUCH_TAP			= 7,
    FEEDBACK_TOUCH_DOUBLETAP		= 8,
    FEEDBACK_TOUCH_PRESSANDHOLD		= 9,
    FEEDBACK_TOUCH_RIGHTTAP		= 10,
    FEEDBACK_GESTURE_PRESSANDTAP	= 11,
    FEEDBACK_MAX			= 0xFFFFFFFF
    }


GWFS_INCLUDE_ANCESTORS equ 0x00000001

GetWindowFeedbackSetting proto WINAPI :HWND, :FEEDBACK_TYPE, :DWORD, :ptr UINT32, : ptr
SetWindowFeedbackSetting proto WINAPI :HWND, :FEEDBACK_TYPE, :DWORD, :UINT32, :ptr

endif

if(WINVER GE 0x0603)

INPUT_TRANSFORM		STRUC
UNION
 STRUC
  _11			real4 ?
  _12			real4 ?
  _13			real4 ?
  _14			real4 ?
  _21			real4 ?
  _22			real4 ?
  _23			real4 ?
  _24			real4 ?
  _31			real4 ?
  _32			real4 ?
  _33			real4 ?
  _34			real4 ?
  _41			real4 ?
  _42			real4 ?
  _43			real4 ?
  _44			real4 ?
 ENDS
 m			real4 4*4 dup(?)
ENDS
INPUT_TRANSFORM		ENDS

GetPointerInputTransform proto WINAPI :UINT32, :UINT32, :ptr INPUT_TRANSFORM

endif

if(_WIN32_WINNT GE 0x0500)
LASTINPUTINFO		STRUC
cbSize			UINT ?
dwTime			dd ?
LASTINPUTINFO		ENDS
PLASTINPUTINFO		typedef ptr LASTINPUTINFO

GetLastInputInfo proto WINAPI :PLASTINPUTINFO
endif

MapVirtualKeyA proto WINAPI :UINT, :UINT
MapVirtualKeyW proto WINAPI :UINT, :UINT
ifdef _UNICODE
MapVirtualKey equ <MapVirtualKeyW>
else
MapVirtualKey equ <MapVirtualKeyA>
endif

if(WINVER GE 0x0400)
MapVirtualKeyExA proto WINAPI :UINT, :UINT, :HKL
MapVirtualKeyExW proto WINAPI :UINT, :UINT, :HKL
ifdef _UNICODE
MapVirtualKeyEx equ <MapVirtualKeyExW>
else
MapVirtualKeyEx equ <MapVirtualKeyExA>
endif
endif

MAPVK_VK_TO_VSC		equ 0
MAPVK_VSC_TO_VK		equ 1
MAPVK_VK_TO_CHAR	equ 2
MAPVK_VSC_TO_VK_EX	equ 3
if(WINVER GE 0x0600)
MAPVK_VK_TO_VSC_EX	equ 4
endif

GetInputState proto WINAPI
GetQueueStatus proto WINAPI :UINT
GetCapture proto WINAPI
SetCapture proto WINAPI :HWND
ReleaseCapture proto WINAPI
MsgWaitForMultipleObjects proto WINAPI :DWORD, :LPHANDLE, :BOOL, :DWORD, :DWORD
MsgWaitForMultipleObjectsEx proto WINAPI :DWORD, :LPHANDLE, :DWORD, :DWORD, :DWORD

MWMO_WAITALL		equ 0x0001
MWMO_ALERTABLE		equ 0x0002
MWMO_INPUTAVAILABLE	equ 0x0004

QS_KEY			equ 0x0001
QS_MOUSEMOVE		equ 0x0002
QS_MOUSEBUTTON		equ 0x0004
QS_POSTMESSAGE		equ 0x0008
QS_TIMER		equ 0x0010
QS_PAINT		equ 0x0020
QS_SENDMESSAGE		equ 0x0040
QS_HOTKEY		equ 0x0080
QS_ALLPOSTMESSAGE	equ 0x0100
if(_WIN32_WINNT GE 0x0501)
QS_RAWINPUT		equ 0x0400
endif
if(_WIN32_WINNT GE 0x0602)
QS_TOUCH		equ 0x0800
QS_POINTER		equ 0x1000
endif
QS_MOUSE		equ QS_MOUSEMOVE OR QS_MOUSEBUTTON
if (_WIN32_WINNT GE 0x602)
QS_INPUT		equ (QS_MOUSE OR QS_KEY OR QS_RAWINPUT OR QS_TOUCH OR QS_POINTER)
elseif (_WIN32_WINNT GE 0x0501)
QS_INPUT		equ QS_MOUSE or QS_KEY or QS_RAWINPUT
else
QS_INPUT		equ QS_MOUSE or QS_KEY
endif
QS_ALLEVENTS		equ QS_INPUT OR QS_POSTMESSAGE OR QS_TIMER OR QS_PAINT OR QS_HOTKEY
QS_ALLINPUT		equ QS_INPUT OR QS_POSTMESSAGE OR QS_TIMER OR QS_PAINT OR QS_HOTKEY OR QS_SENDMESSAGE

USER_TIMER_MAXIMUM	equ 0x7FFFFFFF
USER_TIMER_MINIMUM	equ 0x0000000A

SetTimer proto WINAPI :HWND, :UINT_PTR, :UINT, :TIMERPROC

if(WINVER GE 0x0601)

TIMERV_DEFAULT_COALESCING   equ (0)
TIMERV_NO_COALESCING	    equ (0xFFFFFFFF)

TIMERV_COALESCING_MIN	    equ (1)
TIMERV_COALESCING_MAX	    equ (0x7FFFFFF5)

SetCoalescableTimer proto WINAPI :HWND, :UINT_PTR, :UINT, :TIMERPROC, :ULONG

endif

KillTimer proto WINAPI :HWND, :UINT_PTR
IsWindowUnicode proto WINAPI :HWND
EnableWindow proto WINAPI :HWND, :BOOL
IsWindowEnabled proto WINAPI :HWND

LoadAcceleratorsA proto WINAPI :HINSTANCE, :LPCSTR
LoadAcceleratorsW proto WINAPI :HINSTANCE, :LPCWSTR
ifdef _UNICODE
LoadAccelerators equ <LoadAcceleratorsW>
else
LoadAccelerators equ <LoadAcceleratorsA>
endif

CreateAcceleratorTableA proto WINAPI :LPACCEL, :SINT
CreateAcceleratorTableW proto WINAPI :LPACCEL, :SINT
ifdef _UNICODE
CreateAcceleratorTable equ <CreateAcceleratorTableW>
else
CreateAcceleratorTable equ <CreateAcceleratorTableA>
endif

DestroyAcceleratorTable proto WINAPI :HACCEL
CopyAcceleratorTableA proto WINAPI :HACCEL, :LPACCEL, :SINT
CopyAcceleratorTableW proto WINAPI :HACCEL, :LPACCEL, :SINT
ifdef _UNICODE
CopyAcceleratorTable equ <CopyAcceleratorTableW>
else
CopyAcceleratorTable equ <CopyAcceleratorTableA>
endif

ifndef NOMSG

TranslateAcceleratorA proto WINAPI :HWND, :HACCEL, :LPMSG
TranslateAcceleratorW proto WINAPI :HWND, :HACCEL, :LPMSG
ifdef _UNICODE
TranslateAccelerator equ <TranslateAcceleratorW>
else
TranslateAccelerator equ <TranslateAcceleratorA>
endif

endif ; NOMSG

ifndef NOSYSMETRICS

SM_CXSCREEN		equ 0
SM_CYSCREEN		equ 1
SM_CXVSCROLL		equ 2
SM_CYHSCROLL		equ 3
SM_CYCAPTION		equ 4
SM_CXBORDER		equ 5
SM_CYBORDER		equ 6
SM_CXDLGFRAME		equ 7
SM_CYDLGFRAME		equ 8
SM_CYVTHUMB		equ 9
SM_CXHTHUMB		equ 10
SM_CXICON		equ 11
SM_CYICON		equ 12
SM_CXCURSOR		equ 13
SM_CYCURSOR		equ 14
SM_CYMENU		equ 15
SM_CXFULLSCREEN		equ 16
SM_CYFULLSCREEN		equ 17
SM_CYKANJIWINDOW	equ 18
SM_MOUSEPRESENT		equ 19
SM_CYVSCROLL		equ 20
SM_CXHSCROLL		equ 21
SM_DEBUG		equ 22
SM_SWAPBUTTON		equ 23
SM_RESERVED1		equ 24
SM_RESERVED2		equ 25
SM_RESERVED3		equ 26
SM_RESERVED4		equ 27
SM_CXMIN		equ 28
SM_CYMIN		equ 29
SM_CXSIZE		equ 30
SM_CYSIZE		equ 31
SM_CXFRAME		equ 32
SM_CYFRAME		equ 33
SM_CXMINTRACK		equ 34
SM_CYMINTRACK		equ 35
SM_CXDOUBLECLK		equ 36
SM_CYDOUBLECLK		equ 37
SM_CXICONSPACING	equ 38
SM_CYICONSPACING	equ 39
SM_MENUDROPALIGNMENT	equ 40
SM_PENWINDOWS		equ 41
SM_DBCSENABLED		equ 42
SM_CMOUSEBUTTONS	equ 43

if(WINVER GE 0x0400)
SM_CXFIXEDFRAME		equ SM_CXDGFRAME
SM_CYFIXEDFRAME		equ SM_CYDGFRAME
SM_CXSIZEFRAME		equ SM_CXFRAME
SM_CYSIZEFRAME		equ SM_CYFRAME
SM_SECURE		equ 44
SM_CXEDGE		equ 45
SM_CYEDGE		equ 46
SM_CXMINSPACING		equ 47
SM_CYMINSPACING		equ 48
SM_CXSMICON		equ 49
SM_CYSMICON		equ 50
SM_CYSMCAPTION		equ 51
SM_CXSMSIZE		equ 52
SM_CYSMSIZE		equ 53
SM_CXMENUSIZE		equ 54
SM_CYMENUSIZE		equ 55
SM_ARRANGE		equ 56
SM_CXMINIMIZED		equ 57
SM_CYMINIMIZED		equ 58
SM_CXMAXTRACK		equ 59
SM_CYMAXTRACK		equ 60
SM_CXMAXIMIZED		equ 61
SM_CYMAXIMIZED		equ 62
SM_NETWORK		equ 63
SM_CLEANBOOT		equ 67
SM_CXDRAG		equ 68
SM_CYDRAG		equ 69
endif
SM_SHOWSOUNDS		equ 70
if(WINVER GE 0x0400)
SM_CXMENUCHECK		equ 71
SM_CYMENUCHECK		equ 72
SM_SLOWMACHINE		equ 73
SM_MIDEASTENABLED	equ 74
endif
if (WINVER GE 0x0500) OR (_WIN32_WINNT GE 0x0400)
SM_MOUSEWHEELPRESENT	equ 75
endif
if(WINVER GE 0x0500)
SM_XVIRTUALSCREEN	equ 76
SM_YVIRTUALSCREEN	equ 77
SM_CXVIRTUALSCREEN	equ 78
SM_CYVIRTUALSCREEN	equ 79
SM_CMONITORS		equ 80
SM_SAMEDISPLAYFORMAT	equ 81
endif
if(_WIN32_WINNT GE 0x0500)
SM_IMMENABLED		equ 82
endif

if(_WIN32_WINNT GE 0x0501)
SM_CXFOCUSBORDER	equ 83
SM_CYFOCUSBORDER	equ 84
endif

if(_WIN32_WINNT GE 0x0501)
SM_TABLETPC		equ 86
SM_MEDIACENTER		equ 87
SM_STARTER		equ 88
SM_SERVERR2		equ 89
endif

if(_WIN32_WINNT GE 0x0600)
SM_MOUSEHORIZONTALWHEELPRESENT equ 91
SM_CXPADDEDBORDER	equ 92
endif

if(WINVER GE 0x0601)
SM_DIGITIZER		equ 94
SM_MAXIMUMTOUCHES	equ 95
endif

if (WINVER LT 0x0500) AND ( NOT defined(_WIN32_WINNT) OR (_WIN32_WINNT LT 0x0400))
SM_CMETRICS		equ 76
elseif WINVER EQ 0x500
SM_CMETRICS		equ 83
elseif WINVER EQ 0x501
SM_CMETRICS		equ 91
elseif WINVER EQ 0x600
SM_CMETRICS		equ 93
else
SM_CMETRICS		equ 97
endif

if(WINVER GE 0x0500)
SM_REMOTESESSION	equ 0x1000
if(_WIN32_WINNT GE 0x0501)
SM_SHUTTINGDOWN		equ 0x2000
endif
if(WINVER GE 0x0501)
SM_REMOTECONTROL	equ 0x2001
endif
if(WINVER GE 0x0501)
SM_CARETBLINKINGENABLED equ 0x2002
endif
if(WINVER GE 0x0602)
SM_CONVERTIBLESLATEMODE equ 0x2003
SM_SYSTEMDOCKED		equ 0x2004
endif

endif

GetSystemMetrics proto WINAPI :SINT

endif ; NOSYSMETRICS

ifndef NOMENUS

LoadMenuA proto WINAPI :HINSTANCE, :LPCSTR
LoadMenuW proto WINAPI :HINSTANCE, :LPCWSTR
ifdef _UNICODE
LoadMenu equ <LoadMenuW>
else
LoadMenu equ <LoadMenuA>
endif
LoadMenuIndirectA proto WINAPI :ptr MENUTEMPLATEA
LoadMenuIndirectW proto WINAPI :ptr MENUTEMPLATEA
ifdef _UNICODE
LoadMenuIndirect equ <LoadMenuIndirectW>
else
LoadMenuIndirect equ <LoadMenuIndirectA>
endif

GetMenu proto WINAPI :HWND
SetMenu proto WINAPI :HWND, :HMENU

ChangeMenuA proto WINAPI :HMENU, :UINT, :LPCSTR, :UINT, :UINT
ChangeMenuW proto WINAPI :HMENU, :UINT, :LPCWSTR, :UINT, :UINT
ifdef _UNICODE
ChangeMenu equ <ChangeMenuW>
else
ChangeMenu equ <ChangeMenuA>
endif

HiliteMenuItem proto WINAPI :HWND, :HMENU, :UINT, :UINT

GetMenuStringA proto WINAPI :HMENU, :UINT, :LPSTR, :SINT, :UINT
GetMenuStringW proto WINAPI :HMENU, :UINT, :LPWSTR, :SINT, :UINT
ifdef _UNICODE
GetMenuString equ <GetMenuStringW>
else
GetMenuString equ <GetMenuStringA>
endif

GetMenuState proto WINAPI :HMENU, :UINT, :UINT
DrawMenuBar proto WINAPI :HWND

if(_WIN32_WINNT GE 0x0501)
PMB_ACTIVE		equ 0x00000001
endif
GetSystemMenu proto WINAPI :HWND, :BOOL
CreateMenu proto WINAPI
CreatePopupMenu proto WINAPI
DestroyMenu proto WINAPI :HMENU
CheckMenuItem proto WINAPI :HMENU, :UINT, :UINT
EnableMenuItem proto WINAPI :HMENU, :UINT, :UINT
GetSubMenu proto WINAPI :HMENU, :SINT
GetMenuItemID proto WINAPI :HMENU, :SINT
GetMenuItemCount proto WINAPI :HMENU
InsertMenuA proto WINAPI :HMENU, :UINT, :UINT, :UINT_PTR, :LPCSTR
InsertMenuW proto WINAPI :HMENU, :UINT, :UINT, :UINT_PTR, :LPCWSTR
ifdef _UNICODE
InsertMenu equ <InsertMenuW>
else
InsertMenu equ <InsertMenuA>
endif

AppendMenuA proto WINAPI :HMENU, :UINT, :UINT_PTR, :LPCSTR
AppendMenuW proto WINAPI :HMENU, :UINT, :UINT_PTR, :LPCWSTR
ifdef _UNICODE
AppendMenu equ <AppendMenuW>
else
AppendMenu equ <AppendMenuA>
endif

ModifyMenuA proto WINAPI :HMENU, :UINT, :UINT, :UINT_PTR, :LPCSTR
ModifyMenuW proto WINAPI :HMENU, :UINT, :UINT, :UINT_PTR, :LPCWSTR
ifdef _UNICODE
ModifyMenu equ <ModifyMenuW>
else
ModifyMenu equ <ModifyMenuA>
endif

RemoveMenu proto WINAPI :HMENU, :UINT, :UINT
DeleteMenu proto WINAPI :HMENU, :UINT, :UINT
SetMenuItemBitmaps proto WINAPI :HMENU, :UINT, :UINT, :HBITMAP,:HBITMAP
GetMenuCheckMarkDimensions proto WINAPI
TrackPopupMenu proto WINAPI :HMENU, :UINT, :SINT, :SINT, :SINT, :HWND, :LPRECT

if(WINVER GE 0x0400)
MNC_IGNORE		equ 0
MNC_CLOSE		equ 1
MNC_EXECUTE		equ 2
MNC_SELECT		equ 3

TPMPARAMS		STRUC
cbSize			UINT ?
rcExclude		RECT <>
TPMPARAMS		ENDS
LPTPMPARAMS		typedef ptr TPMPARAMS

TrackPopupMenuEx proto WINAPI :HMENU, :UINT, :SINT, :SINT, :HWND, :LPTPMPARAMS
endif

if(_WIN32_WINNT GE 0x0601)
CalculatePopupWindowPosition proto WINAPI :ptr POINT, :ptr POINT, :UINT, :ptr RECT, :ptr RECT
endif

if(WINVER GE 0x0500)
MNS_NOCHECK		equ 0x80000000
MNS_MODELESS		equ 0x40000000
MNS_DRAGDROP		equ 0x20000000
MNS_AUTODISMISS		equ 0x10000000
MNS_NOTIFYBYPOS		equ 0x08000000
MNS_CHECKORBMP		equ 0x04000000

MIM_MAXHEIGHT		equ 0x00000001
MIM_BACKGROUND		equ 0x00000002
MIM_HELPID		equ 0x00000004
MIM_MENUDATA		equ 0x00000008
MIM_STYLE		equ 0x00000010
MIM_APPLYTOSUBMENUS	equ 0x80000000

MENUINFO		STRUC
cbSize			dd ?
fMask			dd ?
dwStyle			dd ?
cyMax			UINT ?
hbrBack			HBRUSH ?
dwContextHelpID		dd ?
dwMenuData		ULONG_PTR ?
MENUINFO		ENDS
LPMENUINFO		typedef ptr MENUINFO
LPCMENUINFO		typedef ptr MENUINFO

GetMenuInfo proto WINAPI :HMENU, :LPMENUINFO
SetMenuInfo proto WINAPI :HMENU, :LPCMENUINFO

EndMenu proto WINAPI

MND_CONTINUE		equ 0
MND_ENDMENU		equ 1

MENUGETOBJECTINFO	STRUC
dwFlags			dd ?
uPos			UINT ?
hmenu			HMENU ?
riid			PVOID ?
pvObj			PVOID ?
MENUGETOBJECTINFO	ENDS
PMENUGETOBJECTINFO	typedef ptr MENUGETOBJECTINFO

MNGOF_GAP		equ 0x00000003

MNGO_NOINTERFACE	equ 0x00000000
MNGO_NOERROR		equ 0x00000001
endif

if(WINVER GE 0x0400)
MIIM_STATE		equ 0x00000001
MIIM_ID			equ 0x00000002
MIIM_SUBMENU		equ 0x00000004
MIIM_CHECKMARKS		equ 0x00000008
MIIM_TYPE		equ 0x00000010
MIIM_DATA		equ 0x00000020
endif

if(WINVER GE 0x0500)
MIIM_STRING		equ 0x00000040
MIIM_BITMAP		equ 0x00000080
MIIM_FTYPE		equ 0x00000100

HBMMENU_CALLBACK	equ (-1)
HBMMENU_SYSTEM		equ (1)
HBMMENU_MBAR_RESTORE	equ (2)
HBMMENU_MBAR_MINIMIZE	equ (3)
HBMMENU_MBAR_CLOSE	equ (5)
HBMMENU_MBAR_CLOSE_D	equ (6)
HBMMENU_MBAR_MINIMIZE_D equ (7)
HBMMENU_POPUP_CLOSE	equ (8)
HBMMENU_POPUP_RESTORE	equ (9)
HBMMENU_POPUP_MAXIMIZE	equ (10)
HBMMENU_POPUP_MINIMIZE	equ (11)
endif

if(WINVER GE 0x0400)
MENUITEMINFOA		STRUC
cbSize			UINT ?
fMask			UINT ?
fType			UINT ?
fState			UINT ?
wID			UINT ?
hSubMenu		HMENU ?
hbmpChecked		HBITMAP ?
hbmpUnchecked		HBITMAP ?
dwItemData		ULONG_PTR ?
dwTypeData		LPSTR ?
cch			UINT ?
if (_WIN32_WINNT GE 0x0500)
hbmpItem		HBITMAP ?
endif
MENUITEMINFOA		ENDS
LPMENUITEMINFOA		typedef ptr MENUITEMINFOA
MENUITEMINFOW		STRUC
cbSize			UINT ?
fMask			UINT ?
fType			UINT ?
fState			UINT ?
wID			UINT ?
hSubMenu		HMENU ?
hbmpChecked		HBITMAP ?
hbmpUnchecked		HBITMAP ?
dwItemData		ULONG_PTR ?
dwTypeData		LPWSTR ?
cch			UINT ?
if (_WIN32_WINNT GE 0x0500)
hbmpItem		HBITMAP ?
endif
MENUITEMINFOW		ENDS
LPMENUITEMINFOW		typedef ptr MENUITEMINFOW
ifdef _UNICODE
MENUITEMINFO		typedef MENUITEMINFOW
LPMENUITEMINFO		typedef LPMENUITEMINFOW
else
MENUITEMINFO		typedef MENUITEMINFOA
LPMENUITEMINFO		typedef LPMENUITEMINFOA
endif
LPCMENUITEMINFOA	typedef ptr MENUITEMINFOA
LPCMENUITEMINFOW	typedef ptr MENUITEMINFOW
ifdef _UNICODE
LPCMENUITEMINFO		typedef LPCMENUITEMINFOW
else
LPCMENUITEMINFO		typedef LPCMENUITEMINFOA
endif

InsertMenuItemA proto WINAPI :HMENU, :UINT, :BOOL, :LPCMENUITEMINFOA
InsertMenuItemW proto WINAPI :HMENU, :UINT, :BOOL, :LPCMENUITEMINFOW
ifdef _UNICODE
InsertMenuItem equ <InsertMenuItemW>
else
InsertMenuItem equ <InsertMenuItemA>
endif

GetMenuItemInfoA proto WINAPI :HMENU, :UINT, :BOOL, :LPMENUITEMINFOA
GetMenuItemInfoW proto WINAPI :HMENU, :UINT, :BOOL, :LPMENUITEMINFOW
ifdef _UNICODE
GetMenuItemInfo equ <GetMenuItemInfoW>
else
GetMenuItemInfo equ <GetMenuItemInfoA>
endif

SetMenuItemInfoA proto WINAPI :HMENU, :UINT, :BOOL, :LPCMENUITEMINFOA
SetMenuItemInfoW proto WINAPI :HMENU, :UINT, :BOOL, :LPCMENUITEMINFOW
ifdef _UNICODE
SetMenuItemInfo equ <SetMenuItemInfoW>
else
SetMenuItemInfo equ <SetMenuItemInfoA>
endif

GMDI_USEDISABLED	equ 0x0001
GMDI_GOINTOPOPUPS	equ 0x0002

GetMenuDefaultItem proto WINAPI :HMENU, :UINT, :UINT
SetMenuDefaultItem proto WINAPI :HMENU, :UINT, :UINT
GetMenuItemRect proto WINAPI :HWND,:HMENU, :UINT, :LPRECT
MenuItemFromPoint proto WINAPI :HWND, :HMENU, :POINT
endif

TPM_LEFTBUTTON		equ 0x0000
TPM_RIGHTBUTTON		equ 0x0002
TPM_LEFTALIGN		equ 0x0000
TPM_CENTERALIGN		equ 0x0004
TPM_RIGHTALIGN		equ 0x0008
if(WINVER GE 0x0400)
TPM_TOPALIGN		equ 0x0000
TPM_VCENTERALIGN	equ 0x0010
TPM_BOTTOMALIGN		equ 0x0020

TPM_HORIZONTAL		equ 0x0000
TPM_VERTICAL		equ 0x0040
TPM_NONOTIFY		equ 0x0080
TPM_RETURNCMD		equ 0x0100
endif
if(WINVER GE 0x0500)
TPM_RECURSE		equ 0x0001
TPM_HORPOSANIMATION	equ 0x0400
TPM_HORNEGANIMATION	equ 0x0800
TPM_VERPOSANIMATION	equ 0x1000
TPM_VERNEGANIMATION	equ 0x2000
if(_WIN32_WINNT GE 0x0500)
TPM_NOANIMATION		equ 0x4000
endif
if(_WIN32_WINNT GE 0x0501)
TPM_LAYOUTRTL		equ 0x8000
endif
endif
if(_WIN32_WINNT GE 0x0601)
TPM_WORKAREA		equ 0x10000
endif
endif

endif

if(WINVER GE 0x0400)

DROPSTRUCT		STRUC
hwndSource		HWND ?
hwndSink		HWND ?
wFmt			dd ?
dwData			ULONG_PTR ?
ptDrop			POINT <>
dwControlData		dd ?
DROPSTRUCT		ENDS
PDROPSTRUCT		typedef ptr DROPSTRUCT
LPDROPSTRUCT		typedef ptr DROPSTRUCT

DOF_EXECUTABLE		equ 0x8001
DOF_DOCUMENT		equ 0x8002
DOF_DIRECTORY		equ 0x8003
DOF_MULTIPLE		equ 0x8004
DOF_PROGMAN		equ 0x0001
DOF_SHELLDATA		equ 0x0002

DO_DROPFILE		equ 0x454C4946
DO_PRINTFILE		equ 0x544E5250

DragObject proto WINAPI :HWND, :HWND, :UINT, :ULONG_PTR, :HCURSOR
DragDetect proto WINAPI :HWND, :POINT
endif
DrawIcon proto WINAPI :HDC, :SINT, :SINT, :HICON

ifndef NODRAWTEXT

DT_TOP			equ 0x00000000
DT_LEFT			equ 0x00000000
DT_CENTER		equ 0x00000001
DT_RIGHT		equ 0x00000002
DT_VCENTER		equ 0x00000004
DT_BOTTOM		equ 0x00000008
DT_WORDBREAK		equ 0x00000010
DT_SINGLELINE		equ 0x00000020
DT_EXPANDTABS		equ 0x00000040
DT_TABSTOP		equ 0x00000080
DT_NOCLIP		equ 0x00000100
DT_EXTERNALLEADING	equ 0x00000200
DT_CALCRECT		equ 0x00000400
DT_NOPREFIX		equ 0x00000800
DT_INTERNAL		equ 0x00001000

if(WINVER GE 0x0400)
DT_EDITCONTROL		equ 0x00002000
DT_PATH_ELLIPSIS	equ 0x00004000
DT_END_ELLIPSIS		equ 0x00008000
DT_MODIFYSTRING		equ 0x00010000
DT_RTLREADING		equ 0x00020000
DT_WORD_ELLIPSIS	equ 0x00040000
if(WINVER GE 0x0500)
DT_NOFULLWIDTHCHARBREAK equ 0x00080000
if(_WIN32_WINNT GE 0x0500)
DT_HIDEPREFIX		equ 0x00100000
DT_PREFIXONLY		equ 0x00200000
endif
endif

DRAWTEXTPARAMS		STRUC
cbSize			UINT ?
iTabLength		SINT ?
iLeftMargin		SINT ?
iRightMargin		SINT ?
uiLengthDrawn		UINT ?
DRAWTEXTPARAMS		ENDS
LPDRAWTEXTPARAMS	typedef ptr DRAWTEXTPARAMS
endif

DrawTextA proto WINAPI :HDC, :LPCSTR, :SINT, :LPRECT, :UINT
DrawTextW proto WINAPI :HDC, :LPCWSTR, :SINT, :LPRECT, :UINT
ifdef _UNICODE
DrawText equ <DrawTextW>
else
DrawText equ <DrawTextA>
endif


if(WINVER GE 0x0400)
DrawTextExA proto WINAPI :HDC, :LPSTR, :SINT, :LPRECT, :UINT, :LPDRAWTEXTPARAMS
DrawTextExW proto WINAPI :HDC, :LPWSTR, :SINT, :LPRECT, :UINT, :LPDRAWTEXTPARAMS
ifdef _UNICODE
DrawTextEx equ <DrawTextExW>
else
DrawTextEx equ <DrawTextExA>
endif
endif

endif

GrayStringA proto WINAPI :HDC, :HBRUSH, :GRAYSTRINGPROC, :LPARAM, :SINT, :SINT, :SINT, :SINT, :SINT
GrayStringW proto WINAPI :HDC, :HBRUSH, :GRAYSTRINGPROC, :LPARAM, :SINT, :SINT, :SINT, :SINT, :SINT
ifdef _UNICODE
GrayString equ <GrayStringW>
else
GrayString equ <GrayStringA>
endif

if(WINVER GE 0x0400)
DST_COMPLEX		equ 0x0000
DST_TEXT		equ 0x0001
DST_PREFIXTEXT		equ 0x0002
DST_ICON		equ 0x0003
DST_BITMAP		equ 0x0004

DSS_NORMAL		equ 0x0000
DSS_UNION		equ 0x0010
DSS_DISABLED		equ 0x0020
DSS_MONO		equ 0x0080
DSS_RIGHT		equ 0x8000
if(_WIN32_WINNT GE 0x0500)
DSS_HIDEPREFIX		equ 0x0200
DSS_PREFIXONLY		equ 0x0400
endif

DrawStateA proto WINAPI :HDC, :HBRUSH, :DRAWSTATEPROC, :LPARAM, :WPARAM, :SINT, :SINT, :SINT, :SINT, :UINT
DrawStateW proto WINAPI :HDC, :HBRUSH, :DRAWSTATEPROC, :LPARAM, :WPARAM, :SINT, :SINT, :SINT, :SINT, :UINT
ifdef _UNICODE
DrawState equ <DrawStateW>
else
DrawState equ <DrawStateA>
endif
endif

TabbedTextOutA proto WINAPI :HDC, :SINT, :SINT, :LPCSTR, :SINT, :SINT, :LPINT, :SINT
TabbedTextOutW proto WINAPI :HDC, :SINT, :SINT, :LPCWSTR, :SINT, :SINT,:LPINT, :SINT
ifdef _UNICODE
TabbedTextOut equ <TabbedTextOutW>
else
TabbedTextOut equ <TabbedTextOutA>
endif

GetTabbedTextExtentA proto WINAPI :HDC, :LPCSTR, :SINT, :SINT, :LPINT
GetTabbedTextExtentW proto WINAPI :HDC, :LPCWSTR, :SINT, :SINT, :LPINT
ifdef _UNICODE
GetTabbedTextExtent equ <GetTabbedTextExtentW>
else
GetTabbedTextExtent equ <GetTabbedTextExtentA>
endif

UpdateWindow proto WINAPI :HWND
SetActiveWindow proto WINAPI :HWND

if (_WIN32_WINNT GE 0x0500)
GetForegroundWindow	proto WINAPI
else
CALLBACK(GetForegroundWindow_T)
externdef GetForegroundWindow:GetForegroundWindow_T
endif
if(WINVER GE 0x0400)
PaintDesktop proto WINAPI :HDC
endif
SetForegroundWindow proto WINAPI :HWND

if(_WIN32_WINNT GE 0x0500)
AllowSetForegroundWindow proto WINAPI :DWORD

ASFW_ANY		equ (-1)

LockSetForegroundWindow proto WINAPI :UINT

LSFW_LOCK		equ 1
LSFW_UNLOCK		equ 2
endif

WindowFromDC proto WINAPI :HDC
GetDC proto WINAPI :HWND
GetDCEx proto WINAPI :HWND, :HRGN, :DWORD

DCX_WINDOW		equ 0x00000001
DCX_CACHE		equ 0x00000002
DCX_NORESETATTRS	equ 0x00000004
DCX_CLIPCHILDREN	equ 0x00000008
DCX_CLIPSIBLINGS	equ 0x00000010
DCX_PARENTCLIP		equ 0x00000020
DCX_EXCLUDERGN		equ 0x00000040
DCX_INTERSECTRGN	equ 0x00000080
DCX_EXCLUDEUPDATE	equ 0x00000100
DCX_INTERSECTUPDATE	equ 0x00000200
DCX_LOCKWINDOWUPDATE	equ 0x00000400
DCX_VALIDATE		equ 0x00200000

AlignRects proto WINAPI :LPRECT, :DWORD, :DWORD, :DWORD

CUDR_NORMAL		equ 0x0000
CUDR_NOSNAPTOGRID	equ 0x0001
CUDR_NORESOLVEPOSITIONS equ 0x0002
CUDR_NOCLOSEGAPS	equ 0x0004
CUDR_NEGATIVECOORDS	equ 0x0008
CUDR_NOPRIMARY		equ 0x0010

GetWindowDC proto WINAPI :HWND
ReleaseDC proto WINAPI :HWND, :HDC
BeginPaint proto WINAPI :HWND, :LPPAINTSTRUCT
EndPaint proto WINAPI :HWND, :ptr PAINTSTRUCT
GetUpdateRect proto WINAPI :HWND, :LPRECT, :BOOL
GetUpdateRgn proto WINAPI :HWND, :HRGN, :BOOL
SetWindowRgn proto WINAPI :HWND, :HRGN, :BOOL
GetWindowRgn proto WINAPI :HWND, :HRGN
if(_WIN32_WINNT GE 0x0501)
GetWindowRgnBox proto WINAPI :HWND, :LPRECT
endif
ExcludeUpdateRgn proto WINAPI :HDC, :HWND
InvalidateRect proto WINAPI :HWND, :LPRECT, :BOOL
ValidateRect proto WINAPI :HWND, :LPRECT
InvalidateRgn proto WINAPI :HWND, :HRGN, :BOOL
ValidateRgn proto WINAPI :HWND, :HRGN
RedrawWindow proto WINAPI :HWND, :LPRECT, :HRGN, :UINT

RDW_INVALIDATE		equ 0x0001
RDW_INTERNALPAINT	equ 0x0002
RDW_ERASE		equ 0x0004
RDW_VALIDATE		equ 0x0008
RDW_NOINTERNALPAINT	equ 0x0010
RDW_NOERASE		equ 0x0020
RDW_NOCHILDREN		equ 0x0040
RDW_ALLCHILDREN		equ 0x0080
RDW_UPDATENOW		equ 0x0100
RDW_ERASENOW		equ 0x0200
RDW_FRAME		equ 0x0400
RDW_NOFRAME		equ 0x0800

LockWindowUpdate proto WINAPI :HWND
ScrollWindow proto WINAPI :HWND, :SINT, :SINT, :LPRECT, :LPRECT
ScrollDC proto WINAPI :HDC, :SINT, :SINT, :LPRECT,:LPRECT, :HRGN, :LPRECT
ScrollWindowEx proto WINAPI :HWND, :SINT, :SINT, :LPRECT, :LPRECT, :HRGN, :LPRECT, :UINT

SW_SCROLLCHILDREN	equ 0x0001
SW_INVALIDATE		equ 0x0002
SW_ERASE		equ 0x0004
if(WINVER GE 0x0500)
SW_SMOOTHSCROLL		equ 0x0010
endif

ifndef NOSCROLL
SetScrollPos proto WINAPI :HWND, :SINT, :SINT, :BOOL
GetScrollPos proto WINAPI :HWND, :SINT
SetScrollRange proto WINAPI :HWND, :SINT, :SINT, :SINT, :BOOL
GetScrollRange proto WINAPI :HWND, :SINT, :LPINT, :LPINT
ShowScrollBar proto WINAPI :HWND, :SINT, :BOOL
EnableScrollBar proto WINAPI :HWND, :UINT, :UINT

ESB_ENABLE_BOTH		equ 0x0000
ESB_DISABLE_BOTH	equ 0x0003
ESB_DISABLE_LEFT	equ 0x0001
ESB_DISABLE_RIGHT	equ 0x0002
ESB_DISABLE_UP		equ 0x0001
ESB_DISABLE_DOWN	equ 0x0002
ESB_DISABLE_LTUP	equ ESB_DISABLE_LEFT
ESB_DISABLE_RTDN	equ ESB_DISABE_RIGHT
endif

SetPropA proto WINAPI :HWND, :LPCSTR, :HANDLE
SetPropW proto WINAPI :HWND, :LPCWSTR, :HANDLE
ifdef _UNICODE
SetProp equ <SetPropW>
else
SetProp equ <SetPropA>
endif

GetPropA proto WINAPI :HWND, :LPCSTR
GetPropW proto WINAPI :HWND, :LPCWSTR
ifdef _UNICODE
GetProp equ <GetPropW>
else
GetProp equ <GetPropA>
endif

RemovePropA proto WINAPI :HWND, :LPCSTR
RemovePropW proto WINAPI :HWND, :LPCWSTR
ifdef _UNICODE
RemoveProp equ <RemovePropW>
else
RemoveProp equ <RemovePropA>
endif

EnumPropsExA proto WINAPI :HWND, :PROPENUMPROCEXA, :LPARAM
EnumPropsExW proto WINAPI :HWND, :PROPENUMPROCEXW, :LPARAM
ifdef _UNICODE
EnumPropsEx equ <EnumPropsExW>
else
EnumPropsEx equ <EnumPropsExA>
endif

EnumPropsA proto WINAPI :HWND, :PROPENUMPROCA
EnumPropsW proto WINAPI :HWND, :PROPENUMPROCW
ifdef _UNICODE
EnumProps equ <EnumPropsW>
else
EnumProps equ <EnumPropsA>
endif

SetWindowTextA proto WINAPI :HWND, :LPCSTR
SetWindowTextW proto WINAPI :HWND, :LPCWSTR
ifdef _UNICODE
SetWindowText equ <SetWindowTextW>
else
SetWindowText equ <SetWindowTextA>
endif

GetWindowTextA proto WINAPI :HWND, :LPSTR, :SINT
GetWindowTextW proto WINAPI :HWND, :LPWSTR, :SINT
ifdef _UNICODE
GetWindowText		equ <GetWindowTextW>
else
GetWindowText		equ <GetWindowTextA>
endif

GetWindowTextLengthA proto WINAPI :HWND
GetWindowTextLengthW proto WINAPI :HWND
ifdef _UNICODE
GetWindowTextLength	equ <GetWindowTextLengthW>
else
GetWindowTextLength	equ <GetWindowTextLengthA>
endif

GetClientRect proto WINAPI :HWND, :LPRECT
GetWindowRect proto WINAPI :HWND, :LPRECT
AdjustWindowRect proto WINAPI :LPRECT, :DWORD, :BOOL
AdjustWindowRectEx proto WINAPI :LPRECT, :DWORD, :BOOL, :DWORD

if(WINVER GE 0x0400)
HELPINFO_WINDOW		equ 0x0001
HELPINFO_MENUITEM	equ 0x0002
HELPINFO		STRUC
cbSize			UINT ?
iContextType		SINT ?
iCtrlId			SINT ?
hItemHandle		HANDLE ?
dwContextId		dd ?
MousePos		POINT <>
HELPINFO		ENDS
LPHELPINFO		typedef ptr HELPINFO

SetWindowContextHelpId proto WINAPI :HWND, :DWORD
GetWindowContextHelpId proto WINAPI :HWND
SetMenuContextHelpId proto WINAPI :HMENU, :DWORD
GetMenuContextHelpId proto WINAPI :HMENU

endif

ifndef NOMB

MB_OK			equ 0x00000000
MB_OKCANCEL		equ 0x00000001
MB_ABORTRETRYIGNORE	equ 0x00000002
MB_YESNOCANCEL		equ 0x00000003
MB_YESNO		equ 0x00000004
MB_RETRYCANCEL		equ 0x00000005
if(WINVER GE 0x0500)
MB_CANCELTRYCONTINUE	equ 0x00000006
endif

MB_ICONHAND		equ 0x00000010
MB_ICONQUESTION		equ 0x00000020
MB_ICONEXCLAMATION	equ 0x00000030
MB_ICONASTERISK		equ 0x00000040

if(WINVER GE 0x0400)
MB_USERICON		equ 0x00000080
MB_ICONWARNING		equ MB_ICONEXCLAMATION
MB_ICONERROR		equ MB_ICONHAND
endif

MB_ICONINFORMATION	equ MB_ICONASTERISK
MB_ICONSTOP		equ MB_ICONHAND

MB_DEFBUTTON1		equ 0x00000000
MB_DEFBUTTON2		equ 0x00000100
MB_DEFBUTTON3		equ 0x00000200
if(WINVER GE 0x0400)
MB_DEFBUTTON4		equ 0x00000300
endif

MB_APPLMODAL		equ 0x00000000
MB_SYSTEMMODAL		equ 0x00001000
MB_TASKMODAL		equ 0x00002000
if(WINVER GE 0x0400)
MB_HELP			equ 0x00004000
endif

MB_NOFOCUS		equ 0x00008000
MB_SETFOREGROUND	equ 0x00010000
MB_DEFAULT_DESKTOP_ONLY equ 0x00020000

if(WINVER GE 0x0400)
MB_TOPMOST		equ 0x00040000
MB_RIGHT		equ 0x00080000
MB_RTLREADING		equ 0x00100000
endif

ifdef _WIN32_WINNT
if (_WIN32_WINNT GE 0x0400)
MB_SERVICE_NOTIFICATION equ 0x00200000
else
MB_SERVICE_NOTIFICATION equ 0x00040000
endif
MB_SERVICE_NOTIFICATION_NT3X equ 0x00040000
endif

MB_TYPEMASK		equ 0x0000000F
MB_ICONMASK		equ 0x000000F0
MB_DEFMASK		equ 0x00000F00
MB_MODEMASK		equ 0x00003000
MB_MISCMASK		equ 0x0000C000

MessageBoxA proto WINAPI :HWND, :LPCSTR, :LPCSTR, :UINT
MessageBoxW proto WINAPI :HWND, :LPCWSTR,:LPCWSTR, :UINT
ifdef _UNICODE
MessageBox		equ <MessageBoxW>
else
MessageBox		equ <MessageBoxA>
endif

MessageBoxExA proto WINAPI :HWND, :LPCSTR, :LPCSTR, :UINT, :WORD
MessageBoxExW proto WINAPI :HWND, :LPCWSTR, :LPCWSTR, :UINT, :WORD
ifdef _UNICODE
MessageBoxEx		equ <MessageBoxExW>
else
MessageBoxEx		equ <MessageBoxExA>
endif

if(WINVER GE 0x0400)

CALLBACK(MSGBOXCALLBACK, lpHelpInfo:LPHELPINFO)

MSGBOXPARAMSA		STRUC SIZE_T
cbSize			UINT ?
hwndOwner		HWND ?
hInstance		HINSTANCE ?
lpszText		LPCSTR ?
lpszCaption		LPCSTR ?
dwStyle			dd ?
lpszIcon		LPCSTR ?
dwContextHelpId		DWORD_PTR ?
lpfnMsgBoxCallback	MSGBOXCALLBACK ?
dwLanguageId		dd ?
MSGBOXPARAMSA		ENDS
PMSGBOXPARAMSA		typedef ptr MSGBOXPARAMSA
LPMSGBOXPARAMSA		typedef ptr MSGBOXPARAMSA

MSGBOXPARAMSW		STRUC SIZE_T
cbSize			UINT ?
hwndOwner		HWND ?
hInstance		HINSTANCE ?
lpszText		LPCWSTR ?
lpszCaption		LPCWSTR ?
dwStyle			dd ?
lpszIcon		LPCWSTR ?
dwContextHelpId		DWORD_PTR ?
lpfnMsgBoxCallback	MSGBOXCALLBACK ?
dwLanguageId		dd ?
MSGBOXPARAMSW		ENDS
PMSGBOXPARAMSW		typedef ptr MSGBOXPARAMSW
LPMSGBOXPARAMSW		typedef ptr MSGBOXPARAMSW
ifdef _UNICODE
MSGBOXPARAMS		typedef MSGBOXPARAMSW
PMSGBOXPARAMS		typedef PMSGBOXPARAMSW
LPMSGBOXPARAMS		typedef LPMSGBOXPARAMSW
else
MSGBOXPARAMS		typedef MSGBOXPARAMSA
PMSGBOXPARAMS		typedef PMSGBOXPARAMSA
LPMSGBOXPARAMS		typedef LPMSGBOXPARAMSA
endif

MessageBoxIndirectA proto WINAPI :LPMSGBOXPARAMSA
MessageBoxIndirectW proto WINAPI :LPMSGBOXPARAMSW
ifdef _UNICODE
MessageBoxIndirect	equ <MessageBoxIndirectW>
else
MessageBoxIndirect	equ <MessageBoxIndirectA>
endif
endif

MessageBeep proto WINAPI :UINT
endif

ShowCursor proto WINAPI :BOOL
SetCursorPos proto WINAPI :SINT, :SINT
if(WINVER GE 0x0600)
SetPhysicalCursorPos proto WINAPI :SINT, :SINT
endif
SetCursor proto WINAPI :HCURSOR
GetCursorPos proto WINAPI :LPPOINT
if(WINVER GE 0x0600)
GetPhysicalCursorPos proto WINAPI :LPPOINT
endif
ClipCursor proto WINAPI :LPRECT
GetClipCursor proto WINAPI :LPRECT
GetCursor proto WINAPI
CreateCaret proto WINAPI :HWND, :HBITMAP, :SINT, :SINT
GetCaretBlinkTime proto WINAPI
SetCaretBlinkTime proto WINAPI :UINT
DestroyCaret proto WINAPI
HideCaret proto WINAPI :HWND
ShowCaret proto WINAPI :HWND
SetCaretPos proto WINAPI :SINT, :SINT
GetCaretPos proto WINAPI :LPPOINT
ClientToScreen proto WINAPI :HWND, :LPPOINT
ScreenToClient proto WINAPI :HWND, :LPPOINT

if(WINVER GE 0x0600)
LogicalToPhysicalPoint proto WINAPI :HWND, :LPPOINT
PhysicalToLogicalPoint proto WINAPI :HWND, :LPPOINT
endif

if(WINVER GE 0x0603)
LogicalToPhysicalPointForPerMonitorDPI proto WINAPI :HWND, :LPPOINT
PhysicalToLogicalPointForPerMonitorDPI proto WINAPI :HWND, :LPPOINT
endif

MapWindowPoints proto WINAPI :HWND, :HWND, :LPPOINT, :UINT
WindowFromPoint proto WINAPI :POINT

if(WINVER GE 0x0600)
WindowFromPhysicalPoint proto WINAPI :POINT
endif
ChildWindowFromPoint proto WINAPI :HWND, :POINT

if(WINVER GE 0x0400)
CWP_ALL			equ 0x0000
CWP_SKIPINVISIBLE	equ 0x0001
CWP_SKIPDISABLED	equ 0x0002
CWP_SKIPTRANSPARENT	equ 0x0004

ChildWindowFromPointEx proto WINAPI :HWND, :POINT, :UINT
endif

ifndef NOCOLOR

CTLCOLOR_MSGBOX		equ 0
CTLCOLOR_EDIT		equ 1
CTLCOLOR_LISTBOX	equ 2
CTLCOLOR_BTN		equ 3
CTLCOLOR_DLG		equ 4
CTLCOLOR_SCROLLBAR	equ 5
CTLCOLOR_STATIC		equ 6
CTLCOLOR_MAX		equ 7

COLOR_SCROLLBAR		equ 0
COLOR_BACKGROUND	equ 1
COLOR_ACTIVECAPTION	equ 2
COLOR_INACTIVECAPTION	equ 3
COLOR_MENU		equ 4
COLOR_WINDOW		equ 5
COLOR_WINDOWFRAME	equ 6
COLOR_MENUTEXT		equ 7
COLOR_WINDOWTEXT	equ 8
COLOR_CAPTIONTEXT	equ 9
COLOR_ACTIVEBORDER	equ 10
COLOR_INACTIVEBORDER	equ 11
COLOR_APPWORKSPACE	equ 12
COLOR_HIGHLIGHT		equ 13
COLOR_HIGHLIGHTTEXT	equ 14
COLOR_BTNFACE		equ 15
COLOR_BTNSHADOW		equ 16
COLOR_GRAYTEXT		equ 17
COLOR_BTNTEXT		equ 18
COLOR_INACTIVECAPTIONTEXT equ 19
COLOR_BTNHIGHLIGHT	equ 20

if(WINVER GE 0x0400)
COLOR_3DDKSHADOW	equ 21
COLOR_3DLIGHT		equ 22
COLOR_INFOTEXT		equ 23
COLOR_INFOBK		equ 24
endif

if(WINVER GE 0x0500)
COLOR_HOTLIGHT		equ 26
COLOR_GRADIENTACTIVECAPTION equ 27
COLOR_GRADIENTINACTIVECAPTION equ 28
if(WINVER GE 0x0501)
COLOR_MENUHILIGHT	equ 29
COLOR_MENUBAR		equ 30
endif
endif

if(WINVER GE 0x0400)
COLOR_DESKTOP		equ COLOR_BACKGROUND
COLOR_3DFACE		equ COLOR_BTNFACE
COLOR_3DSHADOW		equ COLOR_BTNSHADOW
COLOR_3DHIGHLIGHT	equ COLOR_BTNHIGHLIGHT
COLOR_3DHILIGHT		equ COLOR_BTNHIGHLIGHT
COLOR_BTNHILIGHT	equ COLOR_BTNHIGHLIGHT
endif

GetSysColor proto WINAPI :SINT
if(WINVER GE 0x0400)
GetSysColorBrush proto WINAPI :SINT
endif
SetSysColors proto WINAPI :SINT, :ptr, :ptr COLORREF

endif

DrawFocusRect proto WINAPI :HDC, :LPRECT
FillRect proto WINAPI :HDC, :LPRECT, :HBRUSH
FrameRect proto WINAPI :HDC, :LPRECT, :HBRUSH
InvertRect proto WINAPI :HDC, :LPRECT
SetRect proto WINAPI :LPRECT, :SINT, :SINT, :SINT, :SINT
SetRectEmpty proto WINAPI :LPRECT
CopyRect proto WINAPI :LPRECT, :LPRECT
InflateRect proto WINAPI :LPRECT, :SINT, :SINT
IntersectRect proto WINAPI :LPRECT, :LPRECT, :LPRECT
UnionRect proto WINAPI :LPRECT, :LPRECT, :LPRECT
SubtractRect proto WINAPI :LPRECT, :LPRECT, :LPRECT
OffsetRect proto WINAPI :LPRECT, :SINT, :SINT
IsRectEmpty proto WINAPI :LPRECT
EqualRect proto WINAPI :LPRECT, :LPRECT
PtInRect proto WINAPI :LPRECT, :POINT

ifndef NOWINOFFSETS

GetWindowWord proto WINAPI :HWND, :SINT
SetWindowWord proto WINAPI :HWND, :SINT, :WORD
GetWindowLongA proto WINAPI :HWND, :SINT
GetWindowLongW proto WINAPI :HWND, :SINT
ifdef _UNICODE
GetWindowLong		equ <GetWindowLongW>
else
GetWindowLong		equ <GetWindowLongA>
endif

SetWindowLongA proto WINAPI :HWND, :SINT, :LONG
SetWindowLongW proto WINAPI :HWND, :SINT, :LONG
ifdef _UNICODE
SetWindowLong		equ <SetWindowLongW>
else
SetWindowLong		equ <SetWindowLongA>
endif

GetClassWord proto WINAPI :HWND, :SINT
SetClassWord proto WINAPI :HWND, :SINT, :WORD
GetClassLongA proto WINAPI :HWND, :SINT
GetClassLongW proto WINAPI :HWND, :SINT
ifdef _UNICODE
GetClassLong		equ <GetClassLongW>
else
GetClassLong		equ <GetClassLongA>
endif

SetClassLongA proto WINAPI :HWND, :SINT, :LONG
SetClassLongW proto WINAPI :HWND, :SINT, :LONG
ifdef _UNICODE
SetClassLong		equ <SetClassLongW>
else
SetClassLong		equ <SetClassLongA>
endif

endif

ifdef _WIN64

GetClassLongPtrA proto WINAPI :HWND, :SINT
GetClassLongPtrW proto WINAPI :HWND, :SINT
ifdef _UNICODE
define GetClassLongPtr	<GetClassLongPtrW>
else
define GetClassLongPtr	<GetClassLongPtrA>
endif

SetClassLongPtrA proto WINAPI :HWND, :SINT, :LONG_PTR
SetClassLongPtrW proto WINAPI :HWND, :SINT, :LONG_PTR
ifdef _UNICODE
define SetClassLongPtr	<SetClassLongPtrW>
else
define SetClassLongPtr	<SetClassLongPtrA>
endif

else

define GetClassLongPtrA <GetClassLongA>
define GetClassLongPtrW <GetClassLongW>
ifdef _UNICODE
define GetClassLongPtr	<GetClassLongPtrW>
else
define GetClassLongPtr	<GetClassLongPtrA>
endif

define SetClassLongPtrA <SetClassLongA>
define SetClassLongPtrW <SetClassLongW>
ifdef _UNICODE
define SetClassLongPtr	<SetClassLongPtrW>
else
define SetClassLongPtr	<SetClassLongPtrA>
endif

endif

ifdef _WIN64

GetWindowLongPtrA proto WINAPI :HWND, :SINT
GetWindowLongPtrW proto WINAPI :HWND, :SINT
ifdef _UNICODE
GetWindowLongPtr	equ <GetWindowLongPtrW>
else
GetWindowLongPtr	equ <GetWindowLongPtrA>
endif

SetWindowLongPtrA proto WINAPI :HWND, :SINT, :LONG_PTR
SetWindowLongPtrW proto WINAPI :HWND, :SINT, :LONG_PTR
ifdef _UNICODE
SetWindowLongPtr	equ <SetWindowLongPtrW>
else
SetWindowLongPtr	equ <SetWindowLongPtrA>
endif

else

GetWindowLongPtrA	equ <GetWindowLongA>
GetWindowLongPtrW	equ <GetWindowLongW>
ifdef _UNICODE
GetWindowLongPtr	equ <GetWindowLongPtrW>
else
GetWindowLongPtr	equ <GetWindowLongPtrA>
endif
SetWindowLongPtrA	equ <SetWindowLongA>
SetWindowLongPtrW	equ <SetWindowLongW>
ifdef _UNICODE
SetWindowLongPtr	equ <SetWindowLongPtrW>
else
SetWindowLongPtr	equ <SetWindowLongPtrA>
endif
endif

GetDesktopWindow proto WINAPI
GetParent proto WINAPI :HWND
SetParent proto WINAPI :HWND, :HWND
EnumChildWindows proto WINAPI :HWND, :WNDENUMPROC, :LPARAM

FindWindowA proto WINAPI :LPCSTR, :LPCSTR
FindWindowW proto WINAPI :LPCWSTR, :LPCWSTR
ifdef _UNICODE
FindWindow		equ <FindWindowW>
else
FindWindow		equ <FindWindowA>
endif

if(WINVER GE 0x0400)
FindWindowExA proto WINAPI :HWND, :HWND, :LPCSTR, :LPCSTR
FindWindowExW proto WINAPI :HWND, :HWND, :LPCWSTR, :LPCWSTR
ifdef _UNICODE
FindWindowEx		equ <FindWindowExW>
else
FindWindowEx		equ <FindWindowExA>
endif

GetShellWindow proto WINAPI
endif

RegisterShellHookWindow proto WINAPI :HWND
DeregisterShellHookWindow proto WINAPI :HWND
EnumWindows proto WINAPI :WNDENUMPROC, :LPARAM
EnumThreadWindows proto WINAPI :DWORD, :WNDENUMPROC, :LPARAM
EnumTaskWindows equ <EnumThreadWindows>

GetClassNameA proto WINAPI :HWND, :LPSTR, :SINT
GetClassNameW proto WINAPI :HWND, :LPWSTR, :SINT
ifdef _UNICODE
GetClassName		equ <GetClassNameW>
else
GetClassName		equ <GetClassNameA>
endif

GetTopWindow proto WINAPI :HWND

GetNextWindow macro hWnd, wCmd
	exitm<GetWindow(hWnd, wCmd)>
	endm
GetSysModalWindow macro
	exitm<(NULL)>
	endm
SetSysModalWindow macro hWnd
	exitm<(NULL)>
	endm

GetWindowThreadProcessId proto WINAPI :HWND, :LPDWORD

GetWindowTask macro hWnd
	exitm<GetWindowThreadProcessId(hWnd, NULL)>
	endm

GetLastActivePopup proto WINAPI :HWND

GW_HWNDFIRST		equ 0
GW_HWNDLAST		equ 1
GW_HWNDNEXT		equ 2
GW_HWNDPREV		equ 3
GW_OWNER		equ 4
GW_CHILD		equ 5
if (_WIN32_WINNT LE 0x0400)
GW_MAX			equ 5
else
GW_ENABLEDPOPUP		equ 6
GW_MAX			equ 6
endif

GetWindow proto WINAPI :HWND, :UINT

ifndef NOWH
ifdef STRICT

SetWindowsHookA proto WINAPI :SINT, :HOOKPROC
SetWindowsHookW proto WINAPI :SINT, :HOOKPROC
ifdef _UNICODE
SetWindowsHook		equ <SetWindowsHookW>
else
SetWindowsHook		equ <SetWindowsHookA>
endif

else

SetWindowsHookA proto WINAPI :SINT, :HOOKPROC
SetWindowsHookW proto WINAPI :SINT, :HOOKPROC
ifdef _UNICODE
SetWindowsHook		equ <SetWindowsHookW>
else
SetWindowsHook		equ <SetWindowsHookA>
endif

endif

UnhookWindowsHook proto WINAPI :SINT,:HOOKPROC
SetWindowsHookExA proto WINAPI :SINT, :HOOKPROC, :HINSTANCE, :DWORD
SetWindowsHookExW proto WINAPI :SINT, :HOOKPROC, :HINSTANCE, :DWORD
ifdef _UNICODE
SetWindowsHookEx	equ <SetWindowsHookExW>
else
SetWindowsHookEx	equ <SetWindowsHookExA>
endif

UnhookWindowsHookEx proto WINAPI :HHOOK
CallNextHookEx proto WINAPI :HHOOK, :SINT, :WPARAM, :LPARAM

ifdef STRICT
DefHookProc macro nCode, wParam, lParam, phhk
	exitm<CallNextHookEx(phhk, nCode, wParam, lParam)>
	endm

else
DefHookProc macro nCode, wParam, lParam, phhk
	exitm<CallNextHookEx(phhk, nCode, wParam, lParam)>
	endm

endif

endif

ifndef NOMENUS

MF_INSERT		equ 0x00000000
MF_CHANGE		equ 0x00000080
MF_APPEND		equ 0x00000100
MF_DELETE		equ 0x00000200
MF_REMOVE		equ 0x00001000
MF_BYCOMMAND		equ 0x00000000
MF_BYPOSITION		equ 0x00000400
MF_SEPARATOR		equ 0x00000800
MF_ENABLED		equ 0x00000000
MF_GRAYED		equ 0x00000001
MF_DISABLED		equ 0x00000002
MF_UNCHECKED		equ 0x00000000
MF_CHECKED		equ 0x00000008
MF_USECHECKBITMAPS	equ 0x00000200
MF_STRING		equ 0x00000000
MF_BITMAP		equ 0x00000004
MF_OWNERDRAW		equ 0x00000100
MF_POPUP		equ 0x00000010
MF_MENUBARBREAK		equ 0x00000020
MF_MENUBREAK		equ 0x00000040
MF_UNHILITE		equ 0x00000000
MF_HILITE		equ 0x00000080

if(WINVER GE 0x0400)
MF_DEFAULT		equ 0x00001000
endif
MF_SYSMENU		equ 0x00002000
MF_HELP			equ 0x00004000
if(WINVER GE 0x0400)
MF_RIGHTJUSTIFY		equ 0x00004000
endif

MF_MOUSESELECT		equ 0x00008000
if(WINVER GE 0x0400)
MF_END			equ 0x00000080
endif

if(WINVER GE 0x0400)
MFT_STRING		equ MF_STRING
MFT_BITMAP		equ MF_BITMAP
MFT_MENUBARBREAK	equ MF_MENUBARBREAK
MFT_MENUBREAK		equ MF_MENUBREAK
MFT_OWNERDRAW		equ MF_OWNERDRAW
MFT_RADIOCHECK		equ 0x00000200
MFT_SEPARATOR		equ MF_SEPARATOR
MFT_RIGHTORDER		equ 0x00002000
MFT_RIGHTJUSTIFY	equ MF_RIGHTJUSTIFY

MFS_GRAYED		equ 0x00000003
MFS_DISABLED		equ MFS_GRAYED
MFS_CHECKED		equ MF_CHECKED
MFS_HILITE		equ MF_HILITE
MFS_ENABLED		equ MF_ENABLED
MFS_UNCHECKED		equ MF_UNCHECKED
MFS_UNHILITE		equ MF_UNHILITE
MFS_DEFAULT		equ MF_DEFAULT
if(WINVER GE 0x0500)
MFS_MASK		equ 0x0000108B
MFS_HOTTRACKDRAWN	equ 0x10000000
MFS_CACHEDBMP		equ 0x20000000
MFS_BOTTOMGAPDROP	equ 0x40000000
MFS_TOPGAPDROP		equ 0x80000000
MFS_GAPDROP		equ 0xC0000000
endif

endif

if(WINVER GE 0x0400)
CheckMenuRadioItem proto WINAPI :HMENU, :UINT, :UINT, :UINT, :UINT
endif

MENUITEMTEMPLATEHEADER	STRUC
versionNumber		dw ?
_offset			dw ?
MENUITEMTEMPLATEHEADER	ENDS
PMENUITEMTEMPLATEHEADER typedef ptr MENUITEMTEMPLATEHEADER

MENUITEMTEMPLATE	STRUC
mtOption		dw ?
mtID			dw ?
mtString		WCHAR ?
MENUITEMTEMPLATE	ENDS
PMENUITEMTEMPLATE	typedef ptr MENUITEMTEMPLATE
MF_END			equ 0x00000080

endif

ifndef NOSYSCOMMANDS

SC_SIZE			equ 0xF000
SC_MOVE			equ 0xF010
SC_MINIMIZE		equ 0xF020
SC_MAXIMIZE		equ 0xF030
SC_NEXTWINDOW		equ 0xF040
SC_PREVWINDOW		equ 0xF050
SC_CLOSE		equ 0xF060
SC_VSCROLL		equ 0xF070
SC_HSCROLL		equ 0xF080
SC_MOUSEMENU		equ 0xF090
SC_KEYMENU		equ 0xF100
SC_ARRANGE		equ 0xF110
SC_RESTORE		equ 0xF120
SC_TASKLIST		equ 0xF130
SC_SCREENSAVE		equ 0xF140
SC_HOTKEY		equ 0xF150
if(WINVER GE 0x0400)
SC_DEFAULT		equ 0xF160
SC_MONITORPOWER		equ 0xF170
SC_CONTEXTHELP		equ 0xF180
SC_SEPARATOR		equ 0xF00F
endif

if(WINVER GE 0x0600)
SCF_ISSECURE		equ 0x00000001
endif

GET_SC_WPARAM macro wParam
	exitm<(word ptr wParam)>
	endm
SC_ICON			equ SC_MINIMIZE
SC_ZOOM			equ SC_MAXIMIZE

endif

LoadBitmapA proto WINAPI :HINSTANCE, :LPCSTR
LoadBitmapW proto WINAPI :HINSTANCE, :LPCWSTR
ifdef _UNICODE
LoadBitmap		equ <LoadBitmapW>
else
LoadBitmap		equ <LoadBitmapA>
endif

LoadCursorA proto WINAPI :HINSTANCE, :LPCSTR
LoadCursorW proto WINAPI :HINSTANCE, :LPCWSTR
ifdef _UNICODE
LoadCursor		equ <LoadCursorW>
else
LoadCursor		equ <LoadCursorA>
endif

LoadCursorFromFileA proto WINAPI :LPCSTR
LoadCursorFromFileW proto WINAPI :LPCWSTR
ifdef _UNICODE
LoadCursorFromFile	equ <LoadCursorFromFileW>
else
LoadCursorFromFile	equ <LoadCursorFromFileA>
endif

CreateCursor proto WINAPI :HINSTANCE, :SINT, :SINT, :SINT, :SINT, :PVOID, :PVOID
DestroyCursor proto WINAPI :HCURSOR

ifndef _MAC
CopyCursor macro pcur
	exitm<CopyIcon(pcur)>
	endm
else
CopyCursor proto WINAPI :HCURSOR
endif

IDC_ARROW		equ MAKEINTRESOURCE(32512)
IDC_IBEAM		equ MAKEINTRESOURCE(32513)
IDC_WAIT		equ MAKEINTRESOURCE(32514)
IDC_CROSS		equ MAKEINTRESOURCE(32515)
IDC_UPARROW		equ MAKEINTRESOURCE(32516)
IDC_SIZE		equ MAKEINTRESOURCE(32640)
IDC_ICON		equ MAKEINTRESOURCE(32641)
IDC_SIZENWSE		equ MAKEINTRESOURCE(32642)
IDC_SIZENESW		equ MAKEINTRESOURCE(32643)
IDC_SIZEWE		equ MAKEINTRESOURCE(32644)
IDC_SIZENS		equ MAKEINTRESOURCE(32645)
IDC_SIZEALL		equ MAKEINTRESOURCE(32646)
IDC_NO			equ MAKEINTRESOURCE(32648)
if(WINVER GE 0x0500)
IDC_HAND		equ MAKEINTRESOURCE(32649)
endif
IDC_APPSTARTING		equ MAKEINTRESOURCE(32650)
if(WINVER GE 0x0400)
IDC_HELP		equ MAKEINTRESOURCE(32651)
endif

SetSystemCursor proto WINAPI :HCURSOR, :DWORD

ICONINFO		STRUC
fIcon			BOOL ?
xHotspot		dd ?
yHotspot		dd ?
hbmMask			HBITMAP ?
hbmColor		HBITMAP ?
ICONINFO		ENDS
PICONINFO		typedef ptr ICONINFO

LoadIconA proto WINAPI :HINSTANCE, :LPCSTR
LoadIconW proto WINAPI :HINSTANCE, :LPCWSTR
ifdef _UNICODE
LoadIcon		equ <LoadIconW>
else
LoadIcon		equ <LoadIconA>
endif

CreateIcon proto WINAPI :HINSTANCE, :SINT, :SINT, :BYTE, :BYTE, :PBYTE, :PBYTE
DestroyIcon proto WINAPI :HICON
LookupIconIdFromDirectory proto WINAPI :PBYTE, :BOOL

if(WINVER GE 0x0400)
LookupIconIdFromDirectoryEx proto WINAPI :PBYTE, :BOOL, :SINT, :SINT, :UINT
endif
CreateIconFromResource proto WINAPI :PBYTE, :DWORD, :BOOL, :DWORD

if(WINVER GE 0x0400)
CreateIconFromResourceEx proto WINAPI :PBYTE, :DWORD, :BOOL, :DWORD, :SINT, :SINT, :UINT

CURSORSHAPE		STRUC
xHotSpot		SINT ?
yHotSpot		SINT ?
_cx			SINT ?
cy			SINT ?
cbWidth			SINT ?
Planes			db ?
BitsPixel		db ?
CURSORSHAPE		ENDS
LPCURSORSHAPE		typedef ptr CURSORSHAPE
endif

IMAGE_BITMAP		equ 0
IMAGE_ICON		equ 1
IMAGE_CURSOR		equ 2
if(WINVER GE 0x0400)
IMAGE_ENHMETAFILE	equ 3

LR_DEFAULTCOLOR		equ 0x0000
LR_MONOCHROME		equ 0x0001
LR_COLOR		equ 0x0002
LR_COPYRETURNORG	equ 0x0004
LR_COPYDELETEORG	equ 0x0008
LR_LOADFROMFILE		equ 0x0010
LR_LOADTRANSPARENT	equ 0x0020
LR_DEFAULTSIZE		equ 0x0040
LR_VGACOLOR		equ 0x0080
LR_LOADMAP3DCOLORS	equ 0x1000
LR_CREATEDIBSECTION	equ 0x2000
LR_COPYFROMRESOURCE	equ 0x4000
LR_SHARED		equ 0x8000

LoadImageA proto WINAPI :HINSTANCE, :LPCSTR, :UINT, :SINT, :SINT, :UINT
LoadImageW proto WINAPI :HINSTANCE, :LPCWSTR, :UINT, :SINT, :SINT, :UINT
ifdef _UNICODE
LoadImage		equ <LoadImageW>
else
LoadImage		equ <LoadImageA>
endif

CopyImage proto WINAPI :HANDLE, :UINT, :SINT, :SINT, :UINT

DI_MASK			equ 0x0001
DI_IMAGE		equ 0x0002
DI_NORMAL		equ 0x0003
DI_COMPAT		equ 0x0004
DI_DEFAULTSIZE		equ 0x0008
if(_WIN32_WINNT GE 0x0501)
DI_NOMIRROR		equ 0x0010
endif
DrawIconEx proto WINAPI :HDC, :SINT, :SINT, :HICON, :SINT, :SINT, :UINT, :HBRUSH, :UINT
endif

CreateIconIndirect proto WINAPI :PICONINFO
CopyIcon proto WINAPI :HICON
GetIconInfo proto WINAPI :HICON, :PICONINFO

if(_WIN32_WINNT GE 0x0600)
ICONINFOEXA		STRUC
cbSize			dd ?
fIcon			BOOL ?
xHotspot		dd ?
yHotspot		dd ?
hbmMask			HBITMAP ?
hbmColor		HBITMAP ?
wResID			dw ?
szModName		db MAX_PATH dup(?)
szResName		db MAX_PATH dup(?)
ICONINFOEXA		ENDS
PICONINFOEXA		typedef ptr ICONINFOEXA
ICONINFOEXW		STRUC
cbSize			dd ?
fIcon			BOOL ?
xHotspot		dd ?
yHotspot		dd ?
hbmMask			HBITMAP ?
hbmColor		HBITMAP ?
wResID			dw ?
szModName		dw MAX_PATH dup(?)
szResName		dw MAX_PATH dup(?)
ICONINFOEXW		ENDS
PICONINFOEXW		typedef ptr ICONINFOEXW
ifdef _UNICODE
ICONINFOEX		typedef ICONINFOEXW
PICONINFOEX		typedef PICONINFOEXW
else
ICONINFOEX		typedef ICONINFOEXA
PICONINFOEX		typedef PICONINFOEXA
endif
GetIconInfoExA proto WINAPI :HICON, :PICONINFOEXA
GetIconInfoExW proto WINAPI :HICON, :PICONINFOEXW
ifdef _UNICODE
GetIconInfoEx		equ <GetIconInfoExW>
else
GetIconInfoEx		equ <GetIconInfoExA>
endif
endif

if(WINVER GE 0x0400)
RES_ICON		equ 1
RES_CURSOR		equ 2
endif

ifdef OEMRESOURCE

OBM_CLOSE		equ 32754
OBM_UPARROW		equ 32753
OBM_DNARROW		equ 32752
OBM_RGARROW		equ 32751
OBM_LFARROW		equ 32750
OBM_REDUCE		equ 32749
OBM_ZOOM		equ 32748
OBM_RESTORE		equ 32747
OBM_REDUCED		equ 32746
OBM_ZOOMD		equ 32745
OBM_RESTORED		equ 32744
OBM_UPARROWD		equ 32743
OBM_DNARROWD		equ 32742
OBM_RGARROWD		equ 32741
OBM_LFARROWD		equ 32740
OBM_MNARROW		equ 32739
OBM_COMBO		equ 32738
OBM_UPARROWI		equ 32737
OBM_DNARROWI		equ 32736
OBM_RGARROWI		equ 32735
OBM_LFARROWI		equ 32734

OBM_OLD_CLOSE		equ 32767
OBM_SIZE		equ 32766
OBM_OLD_UPARROW		equ 32765
OBM_OLD_DNARROW		equ 32764
OBM_OLD_RGARROW		equ 32763
OBM_OLD_LFARROW		equ 32762
OBM_BTSIZE		equ 32761
OBM_CHECK		equ 32760
OBM_CHECKBOXES		equ 32759
OBM_BTNCORNERS		equ 32758
OBM_OLD_REDUCE		equ 32757
OBM_OLD_ZOOM		equ 32756
OBM_OLD_RESTORE		equ 32755

OCR_NORMAL		equ 32512
OCR_IBEAM		equ 32513
OCR_WAIT		equ 32514
OCR_CROSS		equ 32515
OCR_UP			equ 32516
OCR_SIZE		equ 32640
OCR_ICON		equ 32641
OCR_SIZENWSE		equ 32642
OCR_SIZENESW		equ 32643
OCR_SIZEWE		equ 32644
OCR_SIZENS		equ 32645
OCR_SIZEALL		equ 32646
OCR_ICOCUR		equ 32647
OCR_NO			equ 32648
if(WINVER GE 0x0500)
OCR_HAND		equ 32649
endif
if(WINVER GE 0x0400)
OCR_APPSTARTING		equ 32650
endif

OIC_SAMPLE		equ 32512
OIC_HAND		equ 32513
OIC_QUES		equ 32514
OIC_BANG		equ 32515
OIC_NOTE		equ 32516
if(WINVER GE 0x0400)
OIC_WINLOGO		equ 32517
OIC_WARNING		equ OIC_BANG
OIC_ERROR		equ OIC_HAND
OIC_INFORMATION		equ OIC_NOTE
endif

endif

ORD_LANGDRIVER		equ 1

ifndef NOICONS

ifdef RC_INVOKED
IDI_APPLICATION		equ 32512
IDI_HAND		equ 32513
IDI_QUESTION		equ 32514
IDI_EXCLAMATION		equ 32515
IDI_ASTERISK		equ 32516
if(WINVER GE 0x0400)
IDI_WINLOGO		equ 32517
endif
if(WINVER GE 0x0600)
IDI_SHIELD		equ 32518
endif
else
IDI_APPLICATION		equ MAKEINTRESOURCE(32512)
IDI_HAND		equ MAKEINTRESOURCE(32513)
IDI_QUESTION		equ MAKEINTRESOURCE(32514)
IDI_EXCLAMATION		equ MAKEINTRESOURCE(32515)
IDI_ASTERISK		equ MAKEINTRESOURCE(32516)
if(WINVER GE 0x0400)
IDI_WINLOGO		equ MAKEINTRESOURCE(32517)
endif
if(WINVER GE 0x0600)
IDI_SHIELD		equ MAKEINTRESOURCE(32518)
endif
endif

if(WINVER GE 0x0400)
IDI_WARNING		equ IDI_EXCAMATION
IDI_ERROR		equ IDI_HAND
IDI_INFORMATION		equ IDI_ASTERISK
endif

endif

LoadStringA proto WINAPI :HINSTANCE, :UINT, :LPSTR, :SINT
LoadStringW proto WINAPI :HINSTANCE, :UINT, :LPWSTR, :SINT
ifdef _UNICODE
LoadString		equ <LoadStringW>
else
LoadString		equ <LoadStringA>
endif

IDOK			equ 1
IDCANCEL		equ 2
IDABORT			equ 3
IDRETRY			equ 4
IDIGNORE		equ 5
IDYES			equ 6
IDNO			equ 7
if(WINVER GE 0x0400)
IDCLOSE			equ 8
IDHELP			equ 9
endif
if(WINVER GE 0x0500)
IDTRYAGAIN		equ 10
IDCONTINUE		equ 11
endif
if(WINVER GE 0x0501)
ifndef IDTIMEOUT
IDTIMEOUT		equ 32000
endif
endif

ifndef NOCTLMGR

ifndef NOWINSTYLES

ES_LEFT			equ 0x0000
ES_CENTER		equ 0x0001
ES_RIGHT		equ 0x0002
ES_MULTILINE		equ 0x0004
ES_UPPERCASE		equ 0x0008
ES_LOWERCASE		equ 0x0010
ES_PASSWORD		equ 0x0020
ES_AUTOVSCROLL		equ 0x0040
ES_AUTOHSCROLL		equ 0x0080
ES_NOHIDESEL		equ 0x0100
ES_OEMCONVERT		equ 0x0400
ES_READONLY		equ 0x0800
ES_WANTRETURN		equ 0x1000
if(WINVER GE 0x0400)
ES_NUMBER		equ 0x2000
endif

endif

EN_SETFOCUS		equ 0x0100
EN_KILLFOCUS		equ 0x0200
EN_CHANGE		equ 0x0300
EN_UPDATE		equ 0x0400
EN_ERRSPACE		equ 0x0500
EN_MAXTEXT		equ 0x0501
EN_HSCROLL		equ 0x0601
EN_VSCROLL		equ 0x0602

if(_WIN32_WINNT GE 0x0500)
EN_ALIGN_LTR_EC		equ 0x0700
EN_ALIGN_RTL_EC		equ 0x0701
endif

if(WINVER GE 0x0400)
EC_LEFTMARGIN		equ 0x0001
EC_RIGHTMARGIN		equ 0x0002
EC_USEFONTINFO		equ 0xffff
endif

if(WINVER GE 0x0500)
EMSIS_COMPOSITIONSTRING equ 0x0001
EIMES_GETCOMPSTRATONCE	equ 0x0001
EIMES_CANCELCOMPSTRINFOCUS equ 0x0002
EIMES_COMPLETECOMPSTRKILLFOCUS equ 0x0004
endif

ifndef NOWINMESSAGES

EM_GETSEL		equ 0x00B0
EM_SETSEL		equ 0x00B1
EM_GETRECT		equ 0x00B2
EM_SETRECT		equ 0x00B3
EM_SETRECTNP		equ 0x00B4
EM_SCROLL		equ 0x00B5
EM_LINESCROLL		equ 0x00B6
EM_SCROLLCARET		equ 0x00B7
EM_GETMODIFY		equ 0x00B8
EM_SETMODIFY		equ 0x00B9
EM_GETLINECOUNT		equ 0x00BA
EM_LINEINDEX		equ 0x00BB
EM_SETHANDLE		equ 0x00BC
EM_GETHANDLE		equ 0x00BD
EM_GETTHUMB		equ 0x00BE
EM_LINELENGTH		equ 0x00C1
EM_REPLACESEL		equ 0x00C2
EM_GETLINE		equ 0x00C4
EM_LIMITTEXT		equ 0x00C5
EM_CANUNDO		equ 0x00C6
EM_UNDO			equ 0x00C7
EM_FMTLINES		equ 0x00C8
EM_LINEFROMCHAR		equ 0x00C9
EM_SETTABSTOPS		equ 0x00CB
EM_SETPASSWORDCHAR	equ 0x00CC
EM_EMPTYUNDOBUFFER	equ 0x00CD
EM_GETFIRSTVISIBLELINE	equ 0x00CE
EM_SETREADONLY		equ 0x00CF
EM_SETWORDBREAKPROC	equ 0x00D0
EM_GETWORDBREAKPROC	equ 0x00D1
EM_GETPASSWORDCHAR	equ 0x00D2
if(WINVER GE 0x0400)
EM_SETMARGINS		equ 0x00D3
EM_GETMARGINS		equ 0x00D4
EM_SETLIMITTEXT		equ EM_LIMITTEXT
EM_GETLIMITTEXT		equ 0x00D5
EM_POSFROMCHAR		equ 0x00D6
EM_CHARFROMPOS		equ 0x00D7
endif

if(WINVER GE 0x0500)
EM_SETIMESTATUS		equ 0x00D8
EM_GETIMESTATUS		equ 0x00D9
endif

endif

WB_LEFT			equ 0
WB_RIGHT		equ 1
WB_ISDELIMITER		equ 2

BS_PUSHBUTTON		equ 0x00000000
BS_DEFPUSHBUTTON	equ 0x00000001
BS_CHECKBOX		equ 0x00000002
BS_AUTOCHECKBOX		equ 0x00000003
BS_RADIOBUTTON		equ 0x00000004
BS_3STATE		equ 0x00000005
BS_AUTO3STATE		equ 0x00000006
BS_GROUPBOX		equ 0x00000007
BS_USERBUTTON		equ 0x00000008
BS_AUTORADIOBUTTON	equ 0x00000009
BS_OWNERDRAW		equ 0x0000000B
BS_LEFTTEXT		equ 0x00000020
if(WINVER GE 0x0400)
BS_TEXT			equ 0x00000000
BS_ICON			equ 0x00000040
BS_BITMAP		equ 0x00000080
BS_LEFT			equ 0x00000100
BS_RIGHT		equ 0x00000200
BS_CENTER		equ 0x00000300
BS_TOP			equ 0x00000400
BS_BOTTOM		equ 0x00000800
BS_VCENTER		equ 0x00000C00
BS_PUSHLIKE		equ 0x00001000
BS_MULTILINE		equ 0x00002000
BS_NOTIFY		equ 0x00004000
BS_FLAT			equ 0x00008000
BS_RIGHTBUTTON		equ BS_LEFTTEXT
endif

BN_CLICKED		equ 0
BN_PAINT		equ 1
BN_HILITE		equ 2
BN_UNHILITE		equ 3
BN_DISABLE		equ 4
BN_DOUBLECLICKED	equ 5
if(WINVER GE 0x0400)
BN_PUSHED		equ BN_HILITE
BN_UNPUSHED		equ BN_UNHILITE
BN_DBLCLK		equ BN_DOUBLECICKED
BN_SETFOCUS		equ 6
BN_KILLFOCUS		equ 7
endif

BM_GETCHECK		equ 0x00F0
BM_SETCHECK		equ 0x00F1
BM_GETSTATE		equ 0x00F2
BM_SETSTATE		equ 0x00F3
BM_SETSTYLE		equ 0x00F4
if(WINVER GE 0x0400)
BM_CLICK		equ 0x00F5
BM_GETIMAGE		equ 0x00F6
BM_SETIMAGE		equ 0x00F7
endif
if(WINVER GE 0x0600)
BM_SETDONTCLICK		equ 0x00F8
endif
if(WINVER GE 0x0400)
BST_UNCHECKED		equ 0x0000
BST_CHECKED		equ 0x0001
BST_INDETERMINATE	equ 0x0002
BST_PUSHED		equ 0x0004
BST_FOCUS		equ 0x0008
endif

SS_LEFT			equ 0x00000000
SS_CENTER		equ 0x00000001
SS_RIGHT		equ 0x00000002
SS_ICON			equ 0x00000003
SS_BLACKRECT		equ 0x00000004
SS_GRAYRECT		equ 0x00000005
SS_WHITERECT		equ 0x00000006
SS_BLACKFRAME		equ 0x00000007
SS_GRAYFRAME		equ 0x00000008
SS_WHITEFRAME		equ 0x00000009
SS_USERITEM		equ 0x0000000A
SS_SIMPLE		equ 0x0000000B
SS_LEFTNOWORDWRAP	equ 0x0000000C
if(WINVER GE 0x0400)
SS_OWNERDRAW		equ 0x0000000D
SS_BITMAP		equ 0x0000000E
SS_ENHMETAFILE		equ 0x0000000F
SS_ETCHEDHORZ		equ 0x00000010
SS_ETCHEDVERT		equ 0x00000011
SS_ETCHEDFRAME		equ 0x00000012
SS_TYPEMASK		equ 0x0000001F
endif
if(WINVER GE 0x0501)
SS_REALSIZECONTROL	equ 0x00000040
endif
SS_NOPREFIX		equ 0x00000080
if(WINVER GE 0x0400)
SS_NOTIFY		equ 0x00000100
SS_CENTERIMAGE		equ 0x00000200
SS_RIGHTJUST		equ 0x00000400
SS_REALSIZEIMAGE	equ 0x00000800
SS_SUNKEN		equ 0x00001000
SS_ENDELLIPSIS		equ 0x00004000
SS_PATHELLIPSIS		equ 0x00008000
SS_WORDELLIPSIS		equ 0x0000C000
SS_ELLIPSISMASK		equ 0x0000C000
endif

ifndef NOWINMESSAGES
STM_SETICON		equ 0x0170
STM_GETICON		equ 0x0171
if(WINVER GE 0x0400)
STM_SETIMAGE		equ 0x0172
STM_GETIMAGE		equ 0x0173
STN_CLICKED		equ 0
STN_DBLCLK		equ 1
STN_ENABLE		equ 2
STN_DISABLE		equ 3
endif
STM_MSGMAX		equ 0x0174
endif

WC_DIALOG		equ (MAKEINTATOM(0x8002))

DWL_MSGRESULT		equ 0
DWL_DLGPROC		equ 4
DWL_USER		equ 8

ifndef NOMSG

IsDialogMessageA proto WINAPI :HWND, :LPMSG
IsDialogMessageW proto WINAPI :HWND, :LPMSG
ifdef _UNICODE
IsDialogMessage		equ <IsDialogMessageW>
else
IsDialogMessage		equ <IsDialogMessageA>
endif

endif

MapDialogRect proto WINAPI :HWND, :LPRECT

DlgDirListA proto WINAPI :HWND, :LPSTR, :SINT, :SINT, :UINT
DlgDirListW proto WINAPI :HWND, :LPWSTR, :SINT, :SINT, :UINT
ifdef _UNICODE
DlgDirList		equ <DlgDirListW>
else
DlgDirList		equ <DlgDirListA>
endif

DDL_READWRITE		equ 0x0000
DDL_READONLY		equ 0x0001
DDL_HIDDEN		equ 0x0002
DDL_SYSTEM		equ 0x0004
DDL_DIRECTORY		equ 0x0010
DDL_ARCHIVE		equ 0x0020

DDL_POSTMSGS		equ 0x2000
DDL_DRIVES		equ 0x4000
DDL_EXCLUSIVE		equ 0x8000

DlgDirSelectExA proto WINAPI :HWND, :LPSTR, :SINT, :SINT
DlgDirSelectExW proto WINAPI :HWND, :LPWSTR, :SINT, :SINT
ifdef _UNICODE
DlgDirSelectEx		equ <DlgDirSelectExW>
else
DlgDirSelectEx		equ <DlgDirSelectExA>
endif

DlgDirListComboBoxA proto WINAPI :HWND, :LPSTR, :SINT, :SINT, :UINT
DlgDirListComboBoxW proto WINAPI :HWND, :LPWSTR, :SINT, :SINT, :UINT
ifdef _UNICODE
DlgDirListComboBox	equ <DlgDirListComboBoxW>
else
DlgDirListComboBox	equ <DlgDirListComboBoxA>
endif

DlgDirSelectComboBoxExA proto WINAPI :HWND, :LPSTR, :SINT, :SINT
DlgDirSelectComboBoxExW proto WINAPI :HWND, :LPWSTR, :SINT, :SINT
ifdef _UNICODE
DlgDirSelectComboBoxEx	equ <DlgDirSelectComboBoxExW>
else
DlgDirSelectComboBoxEx	equ <DlgDirSelectComboBoxExA>
endif

DS_ABSALIGN		equ 0x01
DS_SYSMODAL		equ 0x02
DS_LOCALEDIT		equ 0x20
DS_SETFONT		equ 0x40
DS_MODALFRAME		equ 0x80
DS_NOIDLEMSG		equ 0x100
DS_SETFOREGROUND	equ 0x200

if(WINVER GE 0x0400)
DS_3DLOOK		equ 0x0004
DS_FIXEDSYS		equ 0x0008
DS_NOFAILCREATE		equ 0x0010
DS_CONTROL		equ 0x0400
DS_CENTER		equ 0x0800
DS_CENTERMOUSE		equ 0x1000
DS_CONTEXTHELP		equ 0x2000
DS_SHELLFONT		equ (DS_SETFONT OR DS_FIXEDSYS)
endif

DM_GETDEFID		equ (WM_USER+0)
DM_SETDEFID		equ (WM_USER+1)

if(WINVER GE 0x0400)
DM_REPOSITION		equ (WM_USER+2)
endif
DC_HASDEFID		equ 0x534B

DLGC_WANTARROWS		equ 0x0001
DLGC_WANTTAB		equ 0x0002
DLGC_WANTALLKEYS	equ 0x0004
DLGC_WANTMESSAGE	equ 0x0004
DLGC_HASSETSEL		equ 0x0008
DLGC_DEFPUSHBUTTON	equ 0x0010
DLGC_UNDEFPUSHBUTTON	equ 0x0020
DLGC_RADIOBUTTON	equ 0x0040
DLGC_WANTCHARS		equ 0x0080
DLGC_STATIC		equ 0x0100
DLGC_BUTTON		equ 0x2000

LB_CTLCODE		equ 0
LB_OKAY			equ 0
LB_ERR			equ (-1)
LB_ERRSPACE		equ (-2)

LBN_ERRSPACE		equ (-2)
LBN_SELCHANGE		equ 1
LBN_DBLCLK		equ 2
LBN_SELCANCEL		equ 3
LBN_SETFOCUS		equ 4
LBN_KILLFOCUS		equ 5

ifndef NOWINMESSAGES

LB_ADDSTRING		equ 0x0180
LB_INSERTSTRING		equ 0x0181
LB_DELETESTRING		equ 0x0182
LB_SELITEMRANGEEX	equ 0x0183
LB_RESETCONTENT		equ 0x0184
LB_SETSEL		equ 0x0185
LB_SETCURSEL		equ 0x0186
LB_GETSEL		equ 0x0187
LB_GETCURSEL		equ 0x0188
LB_GETTEXT		equ 0x0189
LB_GETTEXTLEN		equ 0x018A
LB_GETCOUNT		equ 0x018B
LB_SELECTSTRING		equ 0x018C
LB_DIR			equ 0x018D
LB_GETTOPINDEX		equ 0x018E
LB_FINDSTRING		equ 0x018F
LB_GETSELCOUNT		equ 0x0190
LB_GETSELITEMS		equ 0x0191
LB_SETTABSTOPS		equ 0x0192
LB_GETHORIZONTALEXTENT	equ 0x0193
LB_SETHORIZONTALEXTENT	equ 0x0194
LB_SETCOLUMNWIDTH	equ 0x0195
LB_ADDFILE		equ 0x0196
LB_SETTOPINDEX		equ 0x0197
LB_GETITEMRECT		equ 0x0198
LB_GETITEMDATA		equ 0x0199
LB_SETITEMDATA		equ 0x019A
LB_SELITEMRANGE		equ 0x019B
LB_SETANCHORINDEX	equ 0x019C
LB_GETANCHORINDEX	equ 0x019D
LB_SETCARETINDEX	equ 0x019E
LB_GETCARETINDEX	equ 0x019F
LB_SETITEMHEIGHT	equ 0x01A0
LB_GETITEMHEIGHT	equ 0x01A1
LB_FINDSTRINGEXACT	equ 0x01A2
LB_SETLOCALE		equ 0x01A5
LB_GETLOCALE		equ 0x01A6
LB_SETCOUNT		equ 0x01A7
if(WINVER GE 0x0400)
LB_INITSTORAGE		equ 0x01A8
LB_ITEMFROMPOINT	equ 0x01A9
endif

if(_WIN32_WINNT GE 0x0501)
LB_GETLISTBOXINFO	equ 0x01B2
endif
if(_WIN32_WINNT GE 0x0501)
LB_MSGMAX		equ 0x01B3
elseif defined(_WIN32_WCE) and (_WIN32_WCE GE 0x0400)
LB_MSGMAX		equ 0x01B1
elseif(WINVER GE 0x0400)
LB_MSGMAX		equ 0x01B0
else
LB_MSGMAX		equ 0x01A8
endif

endif

ifndef NOWINSTYLES

LBS_NOTIFY		equ 0x0001
LBS_SORT		equ 0x0002
LBS_NOREDRAW		equ 0x0004
LBS_MULTIPLESEL		equ 0x0008
LBS_OWNERDRAWFIXED	equ 0x0010
LBS_OWNERDRAWVARIABLE	equ 0x0020
LBS_HASSTRINGS		equ 0x0040
LBS_USETABSTOPS		equ 0x0080
LBS_NOINTEGRALHEIGHT	equ 0x0100
LBS_MULTICOLUMN		equ 0x0200
LBS_WANTKEYBOARDINPUT	equ 0x0400
LBS_EXTENDEDSEL		equ 0x0800
LBS_DISABLENOSCROLL	equ 0x1000
LBS_NODATA		equ 0x2000
if(WINVER GE 0x0400)
LBS_NOSEL		equ 0x4000
endif
LBS_STANDARD		equ (LBS_NOTIFY OR LBS_SORT OR WS_VSCROLL OR WS_BORDER)

endif

CB_OKAY			equ 0
CB_ERR			equ (-1)
CB_ERRSPACE		equ (-2)

CBN_ERRSPACE		equ (-1)
CBN_SELCHANGE		equ 1
CBN_DBLCLK		equ 2
CBN_SETFOCUS		equ 3
CBN_KILLFOCUS		equ 4
CBN_EDITCHANGE		equ 5
CBN_EDITUPDATE		equ 6
CBN_DROPDOWN		equ 7
CBN_CLOSEUP		equ 8
CBN_SELENDOK		equ 9
CBN_SELENDCANCEL	equ 10

ifndef NOWINSTYLES
CBS_SIMPLE		equ 0x0001
CBS_DROPDOWN		equ 0x0002
CBS_DROPDOWNLIST	equ 0x0003
CBS_OWNERDRAWFIXED	equ 0x0010
CBS_OWNERDRAWVARIABLE	equ 0x0020
CBS_AUTOHSCROLL		equ 0x0040
CBS_OEMCONVERT		equ 0x0080
CBS_SORT		equ 0x0100
CBS_HASSTRINGS		equ 0x0200
CBS_NOINTEGRALHEIGHT	equ 0x0400
CBS_DISABLENOSCROLL	equ 0x0800
if(WINVER GE 0x0400)
CBS_UPPERCASE		equ 0x2000
CBS_LOWERCASE		equ 0x4000
endif
endif

ifndef NOWINMESSAGES
CB_GETEDITSEL		equ 0x0140
CB_LIMITTEXT		equ 0x0141
CB_SETEDITSEL		equ 0x0142
CB_ADDSTRING		equ 0x0143
CB_DELETESTRING		equ 0x0144
CB_DIR			equ 0x0145
CB_GETCOUNT		equ 0x0146
CB_GETCURSEL		equ 0x0147
CB_GETLBTEXT		equ 0x0148
CB_GETLBTEXTLEN		equ 0x0149
CB_INSERTSTRING		equ 0x014A
CB_RESETCONTENT		equ 0x014B
CB_FINDSTRING		equ 0x014C
CB_SELECTSTRING		equ 0x014D
CB_SETCURSEL		equ 0x014E
CB_SHOWDROPDOWN		equ 0x014F
CB_GETITEMDATA		equ 0x0150
CB_SETITEMDATA		equ 0x0151
CB_GETDROPPEDCONTROLRECT equ 0x0152
CB_SETITEMHEIGHT	equ 0x0153
CB_GETITEMHEIGHT	equ 0x0154
CB_SETEXTENDEDUI	equ 0x0155
CB_GETEXTENDEDUI	equ 0x0156
CB_GETDROPPEDSTATE	equ 0x0157
CB_FINDSTRINGEXACT	equ 0x0158
CB_SETLOCALE		equ 0x0159
CB_GETLOCALE		equ 0x015A
if(WINVER GE 0x0400)
CB_GETTOPINDEX		equ 0x015b
CB_SETTOPINDEX		equ 0x015c
CB_GETHORIZONTALEXTENT	equ 0x015d
CB_SETHORIZONTALEXTENT	equ 0x015e
CB_GETDROPPEDWIDTH	equ 0x015f
CB_SETDROPPEDWIDTH	equ 0x0160
CB_INITSTORAGE		equ 0x0161
endif

if(_WIN32_WINNT GE 0x0501)
CB_GETCOMBOBOXINFO	equ 0x0164
endif

if(_WIN32_WINNT GE 0x0501)
CB_MSGMAX		equ 0x0165
elseif defined(_WIN32_WCE) and (_WIN32_WCE GE 0x0400)
CB_MSGMAX		equ 0x0163
elseif(WINVER GE 0x0400)
CB_MSGMAX		equ 0x0162
else
CB_MSGMAX		equ 0x015B
endif

endif

ifndef NOWINSTYLES

SBS_HORZ		equ 0x0000
SBS_VERT		equ 0x0001
SBS_TOPALIGN		equ 0x0002
SBS_LEFTALIGN		equ 0x0002
SBS_BOTTOMALIGN		equ 0x0004
SBS_RIGHTALIGN		equ 0x0004
SBS_SIZEBOXTOPLEFTALIGN equ 0x0002
SBS_SIZEBOXBOTTOMRIGHTALIGN equ 0x0004
SBS_SIZEBOX		equ 0x0008
if(WINVER GE 0x0400)
SBS_SIZEGRIP		equ 0x0010
endif

endif

ifndef NOWINMESSAGES
SBM_SETPOS		equ 0x00E0
SBM_GETPOS		equ 0x00E1
SBM_SETRANGE		equ 0x00E2
SBM_SETRANGEREDRAW	equ 0x00E6
SBM_GETRANGE		equ 0x00E3
SBM_ENABLE_ARROWS	equ 0x00E4
if(WINVER GE 0x0400)
SBM_SETSCROLLINFO	equ 0x00E9
SBM_GETSCROLLINFO	equ 0x00EA
endif
if(_WIN32_WINNT GE 0x0501)
SBM_GETSCROLLBARINFO	equ 0x00EB
endif
if(WINVER GE 0x0400)
SIF_RANGE		equ 0x0001
SIF_PAGE		equ 0x0002
SIF_POS			equ 0x0004
SIF_DISABLENOSCROLL	equ 0x0008
SIF_TRACKPOS		equ 0x0010
SIF_ALL			equ (SIF_RANGE OR SIF_PAGE OR SIF_POS OR SIF_TRACKPOS)

SCROLLINFO		STRUC
cbSize			UINT ?
fMask			UINT ?
nMin			SINT ?
nMax			SINT ?
nPage			UINT ?
nPos			SINT ?
nTrackPos		SINT ?
SCROLLINFO		ENDS
LPSCROLLINFO		typedef ptr SCROLLINFO
LPCSCROLLINFO		typedef ptr SCROLLINFO

SetScrollInfo proto WINAPI :HWND, :SINT, :LPCSCROLLINFO, :BOOL
GetScrollInfo proto WINAPI :HWND, :SINT, :LPSCROLLINFO
endif
endif
endif

ifndef NOMDI

MDIS_ALLCHILDSTYLES	equ 0x0001
MDITILE_VERTICAL	equ 0x0000
MDITILE_HORIZONTAL	equ 0x0001
MDITILE_SKIPDISABLED	equ 0x0002
if(_WIN32_WINNT GE 0x0500)
MDITILE_ZORDER		equ 0x0004
endif

MDICREATESTRUCTA	STRUC
szClass			LPCSTR ?
szTitle			LPCSTR ?
hOwner			HANDLE ?
x			SINT ?
y			SINT ?
_cx			SINT ?
cy			SINT ?
style			dd ?
lParam			LPARAM ?
MDICREATESTRUCTA	ENDS
LPMDICREATESTRUCTA	typedef ptr MDICREATESTRUCTA
MDICREATESTRUCTW	STRUC
szClass			LPCWSTR ?
szTitle			LPCWSTR ?
hOwner			HANDLE ?
x			SINT ?
y			SINT ?
_cx			SINT ?
cy			SINT ?
style			dd ?
lParam			LPARAM ?
MDICREATESTRUCTW	ENDS
LPMDICREATESTRUCTW	typedef ptr MDICREATESTRUCTW
ifdef _UNICODE
MDICREATESTRUCT		typedef MDICREATESTRUCTW
LPMDICREATESTRUCT	typedef LPMDICREATESTRUCTW
else
MDICREATESTRUCT		typedef MDICREATESTRUCTA
LPMDICREATESTRUCT	typedef LPMDICREATESTRUCTA
endif

CLIENTCREATESTRUCT	STRUC
hWindowMenu		HANDLE ?
idFirstChild		UINT ?
CLIENTCREATESTRUCT	ENDS
LPCLIENTCREATESTRUCT	typedef ptr CLIENTCREATESTRUCT

DefFrameProcA proto WINAPI :HWND, :HWND, :UINT, :WPARAM, :LPARAM
DefFrameProcW proto WINAPI :HWND, :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
DefFrameProc		equ <DefFrameProcW>
else
DefFrameProc		equ <DefFrameProcA>
endif

DefMDIChildProcA typedef proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
DefMDIChildProcW typedef proto WINAPI :HWND, :UINT, :WPARAM, :LPARAM
ifdef _UNICODE
DefMDIChildProc typedef ptr DefMDIChildProcW
else
DefMDIChildProc typedef ptr DefMDIChildProcA
endif
ifndef NOMSG
TranslateMDISysAccel proto WINAPI :HWND, :LPMSG
endif
ArrangeIconicWindows proto WINAPI :HWND

CreateMDIWindowA proto WINAPI :LPSTR, :LPSTR, :DWORD, :SINT, :SINT, :SINT, :SINT, :HWND, :HINSTANCE, :LPARAM
CreateMDIWindowW proto WINAPI :LPWSTR, :LPWSTR, :DWORD, :SINT, :SINT, :SINT, :SINT, :HWND, :HINSTANCE, :LPARAM
ifdef _UNICODE
CreateMDIWindow		equ <CreateMDIWindowW>
else
CreateMDIWindow		equ <CreateMDIWindowA>
endif

if(WINVER GE 0x0400)
TileWindows proto WINAPI :HWND, :UINT, :LPRECT, :UINT, :ptr HWND
CascadeWindows proto WINAPI :HWND, :UINT, :LPRECT, :UINT, :ptr HWND
endif
endif

endif

ifndef NOHELP

HELPPOLY		typedef DWORD
MULTIKEYHELPA		STRUC
mkSize			dd ?
mkKeylist		CHAR ?
szKeyphrase		CHAR ?
MULTIKEYHELPA		ENDS
PMULTIKEYHELPA		typedef ptr MULTIKEYHELPA
LPMULTIKEYHELPA		typedef ptr MULTIKEYHELPA
MULTIKEYHELPW		STRUC
mkSize			dd ?
mkKeylist		WCHAR ?
szKeyphrase		WCHAR ?
MULTIKEYHELPW		ENDS
PMULTIKEYHELPW		typedef ptr MULTIKEYHELPW
LPMULTIKEYHELPW		typedef ptr MULTIKEYHELPW
ifdef _UNICODE
MULTIKEYHELP		typedef MULTIKEYHELPW
PMULTIKEYHELP		typedef PMULTIKEYHELPW
LPMULTIKEYHELP		typedef LPMULTIKEYHELPW
else
MULTIKEYHELP		typedef MULTIKEYHELPA
PMULTIKEYHELP		typedef PMULTIKEYHELPA
LPMULTIKEYHELP		typedef LPMULTIKEYHELPA
endif

HELPWININFOA		STRUC
wStructSize		SINT ?
x			SINT ?
y			SINT ?
_dx			SINT ?
dy			SINT ?
wMax			SINT ?
rgchMember		CHAR 2 dup(?)
HELPWININFOA		ENDS
PHELPWININFOA		typedef ptr HELPWININFOA
LPHELPWININFOA		typedef ptr HELPWININFOA
HELPWININFOW		STRUC
wStructSize		SINT ?
x			SINT ?
y			SINT ?
_dx			SINT ?
dy			SINT ?
wMax			SINT ?
rgchMember		WCHAR 2 dup(?)
HELPWININFOW		ENDS
PHELPWININFOW		typedef ptr HELPWININFOW
LPHELPWININFOW		typedef ptr HELPWININFOW
ifdef _UNICODE
HELPWININFO		typedef HELPWININFOW
PHELPWININFO		typedef PHELPWININFOW
LPHELPWININFO		typedef LPHELPWININFOW
else
HELPWININFO		typedef HELPWININFOA
PHELPWININFO		typedef PHELPWININFOA
LPHELPWININFO		typedef LPHELPWININFOA
endif


HELP_CONTEXT		equ 0x0001
HELP_QUIT		equ 0x0002
HELP_INDEX		equ 0x0003
HELP_CONTENTS		equ 0x0003
HELP_HELPONHELP		equ 0x0004
HELP_SETINDEX		equ 0x0005
HELP_SETCONTENTS	equ 0x0005
HELP_CONTEXTPOPUP	equ 0x0008
HELP_FORCEFILE		equ 0x0009
HELP_KEY		equ 0x0101
HELP_COMMAND		equ 0x0102
HELP_PARTIALKEY		equ 0x0105
HELP_MULTIKEY		equ 0x0201
HELP_SETWINPOS		equ 0x0203
if(WINVER GE 0x0400)
HELP_CONTEXTMENU	equ 0x000a
HELP_FINDER		equ 0x000b
HELP_WM_HELP		equ 0x000c
HELP_SETPOPUP_POS	equ 0x000d

HELP_TCARD		equ 0x8000
HELP_TCARD_DATA		equ 0x0010
HELP_TCARD_OTHER_CALLER equ 0x0011

IDH_NO_HELP		equ 28440
IDH_MISSING_CONTEXT	equ 28441
IDH_GENERIC_HELP_BUTTON equ 28442
IDH_OK			equ 28443
IDH_CANCEL		equ 28444
IDH_HELP		equ 28445

endif

WinHelpA proto WINAPI :HWND, :LPCSTR, :UINT, :ULONG_PTR
WinHelpW proto WINAPI :HWND, :LPCWSTR, :UINT, :ULONG_PTR
ifdef _UNICODE
WinHelp			equ <WinHelpW>
else
WinHelp			equ <WinHelpA>
endif

endif

if(WINVER GE 0x0500)
GR_GDIOBJECTS		equ 0
GR_USEROBJECTS		equ 1
if(WINVER GE 0x0601)
GR_GDIOBJECTS_PEAK	equ 2
GR_USEROBJECTS_PEAK	equ 4
endif
if(WINVER GE 0x0601)
GR_GLOBAL		equ (-2)
endif
endif

if(WINVER GE 0x0500)
GetGuiResources proto WINAPI :HANDLE, :DWORD
endif

ifndef NOSYSPARAMSINFO

SPI_GETBEEP		equ 1
SPI_SETBEEP		equ 2
SPI_GETMOUSE		equ 3
SPI_SETMOUSE		equ 4
SPI_GETBORDER		equ 5
SPI_SETBORDER		equ 6
SPI_GETKEYBOARDSPEED	equ 10
SPI_SETKEYBOARDSPEED	equ 11
SPI_LANGDRIVER		equ 12
SPI_ICONHORIZONTALSPACING equ 13
SPI_GETSCREENSAVETIMEOUT equ 14
SPI_SETSCREENSAVETIMEOUT equ 15
SPI_GETSCREENSAVEACTIVE equ 16
SPI_SETSCREENSAVEACTIVE equ 17
SPI_GETGRIDGRANULARITY	equ 18
SPI_SETGRIDGRANULARITY	equ 19
SPI_SETDESKWALLPAPER	equ 20
SPI_SETDESKPATTERN	equ 21
SPI_GETKEYBOARDDELAY	equ 22
SPI_SETKEYBOARDDELAY	equ 23
SPI_ICONVERTICALSPACING equ 24
SPI_GETICONTITLEWRAP	equ 25
SPI_SETICONTITLEWRAP	equ 26
SPI_GETMENUDROPALIGNMENT equ 27
SPI_SETMENUDROPALIGNMENT equ 28
SPI_SETDOUBLECLKWIDTH	equ 29
SPI_SETDOUBLECLKHEIGHT	equ 30
SPI_GETICONTITLELOGFONT equ 31
SPI_SETDOUBLECLICKTIME	equ 32
SPI_SETMOUSEBUTTONSWAP	equ 33
SPI_SETICONTITLELOGFONT equ 34
SPI_GETFASTTASKSWITCH	equ 35
SPI_SETFASTTASKSWITCH	equ 36
if(WINVER GE 0x0400)
SPI_SETDRAGFULLWINDOWS	equ 37
SPI_GETDRAGFULLWINDOWS	equ 38
SPI_GETNONCLIENTMETRICS equ 41
SPI_SETNONCLIENTMETRICS equ 42
SPI_GETMINIMIZEDMETRICS equ 43
SPI_SETMINIMIZEDMETRICS equ 44
SPI_GETICONMETRICS	equ 45
SPI_SETICONMETRICS	equ 46
SPI_SETWORKAREA		equ 47
SPI_GETWORKAREA		equ 48
SPI_SETPENWINDOWS	equ 49

SPI_GETHIGHCONTRAST	equ 66
SPI_SETHIGHCONTRAST	equ 67
SPI_GETKEYBOARDPREF	equ 68
SPI_SETKEYBOARDPREF	equ 69
SPI_GETSCREENREADER	equ 70
SPI_SETSCREENREADER	equ 71
SPI_GETANIMATION	equ 72
SPI_SETANIMATION	equ 73
SPI_GETFONTSMOOTHING	equ 74
SPI_SETFONTSMOOTHING	equ 75
SPI_SETDRAGWIDTH	equ 76
SPI_SETDRAGHEIGHT	equ 77
SPI_SETHANDHELD		equ 78
SPI_GETLOWPOWERTIMEOUT	equ 79
SPI_GETPOWEROFFTIMEOUT	equ 80
SPI_SETLOWPOWERTIMEOUT	equ 81
SPI_SETPOWEROFFTIMEOUT	equ 82
SPI_GETLOWPOWERACTIVE	equ 83
SPI_GETPOWEROFFACTIVE	equ 84
SPI_SETLOWPOWERACTIVE	equ 85
SPI_SETPOWEROFFACTIVE	equ 86
SPI_SETCURSORS		equ 87
SPI_SETICONS		equ 88
SPI_GETDEFAULTINPUTLANG equ 89
SPI_SETDEFAULTINPUTLANG equ 90
SPI_SETLANGTOGGLE	equ 91
SPI_GETWINDOWSEXTENSION equ 92
SPI_SETMOUSETRAILS	equ 93
SPI_GETMOUSETRAILS	equ 94
SPI_SETSCREENSAVERRUNNING equ 97
SPI_SCREENSAVERRUNNING	equ SPI_SETSCREENSAVERRUNNING
endif
SPI_GETFILTERKEYS	equ 0x0032
SPI_SETFILTERKEYS	equ 0x0033
SPI_GETTOGGLEKEYS	equ 0x0034
SPI_SETTOGGLEKEYS	equ 0x0035
SPI_GETMOUSEKEYS	equ 0x0036
SPI_SETMOUSEKEYS	equ 0x0037
SPI_GETSHOWSOUNDS	equ 0x0038
SPI_SETSHOWSOUNDS	equ 0x0039
SPI_GETSTICKYKEYS	equ 0x003A
SPI_SETSTICKYKEYS	equ 0x003B
SPI_GETACCESSTIMEOUT	equ 0x003C
SPI_SETACCESSTIMEOUT	equ 0x003D
if(WINVER GE 0x0400)
SPI_GETSERIALKEYS	equ 0x003E
SPI_SETSERIALKEYS	equ 0x003F
endif
SPI_GETSOUNDSENTRY	equ 0x0040
SPI_SETSOUNDSENTRY	equ 0x0041
if(_WIN32_WINNT GE 0x0400)
SPI_GETSNAPTODEFBUTTON	equ 0x005F
SPI_SETSNAPTODEFBUTTON	equ 0x0060
endif

if (_WIN32_WINNT GE 0x0400) OR (_WIN32_WINDOWS GT 0x0400)
SPI_GETMOUSEHOVERWIDTH	equ 0x0062
SPI_SETMOUSEHOVERWIDTH	equ 0x0063
SPI_GETMOUSEHOVERHEIGHT equ 0x0064
SPI_SETMOUSEHOVERHEIGHT equ 0x0065
SPI_GETMOUSEHOVERTIME	equ 0x0066
SPI_SETMOUSEHOVERTIME	equ 0x0067
SPI_GETWHEELSCROLLLINES equ 0x0068
SPI_SETWHEELSCROLLLINES equ 0x0069
SPI_GETMENUSHOWDELAY	equ 0x006A
SPI_SETMENUSHOWDELAY	equ 0x006B
if (_WIN32_WINNT GE 0x0600)
SPI_GETWHEELSCROLLCHARS equ 0x006C
SPI_SETWHEELSCROLLCHARS equ 0x006D
endif
SPI_GETSHOWIMEUI	equ 0x006E
SPI_SETSHOWIMEUI	equ 0x006F
endif

if(WINVER GE 0x0500)
SPI_GETMOUSESPEED	equ 0x0070
SPI_SETMOUSESPEED	equ 0x0071
SPI_GETSCREENSAVERRUNNING equ 0x0072
SPI_GETDESKWALLPAPER	equ 0x0073
endif

if(WINVER GE 0x0600)
SPI_GETAUDIODESCRIPTION equ 0x0074
SPI_SETAUDIODESCRIPTION equ 0x0075
SPI_GETSCREENSAVESECURE equ 0x0076
SPI_SETSCREENSAVESECURE equ 0x0077
endif

if(_WIN32_WINNT GE 0x0601)
SPI_GETHUNGAPPTIMEOUT	equ 0x0078
SPI_SETHUNGAPPTIMEOUT	equ 0x0079
SPI_GETWAITTOKILLTIMEOUT equ 0x007A
SPI_SETWAITTOKILLTIMEOUT equ 0x007B
SPI_GETWAITTOKILLSERVICETIMEOUT equ 0x007C
SPI_SETWAITTOKILLSERVICETIMEOUT equ 0x007D
SPI_GETMOUSEDOCKTHRESHOLD equ 0x007E
SPI_SETMOUSEDOCKTHRESHOLD equ 0x007F
SPI_GETPENDOCKTHRESHOLD equ 0x0080
SPI_SETPENDOCKTHRESHOLD equ 0x0081
SPI_GETWINARRANGING	equ 0x0082
SPI_SETWINARRANGING	equ 0x0083
SPI_GETMOUSEDRAGOUTTHRESHOLD equ 0x0084
SPI_SETMOUSEDRAGOUTTHRESHOLD equ 0x0085
SPI_GETPENDRAGOUTTHRESHOLD equ 0x0086
SPI_SETPENDRAGOUTTHRESHOLD equ 0x0087
SPI_GETMOUSESIDEMOVETHRESHOLD equ 0x0088
SPI_SETMOUSESIDEMOVETHRESHOLD equ 0x0089
SPI_GETPENSIDEMOVETHRESHOLD equ 0x008A
SPI_SETPENSIDEMOVETHRESHOLD equ 0x008B
SPI_GETDRAGFROMMAXIMIZE equ 0x008C
SPI_SETDRAGFROMMAXIMIZE equ 0x008D
SPI_GETSNAPSIZING	equ 0x008E
SPI_SETSNAPSIZING	equ 0x008F
SPI_GETDOCKMOVING	equ 0x0090
SPI_SETDOCKMOVING	equ 0x0091
endif

if(WINVER GE 0x0500)
SPI_GETACTIVEWINDOWTRACKING equ 0x1000
SPI_SETACTIVEWINDOWTRACKING equ 0x1001
SPI_GETMENUANIMATION	equ 0x1002
SPI_SETMENUANIMATION	equ 0x1003
SPI_GETCOMBOBOXANIMATION equ 0x1004
SPI_SETCOMBOBOXANIMATION equ 0x1005
SPI_GETLISTBOXSMOOTHSCROLLING equ 0x1006
SPI_SETLISTBOXSMOOTHSCROLLING equ 0x1007
SPI_GETGRADIENTCAPTIONS equ 0x1008
SPI_SETGRADIENTCAPTIONS equ 0x1009
SPI_GETKEYBOARDCUES	equ 0x100A
SPI_SETKEYBOARDCUES	equ 0x100B
SPI_GETMENUUNDERLINES	equ SPI_GETKEYBOARDCUES
SPI_SETMENUUNDERLINES	equ SPI_SETKEYBOARDCUES
SPI_GETACTIVEWNDTRKZORDER equ 0x100C
SPI_SETACTIVEWNDTRKZORDER equ 0x100D
SPI_GETHOTTRACKING	equ 0x100E
SPI_SETHOTTRACKING	equ 0x100F
SPI_GETMENUFADE		equ 0x1012
SPI_SETMENUFADE		equ 0x1013
SPI_GETSELECTIONFADE	equ 0x1014
SPI_SETSELECTIONFADE	equ 0x1015
SPI_GETTOOLTIPANIMATION equ 0x1016
SPI_SETTOOLTIPANIMATION equ 0x1017
SPI_GETTOOLTIPFADE	equ 0x1018
SPI_SETTOOLTIPFADE	equ 0x1019
SPI_GETCURSORSHADOW	equ 0x101A
SPI_SETCURSORSHADOW	equ 0x101B
if(_WIN32_WINNT GE 0x0501)
SPI_GETMOUSESONAR	equ 0x101C
SPI_SETMOUSESONAR	equ 0x101D
SPI_GETMOUSECLICKLOCK	equ 0x101E
SPI_SETMOUSECLICKLOCK	equ 0x101F
SPI_GETMOUSEVANISH	equ 0x1020
SPI_SETMOUSEVANISH	equ 0x1021
SPI_GETFLATMENU		equ 0x1022
SPI_SETFLATMENU		equ 0x1023
SPI_GETDROPSHADOW	equ 0x1024
SPI_SETDROPSHADOW	equ 0x1025
SPI_GETBLOCKSENDINPUTRESETS equ 0x1026
SPI_SETBLOCKSENDINPUTRESETS equ 0x1027
endif

SPI_GETUIEFFECTS	equ 0x103E
SPI_SETUIEFFECTS	equ 0x103F

if(_WIN32_WINNT GE 0x0600)
SPI_GETDISABLEOVERLAPPEDCONTENT equ 0x1040
SPI_SETDISABLEOVERLAPPEDCONTENT equ 0x1041
SPI_GETCLIENTAREAANIMATION equ 0x1042
SPI_SETCLIENTAREAANIMATION equ 0x1043
SPI_GETCLEARTYPE	equ 0x1048
SPI_SETCLEARTYPE	equ 0x1049
SPI_GETSPEECHRECOGNITION equ 0x104A
SPI_SETSPEECHRECOGNITION equ 0x104B
endif

SPI_GETFOREGROUNDLOCKTIMEOUT equ 0x2000
SPI_SETFOREGROUNDLOCKTIMEOUT equ 0x2001
SPI_GETACTIVEWNDTRKTIMEOUT equ 0x2002
SPI_SETACTIVEWNDTRKTIMEOUT equ 0x2003
SPI_GETFOREGROUNDFLASHCOUNT equ 0x2004
SPI_SETFOREGROUNDFLASHCOUNT equ 0x2005
SPI_GETCARETWIDTH	equ 0x2006
SPI_SETCARETWIDTH	equ 0x2007

if(_WIN32_WINNT GE 0x0501)
SPI_GETMOUSECLICKLOCKTIME equ 0x2008
SPI_SETMOUSECLICKLOCKTIME equ 0x2009
SPI_GETFONTSMOOTHINGTYPE equ 0x200A
SPI_SETFONTSMOOTHINGTYPE equ 0x200B

FE_FONTSMOOTHINGSTANDARD equ 0x0001
FE_FONTSMOOTHINGCLEARTYPE equ 0x0002

SPI_GETFONTSMOOTHINGCONTRAST equ 0x200C
SPI_SETFONTSMOOTHINGCONTRAST equ 0x200D

SPI_GETFOCUSBORDERWIDTH equ 0x200E
SPI_SETFOCUSBORDERWIDTH equ 0x200F
SPI_GETFOCUSBORDERHEIGHT equ 0x2010
SPI_SETFOCUSBORDERHEIGHT equ 0x2011

SPI_GETFONTSMOOTHINGORIENTATION equ 0x2012
SPI_SETFONTSMOOTHINGORIENTATION equ 0x2013

FE_FONTSMOOTHINGORIENTATIONBGR equ 0x0000
FE_FONTSMOOTHINGORIENTATIONRGB equ 0x0001
endif

if(_WIN32_WINNT GE 0x0600)
SPI_GETMINIMUMHITRADIUS equ 0x2014
SPI_SETMINIMUMHITRADIUS equ 0x2015
SPI_GETMESSAGEDURATION	equ 0x2016
SPI_SETMESSAGEDURATION	equ 0x2017
endif

endif

SPIF_UPDATEINIFILE	equ 0x0001
SPIF_SENDWININICHANGE	equ 0x0002
SPIF_SENDCHANGE		equ SPIF_SENDWININICHANGE

METRICS_USEDEFAULT	equ -1
ifdef _WINGDI_
ifndef NOGDI
NONCLIENTMETRICSA	STRUC
cbSize			UINT ?
iBorderWidth		SINT ?
iScrollWidth		SINT ?
iScrollHeight		SINT ?
iCaptionWidth		SINT ?
iCaptionHeight		SINT ?
lfCaptionFont		LOGFONTA <>
iSmCaptionWidth		SINT ?
iSmCaptionHeight	SINT ?
lfSmCaptionFont		LOGFONTA <>
iMenuWidth		SINT ?
iMenuHeight		SINT ?
lfMenuFont		LOGFONTA <>
lfStatusFont		LOGFONTA <>
lfMessageFont		LOGFONTA <>
if(WINVER GE 0x0600)
iPaddedBorderWidth	SINT ?
endif
NONCLIENTMETRICSA	ENDS
PNONCLIENTMETRICSA	typedef ptr NONCLIENTMETRICSA
LPNONCLIENTMETRICSA	typedef ptr NONCLIENTMETRICSA
NONCLIENTMETRICSW	STRUC
cbSize			UINT ?
iBorderWidth		SINT ?
iScrollWidth		SINT ?
iScrollHeight		SINT ?
iCaptionWidth		SINT ?
iCaptionHeight		SINT ?
lfCaptionFont		LOGFONTW <>
iSmCaptionWidth		SINT ?
iSmCaptionHeight	SINT ?
lfSmCaptionFont		LOGFONTW <>
iMenuWidth		SINT ?
iMenuHeight		SINT ?
lfMenuFont		LOGFONTW <>
lfStatusFont		LOGFONTW <>
lfMessageFont		LOGFONTW <>
if(WINVER GE 0x0600)
iPaddedBorderWidth	SINT ?
endif
NONCLIENTMETRICSW	ENDS
PNONCLIENTMETRICSW	typedef ptr NONCLIENTMETRICSW
LPNONCLIENTMETRICSW	typedef ptr NONCLIENTMETRICSW
ifdef _UNICODE
NONCLIENTMETRICS	typedef NONCLIENTMETRICSW
PNONCLIENTMETRICS	typedef PNONCLIENTMETRICSW
LPNONCLIENTMETRICS	typedef LPNONCLIENTMETRICSW
else
NONCLIENTMETRICS	typedef NONCLIENTMETRICSA
PNONCLIENTMETRICS	typedef PNONCLIENTMETRICSA
LPNONCLIENTMETRICS	typedef LPNONCLIENTMETRICSA
endif
endif
endif

ARW_BOTTOMLEFT		equ 0x0000
ARW_BOTTOMRIGHT		equ 0x0001
ARW_TOPLEFT		equ 0x0002
ARW_TOPRIGHT		equ 0x0003
ARW_STARTMASK		equ 0x0003
ARW_STARTRIGHT		equ 0x0001
ARW_STARTTOP		equ 0x0002

ARW_LEFT		equ 0x0000
ARW_RIGHT		equ 0x0000
ARW_UP			equ 0x0004
ARW_DOWN		equ 0x0004
ARW_HIDE		equ 0x0008

MINIMIZEDMETRICS	STRUC
cbSize			UINT ?
iWidth			SINT ?
iHorzGap		SINT ?
iVertGap		SINT ?
iArrange		SINT ?
MINIMIZEDMETRICS	ENDS
PMINIMIZEDMETRICS	typedef ptr MINIMIZEDMETRICS
LPMINIMIZEDMETRICS	typedef ptr MINIMIZEDMETRICS

ifdef _WINGDI_
ifndef NOGDI
ICONMETRICSA		STRUC
cbSize			UINT ?
iHorzSpacing		SINT ?
iVertSpacing		SINT ?
iTitleWrap		SINT ?
lfFont			LOGFONTA <>
ICONMETRICSA		ENDS
PICONMETRICSA		typedef ptr ICONMETRICSA
LPICONMETRICSA		typedef ptr ICONMETRICSA
ICONMETRICSW		STRUC
cbSize			UINT ?
iHorzSpacing		SINT ?
iVertSpacing		SINT ?
iTitleWrap		SINT ?
lfFont			LOGFONTW <>
ICONMETRICSW		ENDS
PICONMETRICSW		typedef ptr ICONMETRICSW
LPICONMETRICSW		typedef ptr ICONMETRICSW
ifdef _UNICODE
ICONMETRICS		typedef ICONMETRICSW
PICONMETRICS		typedef PICONMETRICSW
LPICONMETRICS		typedef LPICONMETRICSW
else
ICONMETRICS		typedef ICONMETRICSA
PICONMETRICS		typedef PICONMETRICSA
LPICONMETRICS		typedef LPICONMETRICSA
endif
endif
endif

ANIMATIONINFO		STRUC
cbSize			UINT ?
iMinAnimate		SINT ?
ANIMATIONINFO		ENDS
LPANIMATIONINFO		typedef ptr ANIMATIONINFO

SERIALKEYSA		STRUC
cbSize			UINT ?
dwFlags			dd ?
lpszActivePort		LPSTR ?
lpszPort		LPSTR ?
iBaudRate		UINT ?
iPortState		UINT ?
iActive			UINT ?
SERIALKEYSA		ENDS
LPSERIALKEYSA		typedef ptr SERIALKEYSA
SERIALKEYSW		STRUC
cbSize			UINT ?
dwFlags			dd ?
lpszActivePort		LPWSTR ?
lpszPort		LPWSTR ?
iBaudRate		UINT ?
iPortState		UINT ?
iActive			UINT ?
SERIALKEYSW		ENDS
LPSERIALKEYSW		typedef ptr SERIALKEYSW
ifdef _UNICODE
SERIALKEYS		typedef SERIALKEYSW
LPSERIALKEYS		typedef LPSERIALKEYSW
else
SERIALKEYS		typedef SERIALKEYSA
LPSERIALKEYS		typedef LPSERIALKEYSA
endif

SERKF_SERIALKEYSON	equ 0x00000001
SERKF_AVAILABLE		equ 0x00000002
SERKF_INDICATOR		equ 0x00000004

HIGHCONTRASTA		STRUC
cbSize			UINT ?
dwFlags			dd ?
lpszDefaultScheme	LPSTR ?
HIGHCONTRASTA		ENDS
LPHIGHCONTRASTA		typedef ptr HIGHCONTRASTA
HIGHCONTRASTW		STRUC
cbSize			UINT ?
dwFlags			dd ?
lpszDefaultScheme	LPWSTR ?
HIGHCONTRASTW		ENDS
LPHIGHCONTRASTW		typedef ptr HIGHCONTRASTW
ifdef _UNICODE
HIGHCONTRAST		typedef HIGHCONTRASTW
LPHIGHCONTRAST		typedef LPHIGHCONTRASTW
else
HIGHCONTRAST		typedef HIGHCONTRASTA
LPHIGHCONTRAST		typedef LPHIGHCONTRASTA
endif

HCF_HIGHCONTRASTON	equ 0x00000001
HCF_AVAILABLE		equ 0x00000002
HCF_HOTKEYACTIVE	equ 0x00000004
HCF_CONFIRMHOTKEY	equ 0x00000008
HCF_HOTKEYSOUND		equ 0x00000010
HCF_INDICATOR		equ 0x00000020
HCF_HOTKEYAVAILABLE	equ 0x00000040
HCF_LOGONDESKTOP	equ 0x00000100
HCF_DEFAULTDESKTOP	equ 0x00000200

CDS_UPDATEREGISTRY	equ 0x00000001
CDS_TEST		equ 0x00000002
CDS_FULLSCREEN		equ 0x00000004
CDS_GLOBAL		equ 0x00000008
CDS_SET_PRIMARY		equ 0x00000010
CDS_VIDEOPARAMETERS	equ 0x00000020
if(WINVER GE 0x0600)
CDS_ENABLE_UNSAFE_MODES equ 0x00000100
CDS_DISABLE_UNSAFE_MODES equ 0x00000200
endif
CDS_RESET		equ 0x40000000
CDS_SETRECT		equ 0x20000000
CDS_NORESET		equ 0x10000000

include tvout.inc

DISP_CHANGE_SUCCESSFUL	equ 0
DISP_CHANGE_RESTART	equ 1
DISP_CHANGE_FAILED	equ -1
DISP_CHANGE_BADMODE	equ -2
DISP_CHANGE_NOTUPDATED	equ -3
DISP_CHANGE_BADFLAGS	equ -4
DISP_CHANGE_BADPARAM	equ -5
if(_WIN32_WINNT GE 0x0501)
DISP_CHANGE_BADDUALVIEW equ -6
endif

ifdef _WINGDI_
ifndef NOGDI

ChangeDisplaySettingsA proto WINAPI :LPDEVMODEA, :DWORD
ChangeDisplaySettingsW proto WINAPI :LPDEVMODEW, :DWORD
ifdef _UNICODE
ChangeDisplaySettings	equ <ChangeDisplaySettingsW>
else
ChangeDisplaySettings	equ <ChangeDisplaySettingsA>
endif

ChangeDisplaySettingsExA proto WINAPI :LPCSTR, :LPDEVMODEA, :HWND, :DWORD, :ptr
ChangeDisplaySettingsExW proto WINAPI :LPCWSTR, :LPDEVMODEW, :HWND, :DWORD, :ptr
ifdef _UNICODE
ChangeDisplaySettingsEx equ <ChangeDisplaySettingsExW>
else
ChangeDisplaySettingsEx equ <ChangeDisplaySettingsExA>
endif

ENUM_CURRENT_SETTINGS	equ (-1)
ENUM_REGISTRY_SETTINGS	equ (-2)

EnumDisplaySettingsA proto WINAPI :LPCSTR, :DWORD, :LPDEVMODEA
EnumDisplaySettingsW proto WINAPI :LPCWSTR, :DWORD, :LPDEVMODEW
ifdef _UNICODE
EnumDisplaySettings	equ <EnumDisplaySettingsW>
else
EnumDisplaySettings	equ <EnumDisplaySettingsA>
endif

if(WINVER GE 0x0500)
EnumDisplaySettingsExA proto WINAPI :LPCSTR, :DWORD, :LPDEVMODEA, :DWORD
EnumDisplaySettingsExW proto WINAPI :LPCWSTR, :DWORD, :LPDEVMODEA, :DWORD
ifdef _UNICODE
EnumDisplaySettingsEx	equ <EnumDisplaySettingsExW>
else
EnumDisplaySettingsEx	equ <EnumDisplaySettingsExA>
endif

EDS_RAWMODE		equ 0x00000002
EDS_ROTATEDMODE		equ 0x00000004

EnumDisplayDevicesA proto WINAPI :ptr, :DWORD, :PDISPLAY_DEVICEA, :DWORD
EnumDisplayDevicesW proto WINAPI :ptr, :DWORD, :PDISPLAY_DEVICEW, :DWORD
ifdef _UNICODE
EnumDisplayDevices	equ <EnumDisplayDevicesW>
else
EnumDisplayDevices	equ <EnumDisplayDevicesA>
endif

EDD_GET_DEVICE_INTERFACE_NAME equ 0x00000001

endif

if(WINVER GE 0x0601)
GetDisplayConfigBufferSizes proto WINAPI :UINT, :ptr, :ptr
SetDisplayConfig proto WINAPI :ptr, :UINT, :ptr, :UINT
QueryDisplayConfig proto WINAPI :UINT, :ptr, :ptr, :ptr, :ptr
DisplayConfigGetDeviceInfo proto WINAPI :ptr
DisplayConfigSetDeviceInfo proto WINAPI :ptr
endif

endif
endif

SystemParametersInfoA proto WINAPI :UINT, :UINT, :ptr, :UINT
SystemParametersInfoW proto WINAPI :UINT, :UINT, :ptr, :UINT
ifdef _UNICODE
SystemParametersInfo	equ <SystemParametersInfoW>
else
SystemParametersInfo	equ <SystemParametersInfoA>
endif

endif

FILTERKEYS		STRUC
cbSize			UINT ?
dwFlags			dd ?
iWaitMSec		dd ?
iDelayMSec		dd ?
iRepeatMSec		dd ?
iBounceMSec		dd ?
FILTERKEYS		ENDS
LPFILTERKEYS		typedef ptr FILTERKEYS

FKF_FILTERKEYSON	equ 0x00000001
FKF_AVAILABLE		equ 0x00000002
FKF_HOTKEYACTIVE	equ 0x00000004
FKF_CONFIRMHOTKEY	equ 0x00000008
FKF_HOTKEYSOUND		equ 0x00000010
FKF_INDICATOR		equ 0x00000020
FKF_CLICKON		equ 0x00000040

STICKYKEYS		STRUC
cbSize			UINT ?
dwFlags			dd ?
STICKYKEYS		ENDS
LPSTICKYKEYS		typedef ptr STICKYKEYS

SKF_STICKYKEYSON	equ 0x00000001
SKF_AVAILABLE		equ 0x00000002
SKF_HOTKEYACTIVE	equ 0x00000004
SKF_CONFIRMHOTKEY	equ 0x00000008
SKF_HOTKEYSOUND		equ 0x00000010
SKF_INDICATOR		equ 0x00000020
SKF_AUDIBLEFEEDBACK	equ 0x00000040
SKF_TRISTATE		equ 0x00000080
SKF_TWOKEYSOFF		equ 0x00000100
if(_WIN32_WINNT GE 0x0500)
SKF_LALTLATCHED		equ 0x10000000
SKF_LCTLLATCHED		equ 0x04000000
SKF_LSHIFTLATCHED	equ 0x01000000
SKF_RALTLATCHED		equ 0x20000000
SKF_RCTLLATCHED		equ 0x08000000
SKF_RSHIFTLATCHED	equ 0x02000000
SKF_LWINLATCHED		equ 0x40000000
SKF_RWINLATCHED		equ 0x80000000
SKF_LALTLOCKED		equ 0x00100000
SKF_LCTLLOCKED		equ 0x00040000
SKF_LSHIFTLOCKED	equ 0x00010000
SKF_RALTLOCKED		equ 0x00200000
SKF_RCTLLOCKED		equ 0x00080000
SKF_RSHIFTLOCKED	equ 0x00020000
SKF_LWINLOCKED		equ 0x00400000
SKF_RWINLOCKED		equ 0x00800000
endif

MOUSEKEYS		STRUC
cbSize			UINT ?
dwFlags			dd ?
iMaxSpeed		dd ?
iTimeToMaxSpeed		dd ?
iCtrlSpeed		dd ?
dwReserved1		dd ?
dwReserved2		dd ?
MOUSEKEYS		ENDS
LPMOUSEKEYS		typedef ptr MOUSEKEYS

MKF_MOUSEKEYSON		equ 0x00000001
MKF_AVAILABLE		equ 0x00000002
MKF_HOTKEYACTIVE	equ 0x00000004
MKF_CONFIRMHOTKEY	equ 0x00000008
MKF_HOTKEYSOUND		equ 0x00000010
MKF_INDICATOR		equ 0x00000020
MKF_MODIFIERS		equ 0x00000040
MKF_REPLACENUMBERS	equ 0x00000080
if(_WIN32_WINNT GE 0x0500)
MKF_LEFTBUTTONSEL	equ 0x10000000
MKF_RIGHTBUTTONSEL	equ 0x20000000
MKF_LEFTBUTTONDOWN	equ 0x01000000
MKF_RIGHTBUTTONDOWN	equ 0x02000000
MKF_MOUSEMODE		equ 0x80000000
endif

ACCESSTIMEOUT		STRUC
cbSize			UINT ?
dwFlags			dd ?
iTimeOutMSec		dd ?
ACCESSTIMEOUT		ENDS
LPACCESSTIMEOUT		typedef ptr ACCESSTIMEOUT

ATF_TIMEOUTON		equ 0x00000001
ATF_ONOFFFEEDBACK	equ 0x00000002

SSGF_NONE		equ 0
SSGF_DISPLAY		equ 3

SSTF_NONE		equ 0
SSTF_CHARS		equ 1
SSTF_BORDER		equ 2
SSTF_DISPLAY		equ 3

SSWF_NONE		equ 0
SSWF_TITLE		equ 1
SSWF_WINDOW		equ 2
SSWF_DISPLAY		equ 3
SSWF_CUSTOM		equ 4

SOUNDSENTRYA		STRUC
cbSize			UINT ?
dwFlags			dd ?
iFSTextEffect		dd ?
iFSTextEffectMSec	dd ?
iFSTextEffectColorBits	dd ?
iFSGrafEffect		dd ?
iFSGrafEffectMSec	dd ?
iFSGrafEffectColor	dd ?
iWindowsEffect		dd ?
iWindowsEffectMSec	dd ?
lpszWindowsEffectDLL	LPSTR ?
iWindowsEffectOrdinal	dd ?
SOUNDSENTRYA		ENDS
LPSOUNDSENTRYA		typedef ptr SOUNDSENTRYA
SOUNDSENTRYW		STRUC
cbSize			UINT ?
dwFlags			dd ?
iFSTextEffect		dd ?
iFSTextEffectMSec	dd ?
iFSTextEffectColorBits	dd ?
iFSGrafEffect		dd ?
iFSGrafEffectMSec	dd ?
iFSGrafEffectColor	dd ?
iWindowsEffect		dd ?
iWindowsEffectMSec	dd ?
lpszWindowsEffectDLL	LPWSTR ?
iWindowsEffectOrdinal	dd ?
SOUNDSENTRYW		ENDS
LPSOUNDSENTRYW		typedef ptr SOUNDSENTRYW
ifdef _UNICODE
SOUNDSENTRY		typedef SOUNDSENTRYW
LPSOUNDSENTRY		typedef LPSOUNDSENTRYW
else
SOUNDSENTRY		typedef SOUNDSENTRYA
LPSOUNDSENTRY		typedef LPSOUNDSENTRYA
endif

SSF_SOUNDSENTRYON	equ 0x00000001
SSF_AVAILABLE		equ 0x00000002
SSF_INDICATOR		equ 0x00000004

if(_WIN32_WINNT GE 0x0600)
SoundSentry proto WINAPI
endif

TOGGLEKEYS		STRUC
cbSize			UINT ?
dwFlags			dd ?
TOGGLEKEYS		ENDS
LPTOGGLEKEYS		typedef ptr TOGGLEKEYS

TKF_TOGGLEKEYSON	equ 0x00000001
TKF_AVAILABLE		equ 0x00000002
TKF_HOTKEYACTIVE	equ 0x00000004
TKF_CONFIRMHOTKEY	equ 0x00000008
TKF_HOTKEYSOUND		equ 0x00000010
TKF_INDICATOR		equ 0x00000020

if(_WIN32_WINNT GE 0x0600)
AUDIODESCRIPTION	STRUC
cbSize			UINT ?
Enabled			BOOL ?
Locale			LCID ?
AUDIODESCRIPTION	ENDS
LPAUDIODESCRIPTION	typedef ptr AUDIODESCRIPTION
endif

SetDebugErrorLevel proto WINAPI :DWORD

SLE_ERROR		equ 0x00000001
SLE_MINORERROR		equ 0x00000002
SLE_WARNING		equ 0x00000003

SetLastErrorEx proto WINAPI :DWORD, :DWORD

if(WINVER GE 0x0500)

MONITOR_DEFAULTTONULL	equ 0x00000000
MONITOR_DEFAULTTOPRIMARY equ 0x00000001
MONITOR_DEFAULTTONEAREST equ 0x00000002

MonitorFromPoint proto WINAPI :POINT, :DWORD
MonitorFromRect proto WINAPI :LPCRECT, :DWORD
MonitorFromWindow proto WINAPI :HWND, : DWORD

MONITORINFOF_PRIMARY	equ 0x00000001

ifndef CCHDEVICENAME
CCHDEVICENAME		equ 32
endif

MONITORINFO		STRUC
cbSize			dd ?
rcMonitor		RECT <>
rcWork			RECT <>
dwFlags			dd ?
MONITORINFO		ENDS
LPMONITORINFO		typedef ptr MONITORINFO

.template MONITORINFOEXA : public MONITORINFO
	szDevice	db CCHDEVICENAME dup(?)
	.ends
.template MONITORINFOEXW : public MONITORINFO
	szDevice	dw CCHDEVICENAME dup(?)
	.ends

LPMONITORINFOEXA	typedef ptr MONITORINFOEXA
LPMONITORINFOEXW	typedef ptr MONITORINFOEXW
ifdef _UNICODE
MONITORINFOEX		typedef MONITORINFOEXW
LPMONITORINFOEX		typedef LPMONITORINFOEXW
else
MONITORINFOEX		typedef MONITORINFOEXA
LPMONITORINFOEX		typedef LPMONITORINFOEXA
endif

GetMonitorInfoA proto WINAPI :HMONITOR, :LPMONITORINFO
GetMonitorInfoW proto WINAPI :HMONITOR, :LPMONITORINFO
ifdef _UNICODE
GetMonitorInfo equ <GetMonitorInfoW>
else
GetMonitorInfo equ <GetMonitorInfoA>
endif

CALLBACK(MONITORENUMPROC, :HMONITOR, :HDC, :LPRECT, :LPARAM)

EnumDisplayMonitors proto WINAPI :HDC, :LPCRECT, :MONITORENUMPROC, :LPARAM

ifndef NOWINABLE

NotifyWinEvent proto WINAPI :DWORD, :HWND, :LONG, :LONG
CALLBACK(WINEVENTPROC, :HWINEVENTHOOK, :DWORD, :HWND, :LONG, :LONG, :DWORD, :DWORD)

if(_WIN32_WINNT GE 0x0501)
IsWinEventHookInstalled proto WINAPI :DWORD
endif

WINEVENT_OUTOFCONTEXT	equ 0x0000
WINEVENT_SKIPOWNTHREAD	equ 0x0001
WINEVENT_SKIPOWNPROCESS equ 0x0002
WINEVENT_INCONTEXT	equ 0x0004

UnhookWinEvent proto WINAPI :HWINEVENTHOOK

CHILDID_SELF		equ 0
INDEXID_OBJECT		equ 0
INDEXID_CONTAINER	equ 0

OBJID_WINDOW		equ 0x00000000
OBJID_SYSMENU		equ 0xFFFFFFFF
OBJID_TITLEBAR		equ 0xFFFFFFFE
OBJID_MENU		equ 0xFFFFFFFD
OBJID_CLIENT		equ 0xFFFFFFFC
OBJID_VSCROLL		equ 0xFFFFFFFB
OBJID_HSCROLL		equ 0xFFFFFFFA
OBJID_SIZEGRIP		equ 0xFFFFFFF9
OBJID_CARET		equ 0xFFFFFFF8
OBJID_CURSOR		equ 0xFFFFFFF7
OBJID_ALERT		equ 0xFFFFFFF6
OBJID_SOUND		equ 0xFFFFFFF5

EVENT_MIN		equ 0x00000001
EVENT_MAX		equ 0x7FFFFFFF
EVENT_SYSTEM_SOUND	equ 0x0001
EVENT_SYSTEM_ALERT	equ 0x0002
EVENT_SYSTEM_FOREGROUND equ 0x0003
EVENT_SYSTEM_MENUSTART	equ 0x0004
EVENT_SYSTEM_MENUEND	equ 0x0005
EVENT_SYSTEM_MENUPOPUPSTART equ 0x0006
EVENT_SYSTEM_MENUPOPUPEND equ 0x0007
EVENT_SYSTEM_CAPTURESTART equ 0x0008
EVENT_SYSTEM_CAPTUREEND equ 0x0009
EVENT_SYSTEM_MOVESIZESTART equ 0x000A
EVENT_SYSTEM_MOVESIZEEND equ 0x000B
EVENT_SYSTEM_CONTEXTHELPSTART equ 0x000C
EVENT_SYSTEM_CONTEXTHELPEND equ 0x000D
EVENT_SYSTEM_DRAGDROPSTART equ 0x000E
EVENT_SYSTEM_DRAGDROPEND equ 0x000F
EVENT_SYSTEM_DIALOGSTART equ 0x0010
EVENT_SYSTEM_DIALOGEND	equ 0x0011
EVENT_SYSTEM_SCROLLINGSTART equ 0x0012
EVENT_SYSTEM_SCROLLINGEND equ 0x0013
EVENT_SYSTEM_SWITCHSTART equ 0x0014
EVENT_SYSTEM_SWITCHEND	equ 0x0015
EVENT_SYSTEM_MINIMIZESTART equ 0x0016
EVENT_SYSTEM_MINIMIZEEND equ 0x0017

if(_WIN32_WINNT GE 0x0600)
EVENT_SYSTEM_DESKTOPSWITCH equ 0x0020
endif

if(_WIN32_WINNT GE 0x0601)
EVENT_SYSTEM_END	equ 0x00FF
EVENT_OEM_DEFINED_START equ 0x0101
EVENT_OEM_DEFINED_END	equ 0x01FF
EVENT_UIA_EVENTID_START equ 0x4E00
EVENT_UIA_EVENTID_END	equ 0x4EFF
EVENT_UIA_PROPID_START	equ 0x7500
EVENT_UIA_PROPID_END	equ 0x75FF
endif

if(_WIN32_WINNT GE 0x0501)
EVENT_CONSOLE_CARET	equ 0x4001
EVENT_CONSOLE_UPDATE_REGION equ 0x4002
EVENT_CONSOLE_UPDATE_SIMPLE equ 0x4003
EVENT_CONSOLE_UPDATE_SCROLL equ 0x4004
EVENT_CONSOLE_LAYOUT	equ 0x4005
EVENT_CONSOLE_START_APPLICATION equ 0x4006
EVENT_CONSOLE_END_APPLICATION equ 0x4007
ifdef _WIN64
CONSOLE_APPLICATION_16BIT equ 0x0000
else
CONSOLE_APPLICATION_16BIT equ 0x0001
endif
CONSOLE_CARET_SELECTION equ 0x0001
CONSOLE_CARET_VISIBLE	equ 0x0002
endif

if(_WIN32_WINNT GE 0x0601)
EVENT_CONSOLE_END	equ 0x40FF
endif

EVENT_OBJECT_CREATE	equ 0x8000
EVENT_OBJECT_DESTROY	equ 0x8001
EVENT_OBJECT_SHOW	equ 0x8002
EVENT_OBJECT_HIDE	equ 0x8003
EVENT_OBJECT_REORDER	equ 0x8004

EVENT_OBJECT_FOCUS	equ 0x8005
EVENT_OBJECT_SELECTION	equ 0x8006
EVENT_OBJECT_SELECTIONADD equ 0x8007
EVENT_OBJECT_SELECTIONREMOVE equ 0x8008
EVENT_OBJECT_SELECTIONWITHIN equ 0x8009

EVENT_OBJECT_STATECHANGE equ 0x800A
EVENT_OBJECT_LOCATIONCHANGE equ 0x800B

EVENT_OBJECT_NAMECHANGE equ 0x800C
EVENT_OBJECT_DESCRIPTIONCHANGE equ 0x800D
EVENT_OBJECT_VALUECHANGE equ 0x800E
EVENT_OBJECT_PARENTCHANGE equ 0x800F
EVENT_OBJECT_HELPCHANGE equ 0x8010
EVENT_OBJECT_DEFACTIONCHANGE equ 0x8011
EVENT_OBJECT_ACCELERATORCHANGE equ 0x8012

if(_WIN32_WINNT GE 0x0600)
EVENT_OBJECT_INVOKED	equ 0x8013
EVENT_OBJECT_TEXTSELECTIONCHANGED equ 0x8014
EVENT_OBJECT_CONTENTSCROLLED equ 0x8015
endif

if(_WIN32_WINNT GE 0x0601)
EVENT_SYSTEM_ARRANGMENTPREVIEW equ 0x8016
endif

if(_WIN32_WINNT GE 0x0601)
EVENT_OBJECT_END	equ 0x80FF
EVENT_AIA_START		equ 0xA000
EVENT_AIA_END		equ 0xAFFF
endif

SOUND_SYSTEM_STARTUP	equ 1
SOUND_SYSTEM_SHUTDOWN	equ 2
SOUND_SYSTEM_BEEP	equ 3
SOUND_SYSTEM_ERROR	equ 4
SOUND_SYSTEM_QUESTION	equ 5
SOUND_SYSTEM_WARNING	equ 6
SOUND_SYSTEM_INFORMATION equ 7
SOUND_SYSTEM_MAXIMIZE	equ 8
SOUND_SYSTEM_MINIMIZE	equ 9
SOUND_SYSTEM_RESTOREUP	equ 10
SOUND_SYSTEM_RESTOREDOWN equ 11
SOUND_SYSTEM_APPSTART	equ 12
SOUND_SYSTEM_FAULT	equ 13
SOUND_SYSTEM_APPEND	equ 14
SOUND_SYSTEM_MENUCOMMAND equ 15
SOUND_SYSTEM_MENUPOPUP	equ 16
CSOUND_SYSTEM		equ 16

ALERT_SYSTEM_INFORMATIONAL equ 1
ALERT_SYSTEM_WARNING	equ 2
ALERT_SYSTEM_ERROR	equ 3
ALERT_SYSTEM_QUERY	equ 4
ALERT_SYSTEM_CRITICAL	equ 5
CALERT_SYSTEM		equ 6

SetWinEventHook proto WINAPI :DWORD, :DWORD, :HMODULE, :WINEVENTPROC, :DWORD, :DWORD, :DWORD
UnhookWinEvent proto WINAPI :HWINEVENTHOOK

WINEVENT_OUTOFCONTEXT	equ 0x0000
WINEVENT_SKIPOWNTHREAD	equ 0x0001
WINEVENT_SKIPOWNPROCESS equ 0x0002
WINEVENT_INCONTEXT	equ 0x0004

GUITHREADINFO		STRUC
cbSize			dd ?
flags			dd ?
hwndActive		HWND ?
hwndFocus		HWND ?
hwndCapture		HWND ?
hwndMenuOwner		HWND ?
hwndMoveSize		HWND ?
hwndCaret		HWND ?
rcCaret			RECT <>
GUITHREADINFO		ENDS
PGUITHREADINFO		typedef ptr GUITHREADINFO

GUI_CARETBLINKING	equ 0x00000001
GUI_INMOVESIZE		equ 0x00000002
GUI_INMENUMODE		equ 0x00000004
GUI_SYSTEMMENUMODE	equ 0x00000008
GUI_POPUPMENUMODE	equ 0x00000010
if(_WIN32_WINNT GE 0x0501)
ifdef _WIN64
GUI_16BITTASK		equ 0x00000000
else
GUI_16BITTASK		equ 0x00000020
endif
endif

if(_WIN32_WINNT GE 0x0600)
USER_DEFAULT_SCREEN_DPI equ 96
SetProcessDPIAware proto WINAPI
IsProcessDPIAware proto WINAPI
endif
GetGUIThreadInfo proto WINAPI :DWORD, :PGUITHREADINFO
BlockInput proto WINAPI :BOOL
GetWindowModuleFileNameA proto WINAPI :HWND, :LPSTR, :UINT
GetWindowModuleFileNameW proto WINAPI :HWND, :LPWSTR, :UINT
ifdef _UNICODE
GetWindowModuleFileName equ <GetWindowModuleFileNameW>
else
GetWindowModuleFileName equ <GetWindowModuleFileNameA>
endif


STATE_SYSTEM_UNAVAILABLE equ 0x00000001
STATE_SYSTEM_SELECTED	equ 0x00000002
STATE_SYSTEM_FOCUSED	equ 0x00000004
STATE_SYSTEM_PRESSED	equ 0x00000008
STATE_SYSTEM_CHECKED	equ 0x00000010
STATE_SYSTEM_MIXED	equ 0x00000020
STATE_SYSTEM_READONLY	equ 0x00000040
STATE_SYSTEM_HOTTRACKED equ 0x00000080
STATE_SYSTEM_DEFAULT	equ 0x00000100
STATE_SYSTEM_EXPANDED	equ 0x00000200
STATE_SYSTEM_COLLAPSED	equ 0x00000400
STATE_SYSTEM_BUSY	equ 0x00000800
STATE_SYSTEM_FLOATING	equ 0x00001000
STATE_SYSTEM_MARQUEED	equ 0x00002000
STATE_SYSTEM_ANIMATED	equ 0x00004000
STATE_SYSTEM_INVISIBLE	equ 0x00008000
STATE_SYSTEM_OFFSCREEN	equ 0x00010000
STATE_SYSTEM_SIZEABLE	equ 0x00020000
STATE_SYSTEM_MOVEABLE	equ 0x00040000
STATE_SYSTEM_SELFVOICING equ 0x00080000
STATE_SYSTEM_FOCUSABLE	equ 0x00100000
STATE_SYSTEM_SELECTABLE equ 0x00200000
STATE_SYSTEM_LINKED	equ 0x00400000
STATE_SYSTEM_TRAVERSED	equ 0x00800000
STATE_SYSTEM_MULTISELECTABLE equ 0x01000000
STATE_SYSTEM_EXTSELECTABLE equ 0x02000000
STATE_SYSTEM_ALERT_LOW	equ 0x04000000
STATE_SYSTEM_ALERT_MEDIUM equ 0x08000000
STATE_SYSTEM_ALERT_HIGH equ 0x10000000
STATE_SYSTEM_VALID	equ 0x1FFFFFFF

CCHILDREN_TITLEBAR	equ 5
CCHILDREN_SCROLLBAR	equ 5

CURSORINFO		STRUC
cbSize			dd ?
flags			dd ?
hCursor			HCURSOR ?
ptScreenPos		POINT <>
CURSORINFO		ENDS
PCURSORINFO		typedef ptr CURSORINFO
LPCURSORINFO		typedef ptr CURSORINFO

CURSOR_SHOWING		equ 0x00000001

GetCursorInfo proto WINAPI :PCURSORINFO

WINDOWINFO		STRUC
cbSize			dd ?
rcWindow		RECT <>
rcClient		RECT <>
dwStyle			dd ?
dwExStyle		dd ?
dwOtherStuff		dd ?
cxWindowBorders		UINT ?
cyWindowBorders		UINT ?
atomWindowType		ATOM ?
wCreatorVersion		dw ?
WINDOWINFO		ENDS
PWINDOWINFO		typedef ptr WINDOWINFO
LPWINDOWINFO		typedef ptr WINDOWINFO

WS_ACTIVECAPTION	equ 0x0001

GetWindowInfo proto WINAPI :HWND, :PWINDOWINFO

TITLEBARINFO		STRUC
cbSize			dd ?
rcTitleBar		RECT <>
rgstate			dd CCHILDREN_TITLEBAR+1 dup(?)
TITLEBARINFO		ENDS
PTITLEBARINFO		typedef ptr TITLEBARINFO
LPTITLEBARINFO		typedef ptr TITLEBARINFO

GetTitleBarInfo proto WINAPI :HWND, :PTITLEBARINFO

if(WINVER GE 0x0600)
TITLEBARINFOEX		STRUC
cbSize			dd ?
rcTitleBar		RECT <>
rgstate			dd CCHILDREN_TITLEBAR + 1 dup(?)
rgrect			RECT CCHILDREN_TITLEBAR + 1 dup(<>)
TITLEBARINFOEX		ENDS
PTITLEBARINFOEX		typedef ptr TITLEBARINFOEX
LPTITLEBARINFOEX	typedef ptr TITLEBARINFOEX
endif
MENUBARINFO		STRUC
cbSize			dd ?
rcBar			RECT <>
hMenu			HMENU ?
hwndMenu		HWND ?
;MENUBARINFO_R0		RECORD fBarFocused:1, fFocused:1
;r0			MENUBARINFO_R0 <>
flags			UINT ?
MENUBARINFO		ENDS
PMENUBARINFO		typedef ptr MENUBARINFO
LPMENUBARINFO		typedef ptr MENUBARINFO

GetMenuBarInfo proto WINAPI :HWND, :LONG, :LONG, :PMENUBARINFO

SCROLLBARINFO		STRUC
cbSize			dd ?
rcScrollBar		RECT <>
dxyLineButton		SINT ?
xyThumbTop		SINT ?
xyThumbBottom		SINT ?
bogus			SINT ?
rgstate			dd CCHILDREN_SCROLLBAR+1 dup(?)
SCROLLBARINFO		ENDS
PSCROLLBARINFO		typedef ptr SCROLLBARINFO
LPSCROLLBARINFO		typedef ptr SCROLLBARINFO

GetScrollBarInfo proto WINAPI :HWND, :LONG, :PSCROLLBARINFO

COMBOBOXINFO		STRUC
cbSize			dd ?
rcItem			RECT <>
rcButton		RECT <>
stateButton		dd ?
hwndCombo		HWND ?
hwndItem		HWND ?
hwndList		HWND ?
COMBOBOXINFO		ENDS
PCOMBOBOXINFO		typedef ptr COMBOBOXINFO
LPCOMBOBOXINFO		typedef ptr COMBOBOXINFO

GetComboBoxInfo proto WINAPI :HWND, :PCOMBOBOXINFO

GA_MIC			equ 1
GA_PARENT		equ 1
GA_ROOT			equ 2
GA_ROOTOWNER		equ 3
GA_MAC			equ 4

GetAncestor proto WINAPI :HWND, :UINT
RealChildWindowFromPoint proto WINAPI :HWND, :POINT
RealGetWindowClassA proto WINAPI :HWND, :LPTSTR, :UINT
RealGetWindowClassW proto WINAPI :HWND, :LPTSTR, :UINT
ifdef _UNICODE
RealGetWindowClass	equ <RealGetWindowClassW>
else
RealGetWindowClass	equ <RealGetWindowClassA>
endif

ALTTABINFO		STRUC
cbSize			dd ?
cItems			SINT ?
cColumns		SINT ?
cRows			SINT ?
iColFocus		SINT ?
iRowFocus		SINT ?
cxItem			SINT ?
cyItem			SINT ?
ptStart			POINT <>
ALTTABINFO		ENDS
PALTTABINFO		typedef ptr ALTTABINFO
LPALTTABINFO		typedef ptr ALTTABINFO

GetAltTabInfoA proto WINAPI :HWND, :SINT, :PALTTABINFO, :LPTSTR, :UINT
GetAltTabInfoW proto WINAPI :HWND, :SINT, :PALTTABINFO, :LPTSTR, :UINT
ifdef _UNICODE
GetAltTabInfo equ <GetAltTabInfoW>
else
GetAltTabInfo equ <GetAltTabInfoA>
endif
GetListBoxInfo proto WINAPI :HWND

endif
endif

if(_WIN32_WINNT GE 0x0500)
LockWorkStation proto WINAPI
endif
if(_WIN32_WINNT GE 0x0500)
UserHandleGrantAccess proto WINAPI :HANDLE, :HANDLE
endif

if(_WIN32_WINNT GE 0x0501)

HRAWINPUT		typedef HANDLE

GET_RAWINPUT_CODE_WPARAM macro wParam
	exitm<((wParam) AND 0xff)>
	endm

RIM_INPUT		equ 0
RIM_INPUTSINK		equ 1

RAWINPUTHEADER		STRUC
dwType			dd ?
dwSize			dd ?
hDevice			HANDLE ?
wParam			WPARAM ?
RAWINPUTHEADER		ENDS
PRAWINPUTHEADER		typedef ptr RAWINPUTHEADER
LPRAWINPUTHEADER	typedef ptr RAWINPUTHEADER

RIM_TYPEMOUSE		equ 0
RIM_TYPEKEYBOARD	equ 1
RIM_TYPEHID		equ 2

RAWMOUSE		STRUC
usFlags			dw ?
UNION
 ulButtons		dd ?
 STRUC
  usButtonFlags		dw ?
  usButtonData		dw ?
 ENDS
ENDS
ulRawButtons		dd ?
lLastX			LONG ?
lLastY			LONG ?
ulExtraInformation	ULONG ?
RAWMOUSE		ENDS
PRAWMOUSE		typedef ptr RAWMOUSE
LPRAWMOUSE		typedef ptr RAWMOUSE


RI_MOUSE_LEFT_BUTTON_DOWN   equ 0x0001
RI_MOUSE_LEFT_BUTTON_UP	    equ 0x0002
RI_MOUSE_RIGHT_BUTTON_DOWN  equ 0x0004
RI_MOUSE_RIGHT_BUTTON_UP    equ 0x0008
RI_MOUSE_MIDDLE_BUTTON_DOWN equ 0x0010
RI_MOUSE_MIDDLE_BUTTON_UP   equ 0x0020

RI_MOUSE_BUTTON_1_DOWN	equ RI_MOUSE_LEFT_BUTTON_DOWN
RI_MOUSE_BUTTON_1_UP	equ RI_MOUSE_LEFT_BUTTON_UP
RI_MOUSE_BUTTON_2_DOWN	equ RI_MOUSE_RIGHT_BUTTON_DOWN
RI_MOUSE_BUTTON_2_UP	equ RI_MOUSE_RIGHT_BUTTON_UP
RI_MOUSE_BUTTON_3_DOWN	equ RI_MOUSE_MIDDE_BUTTON_DOWN
RI_MOUSE_BUTTON_3_UP	equ RI_MOUSE_MIDDE_BUTTON_UP
RI_MOUSE_BUTTON_4_DOWN	equ 0x0040
RI_MOUSE_BUTTON_4_UP	equ 0x0080
RI_MOUSE_BUTTON_5_DOWN	equ 0x0100
RI_MOUSE_BUTTON_5_UP	equ 0x0200
RI_MOUSE_WHEEL		equ 0x0400

MOUSE_MOVE_RELATIVE	equ 0
MOUSE_MOVE_ABSOLUTE	equ 1
MOUSE_VIRTUAL_DESKTOP	equ 0x02
MOUSE_ATTRIBUTES_CHANGED equ 0x04
if(WINVER GE 0x0600)
MOUSE_MOVE_NOCOALESCE	equ 0x08
endif

RAWKEYBOARD		STRUC
MakeCode		dw ?
Flags			dw ?
Reserved		dw ?
VKey			dw ?
Message			UINT ?
ExtraInformation	ULONG ?
RAWKEYBOARD		ENDS
PRAWKEYBOARD		typedef ptr RAWKEYBOARD
LPRAWKEYBOARD		typedef ptr RAWKEYBOARD

KEYBOARD_OVERRUN_MAKE_CODE equ 0xFF

RI_KEY_MAKE		equ 0
RI_KEY_BREAK		equ 1
RI_KEY_E0		equ 2
RI_KEY_E1		equ 4
RI_KEY_TERMSRV_SET_LED	equ 8
RI_KEY_TERMSRV_SHADOW	equ 0x10

RAWHID			STRUC
dwSizeHid		dd ?
dwCount			dd ?
bRawData		db ?
RAWHID			ENDS
PRAWHID			typedef ptr RAWHID
LPRAWHID		typedef ptr RAWHID

RAWINPUT		STRUC
header			RAWINPUTHEADER <>
UNION data
 mouse			RAWMOUSE <>
 keyboard		RAWKEYBOARD <>
 hid			RAWHID <>
ENDS
RAWINPUT		ENDS
PRAWINPUT		typedef ptr RAWINPUT
LPRAWINPUT		typedef ptr RAWINPUT

ifdef _WIN64
RAWINPUT_ALIGN macro x
	exitm<(((x) + QWORD - 1) AND NOT (QWORD - 1))>
	endm
else
RAWINPUT_ALIGN macro x
	exitm<(((x) + DWORD - 1) AND NOT (DWORD - 1))>
	endm
endif

NEXTRAWINPUTBLOCK macro p
	exitm<RAWINPUT_ALIGN(p + p.header.dwSize)>
	endm


RID_INPUT		equ 0x10000003
RID_HEADER		equ 0x10000005

GetRawInputData proto WINAPI :HRAWINPUT, :UINT, :LPVOID, :PUINT, :UINT

RIDI_PREPARSEDDATA	equ 0x20000005
RIDI_DEVICENAME		equ 0x20000007
RIDI_DEVICEINFO		equ 0x2000000b

RID_DEVICE_INFO_MOUSE	STRUC
dwId			dd ?
dwNumberOfButtons	dd ?
dwSampleRate		dd ?
fHasHorizontalWheel	BOOL ?
RID_DEVICE_INFO_MOUSE	ENDS
PRID_DEVICE_INFO_MOUSE	typedef ptr RID_DEVICE_INFO_MOUSE

RID_DEVICE_INFO_KEYBOARD  STRUC
dwType			dd ?
dwSubType		dd ?
dwKeyboardMode		dd ?
dwNumberOfFunctionKeys	dd ?
dwNumberOfIndicators	dd ?
dwNumberOfKeysTotal	dd ?
RID_DEVICE_INFO_KEYBOARD ENDS
PRID_DEVICE_INFO_KEYBOARD typedef ptr RID_DEVICE_INFO_KEYBOARD

RID_DEVICE_INFO_HID	STRUC
dwVendorId		dd ?
dwProductId		dd ?
dwVersionNumber		dd ?
usUsagePage		dw ?
usUsage			dw ?
RID_DEVICE_INFO_HID	ENDS
PRID_DEVICE_INFO_HID	typedef ptr RID_DEVICE_INFO_HID

RID_DEVICE_INFO		STRUC
cbSize			dd ?
dwType			dd ?
UNION
 mouse			RID_DEVICE_INFO_MOUSE <>
 keyboard		RID_DEVICE_INFO_KEYBOARD <>
 hid			RID_DEVICE_INFO_HID <>
ENDS
RID_DEVICE_INFO		ENDS
PRID_DEVICE_INFO	typedef ptr RID_DEVICE_INFO
LPRID_DEVICE_INFO	typedef ptr RID_DEVICE_INFO

GetRawInputDeviceInfoA proto WINAPI :HANDLE, :UINT, :LPVOID, :PUINT
GetRawInputDeviceInfoW proto WINAPI :HANDLE, :UINT, :LPVOID, :PUINT
ifdef _UNICODE
GetRawInputDeviceInfo	equ <GetRawInputDeviceInfoW>
else
GetRawInputDeviceInfo	equ <GetRawInputDeviceInfoA>
endif

GetRawInputBuffer proto WINAPI :PRAWINPUT, :PUINT, :UINT

RAWINPUTDEVICE		STRUC
usUsagePage		dw ?
usUsage			dw ?
dwFlags			dd ?
hwndTarget		HWND ?
RAWINPUTDEVICE		ENDS
PRAWINPUTDEVICE		typedef ptr RAWINPUTDEVICE
LPRAWINPUTDEVICE	typedef ptr RAWINPUTDEVICE
PCRAWINPUTDEVICE	typedef ptr RAWINPUTDEVICE

RIDEV_REMOVE		equ 0x00000001
RIDEV_EXCLUDE		equ 0x00000010
RIDEV_PAGEONLY		equ 0x00000020
RIDEV_NOLEGACY		equ 0x00000030
RIDEV_INPUTSINK		equ 0x00000100
RIDEV_CAPTUREMOUSE	equ 0x00000200
RIDEV_NOHOTKEYS		equ 0x00000200
RIDEV_APPKEYS		equ 0x00000400
if(_WIN32_WINNT GE 0x0501)
RIDEV_EXINPUTSINK	equ 0x00001000
RIDEV_DEVNOTIFY		equ 0x00002000
endif
RIDEV_EXMODEMASK	equ 0x000000F0

RIDEV_EXMODE macro m
	exitm<((m) AND RIDEV_EXMODEMASK)>
	endm

if(_WIN32_WINNT GE 0x0501)
GIDC_ARRIVAL		equ 1
GIDC_REMOVAL		equ 2
endif

if (_WIN32_WINNT GE 0x0601)
GET_DEVICE_CHANGE_WPARAM macro wParam
	exitm<(LOWORD(wParam))>
	endm
elseif (_WIN32_WINNT GE 0x0501)
GET_DEVICE_CHANGE_LPARAM macro lParam
	exitm<(LOWORD(lParam))>
	endm
endif

RegisterRawInputDevices proto WINAPI :PCRAWINPUTDEVICE, :UINT, :UINT
GetRegisteredRawInputDevices proto WINAPI :PCRAWINPUTDEVICE, :PUINT, :UINT

RAWINPUTDEVICELIST	STRUC
hDevice			HANDLE ?
dwType			dd ?
RAWINPUTDEVICELIST	ENDS
PRAWINPUTDEVICELIST	typedef ptr RAWINPUTDEVICELIST

GetRawInputDeviceList proto WINAPI :PRAWINPUTDEVICELIST, :PUINT, :UINT
DefRawInputProc proto WINAPI :ptr PRAWINPUT, :SINT, :UINT

endif

if(WINVER GE 0x0600)
MSGFLT_ADD		equ 1
MSGFLT_REMOVE		equ 2

ChangeWindowMessageFilter proto WINAPI :UINT, :DWORD
endif

if(WINVER GE 0x0601)

MSGFLTINFO_NONE				equ 0
MSGFLTINFO_ALREADYALLOWED_FORWND	equ 1
MSGFLTINFO_ALREADYDISALLOWED_FORWND	equ 2
MSGFLTINFO_ALLOWED_HIGHER		equ 3

CHANGEFILTERSTRUCT	STRUC
cbSize			dd ?
ExtStatus		dd ?
CHANGEFILTERSTRUCT	ENDS
PCHANGEFILTERSTRUCT	typedef ptr CHANGEFILTERSTRUCT

MSGFLT_RESET		equ 0
MSGFLT_ALLOW		equ 1
MSGFLT_DISALLOW		equ 2

ChangeWindowMessageFilterEx proto WINAPI :HWND, :UINT, :DWORD, :PCHANGEFILTERSTRUCT

endif

if(WINVER GE 0x0601)

HGESTUREINFO		typedef HANDLE

GF_BEGIN		equ 0x00000001
GF_INERTIA		equ 0x00000002
GF_END			equ 0x00000004

GID_BEGIN		equ 1
GID_END			equ 2
GID_ZOOM		equ 3
GID_PAN			equ 4
GID_ROTATE		equ 5
GID_TWOFINGERTAP	equ 6
GID_PRESSANDTAP		equ 7
GID_ROLLOVER		equ GID_PRESSANDTAP

GESTUREINFO		STRUC
cbSize			UINT ?
dwFlags			dd ?
dwID			dd ?
hwndTarget		HWND ?
ptsLocation		POINTS <>
dwInstanceID		dd ?
dwSequenceID		dd ?
ullArguments		ULONGLONG ?
cbExtraArgs		UINT ?
GESTUREINFO		ENDS
PGESTUREINFO		typedef ptr GESTUREINFO
PCGESTUREINFO		typedef ptr GESTUREINFO

GESTURENOTIFYSTRUCT	STRUC
cbSize			UINT ?
dwFlags			dd ?
hwndTarget		HWND ?
ptsLocation		POINTS <>
dwInstanceID		dd ?
GESTURENOTIFYSTRUCT	ENDS
PGESTURENOTIFYSTRUCT	typedef ptr GESTURENOTIFYSTRUCT

GID_ROTATE_ANGLE_TO_ARGUMENT macro _arg_
    if (TYPOF(_arg_))
	ifdif <_arg_>,<xmm0>
	    movsd xmm0,_arg_
	endif
	addsd xmm0,2.0 * 3.14159265
	divsd xmm0,4.0 * 3.14159265
	mulsd xmm0,65535.0
	exitm<xmm0>
    else
	exitm<((((_arg_ + 2.0 * 3.14159265) / (4.0 * 3.14159265)) * 65535.0))>
    endif
	endm
GID_ROTATE_ANGLE_FROM_ARGUMENT macro _arg_
    if (TYPEOF(_arg_))
	ifdif <_arg_>,<xmm0>
	    movsd xmm0,_arg_
	endif
	divsd xmm0,65535.0
	mulsd xmm0,4.0 * 3.14159265
	subsd xmm0,2.0 * 3.14159265
	exitm<xmm0>
    else
	exitm<(((_arg_ / 65535.0) * 4.0 * 3.14159265) - 2.0 * 3.14159265)>
    endif
	endm

GetGestureInfo proto WINAPI :HGESTUREINFO, :PGESTUREINFO
GetGestureExtraArgs proto WINAPI :HGESTUREINFO, :UINT, :PBYTE
CloseGestureInfoHandle proto WINAPI :HGESTUREINFO

GESTURECONFIG		STRUC
dwID			dd ?
dwWant			dd ?
dwBlock			dd ?
GESTURECONFIG		ENDS
PGESTURECONFIG		typedef ptr GESTURECONFIG

GC_ALLGESTURES		equ 0x00000001
GC_ZOOM			equ 0x00000001
GC_PAN			equ 0x00000001
GC_PAN_WITH_SINGLE_FINGER_VERTICALLY equ 0x00000002
GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY equ 0x00000004
GC_PAN_WITH_GUTTER	equ 0x00000008
GC_PAN_WITH_INERTIA	equ 0x00000010
GC_ROTATE		equ 0x00000001
GC_TWOFINGERTAP		equ 0x00000001
GC_PRESSANDTAP		equ 0x00000001
GC_ROLLOVER		equ GC_PRESSANDTAP
GESTURECONFIGMAXCOUNT	equ 256

SetGestureConfig proto WINAPI :HWND, :DWORD, :UINT, :PGESTURECONFIG, :UINT
GCF_INCLUDE_ANCESTORS	equ 0x00000001
GetGestureConfig proto WINAPI :HWND, :DWORD, :DWORD, :PUINT, :PGESTURECONFIG, :UINT

endif

if(WINVER GE 0x0601)
NID_INTEGRATED_TOUCH	equ 0x00000001
NID_EXTERNAL_TOUCH	equ 0x00000002
NID_INTEGRATED_PEN	equ 0x00000004
NID_EXTERNAL_PEN	equ 0x00000008
NID_MULTI_INPUT		equ 0x00000040
NID_READY		equ 0x00000080
endif

MAX_STR_BLOCKREASON	equ 256

ShutdownBlockReasonCreate proto WINAPI :HWND, :LPCWSTR
ShutdownBlockReasonQuery proto WINAPI :HWND, :LPWSTR, :ptr DWORD
ShutdownBlockReasonDestroy proto WINAPI :HWND

if(WINVER GE 0x0601)

.enum INPUT_MESSAGE_DEVICE_TYPE {
    IMDT_UNAVAILABLE = 0x00000000,
    IMDT_KEYBOARD    = 0x00000001,
    IMDT_MOUSE	     = 0x00000002,
    IMDT_TOUCH	     = 0x00000004,
    IMDT_PEN	     = 0x00000008,
if(WINVER GE 0x0603)
     IMDT_TOUCHPAD    = 0x00000010,
endif
    }

.enum INPUT_MESSAGE_ORIGIN_ID {
    IMO_UNAVAILABLE = 0x00000000,
    IMO_HARDWARE    = 0x00000001,
    IMO_INJECTED    = 0x00000002,
    IMO_SYSTEM	    = 0x00000004
    }

INPUT_MESSAGE_SOURCE	STRUC
deviceType		INPUT_MESSAGE_DEVICE_TYPE ?
originId		INPUT_MESSAGE_ORIGIN_ID ?
INPUT_MESSAGE_SOURCE	ENDS

GetCurrentInputMessageSource proto WINAPI :ptr INPUT_MESSAGE_SOURCE
GetCIMSSM proto WINAPI :ptr INPUT_MESSAGE_SOURCE

endif

if(WINVER GE 0x0601)

.enum AR_STATE {
    AR_ENABLED	      = 0x0,
    AR_DISABLED	      = 0x1,
    AR_SUPPRESSED     = 0x2,
    AR_REMOTESESSION  = 0x4,
    AR_MULTIMON	      = 0x8,
    AR_NOSENSOR	      = 0x10,
    AR_NOT_SUPPORTED  = 0x20,
    AR_DOCKED	      = 0x40,
    AR_LAPTOP	      = 0x80
    }
PAR_STATE typedef ptr AR_STATE


.enum ORIENTATION_PREFERENCE {
    ORIENTATION_PREFERENCE_NONE		     = 0x0,
    ORIENTATION_PREFERENCE_LANDSCAPE	     = 0x1,
    ORIENTATION_PREFERENCE_PORTRAIT	     = 0x2,
    ORIENTATION_PREFERENCE_LANDSCAPE_FLIPPED = 0x4,
    ORIENTATION_PREFERENCE_PORTRAIT_FLIPPED  = 0x8
    }

GetAutoRotationState proto WINAPI :PAR_STATE
GetDisplayAutoRotationPreferences proto WINAPI :ptr ORIENTATION_PREFERENCE
GetDisplayAutoRotationPreferencesByProcessId proto WINAPI :DWORD, :ORIENTATION_PREFERENCE, :BOOL
SetDisplayAutoRotationPreferences proto WINAPI :ORIENTATION_PREFERENCE

endif

if(WINVER GE 0x0601)
IsImmersiveProcess proto WINAPI :HANDLE
SetProcessRestrictionExemption proto WINAPI :BOOL
endif

ifdef ISOLATION_AWARE_ENABLED
if ISOLATION_AWARE_ENABLED
include winuser.inl
endif
endif

.pragma pack(pop)

