Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _WINUSER_
      7 #define _WINUSER_
      8 
      9 #include <_mingw_unicode.h>
     10 
     11 #ifdef _USER32_
     12 #define WINUSERAPI
     13 #else
     14 #define WINUSERAPI DECLSPEC_IMPORT
     15 #endif
     16 
     17 #ifdef __cplusplus
     18 extern "C" {
     19 #endif
     20 
     21 #ifndef WINVER
     22 #define WINVER 0x0502
     23 #endif
     24 
     25 #include <_mingw.h>
     26 #include <stdarg.h>
     27 #include <guiddef.h>
     28 
     29 #ifndef NOUSER
     30   typedef HANDLE HDWP;
     31   typedef VOID MENUTEMPLATEA;
     32   typedef VOID MENUTEMPLATEW;
     33   typedef PVOID LPMENUTEMPLATEA;
     34   typedef PVOID LPMENUTEMPLATEW;
     35 
     36   __MINGW_TYPEDEF_AW(MENUTEMPLATE)
     37   __MINGW_TYPEDEF_AW(LPMENUTEMPLATE)
     38 
     39   typedef LRESULT (CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM);
     40   typedef INT_PTR (CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM);
     41   typedef VOID (CALLBACK *TIMERPROC)(HWND,UINT,UINT_PTR,DWORD);
     42   typedef WINBOOL (CALLBACK *GRAYSTRINGPROC)(HDC,LPARAM,int);
     43   typedef WINBOOL (CALLBACK *WNDENUMPROC)(HWND,LPARAM);
     44   typedef LRESULT (CALLBACK *HOOKPROC)(int code,WPARAM wParam,LPARAM lParam);
     45   typedef VOID (CALLBACK *SENDASYNCPROC)(HWND,UINT,ULONG_PTR,LRESULT);
     46   typedef WINBOOL (CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
     47   typedef WINBOOL (CALLBACK *PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
     48   typedef WINBOOL (CALLBACK *PROPENUMPROCEXA)(HWND,LPSTR,HANDLE,ULONG_PTR);
     49   typedef WINBOOL (CALLBACK *PROPENUMPROCEXW)(HWND,LPWSTR,HANDLE,ULONG_PTR);
     50   typedef int (CALLBACK *EDITWORDBREAKPROCA)(LPSTR lpch,int ichCurrent,int cch,int code);
     51   typedef int (CALLBACK *EDITWORDBREAKPROCW)(LPWSTR lpch,int ichCurrent,int cch,int code);
     52   typedef WINBOOL (CALLBACK *DRAWSTATEPROC)(HDC hdc,LPARAM lData,WPARAM wData,int cx,int cy);
     53 
     54   __MINGW_TYPEDEF_AW(PROPENUMPROC)
     55   __MINGW_TYPEDEF_AW(PROPENUMPROCEX)
     56   __MINGW_TYPEDEF_AW(EDITWORDBREAKPROC)
     57 
     58   typedef WINBOOL (CALLBACK *NAMEENUMPROCA)(LPSTR,LPARAM);
     59   typedef WINBOOL (CALLBACK *NAMEENUMPROCW)(LPWSTR,LPARAM);
     60   typedef NAMEENUMPROCA WINSTAENUMPROCA;
     61   typedef NAMEENUMPROCA DESKTOPENUMPROCA;
     62   typedef NAMEENUMPROCW WINSTAENUMPROCW;
     63   typedef NAMEENUMPROCW DESKTOPENUMPROCW;
     64 
     65   __MINGW_TYPEDEF_AW(WINSTAENUMPROC)
     66   __MINGW_TYPEDEF_AW(DESKTOPENUMPROC)
     67 
     68 #define IS_INTRESOURCE(_r) ((((ULONG_PTR)(_r)) >> 16)==0)
     69 #define MAKEINTRESOURCEA(i) ((LPSTR)((ULONG_PTR)((WORD)(i))))
     70 #define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i))))
     71 #define MAKEINTRESOURCE __MINGW_NAME_AW(MAKEINTRESOURCE)
     72 
     73 #ifndef NORESOURCE
     74 
     75 #define RT_CURSOR MAKEINTRESOURCE(1)
     76 #define RT_BITMAP MAKEINTRESOURCE(2)
     77 #define RT_ICON MAKEINTRESOURCE(3)
     78 #define RT_MENU MAKEINTRESOURCE(4)
     79 #define RT_DIALOG MAKEINTRESOURCE(5)
     80 #define RT_STRING MAKEINTRESOURCE(6)
     81 #define RT_FONTDIR MAKEINTRESOURCE(7)
     82 #define RT_FONT MAKEINTRESOURCE(8)
     83 #define RT_ACCELERATOR MAKEINTRESOURCE(9)
     84 #define RT_RCDATA MAKEINTRESOURCE(10)
     85 #define RT_MESSAGETABLE MAKEINTRESOURCE(11)
     86 
     87 #define DIFFERENCE 11
     88 #define RT_GROUP_CURSOR MAKEINTRESOURCE((ULONG_PTR)RT_CURSOR + DIFFERENCE)
     89 #define RT_GROUP_ICON MAKEINTRESOURCE((ULONG_PTR)RT_ICON + DIFFERENCE)
     90 #define RT_VERSION MAKEINTRESOURCE(16)
     91 #define RT_DLGINCLUDE MAKEINTRESOURCE(17)
     92 #define RT_PLUGPLAY MAKEINTRESOURCE(19)
     93 #define RT_VXD MAKEINTRESOURCE(20)
     94 #define RT_ANICURSOR MAKEINTRESOURCE(21)
     95 #define RT_ANIICON MAKEINTRESOURCE(22)
     96 #define RT_HTML MAKEINTRESOURCE(23)
     97 #ifdef RC_INVOKED
     98 #define RT_MANIFEST 24
     99 #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
    100 #define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
    101 #define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
    102 #define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID 1
    103 #define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID 16
    104 #else
    105 #define RT_MANIFEST MAKEINTRESOURCE(24)
    106 #define CREATEPROCESS_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(1)
    107 #define ISOLATIONAWARE_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(2)
    108 #define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(3)
    109 #define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(1)
    110 #define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(16)
    111 #endif
    112 #endif
    113 
    114 #define wvsprintf __MINGW_NAME_AW(wvsprintf)
    115 #define wsprintf __MINGW_NAME_AW(wsprintf)
    116 
    117   WINUSERAPI int WINAPI wvsprintfA(LPSTR,LPCSTR,va_list arglist);
    118   WINUSERAPI int WINAPI wvsprintfW(LPWSTR,LPCWSTR,va_list arglist);
    119   WINUSERAPI int WINAPIV wsprintfA(LPSTR,LPCSTR,...);
    120   WINUSERAPI int WINAPIV wsprintfW(LPWSTR,LPCWSTR,...);
    121 
    122 #define SETWALLPAPER_DEFAULT ((LPWSTR)-1)
    123 
    124 #ifndef NOSCROLL
    125 #define SB_HORZ 0
    126 #define SB_VERT 1
    127 #define SB_CTL 2
    128 #define SB_BOTH 3
    129 
    130 #define SB_LINEUP 0
    131 #define SB_LINELEFT 0
    132 #define SB_LINEDOWN 1
    133 #define SB_LINERIGHT 1
    134 #define SB_PAGEUP 2
    135 #define SB_PAGELEFT 2
    136 #define SB_PAGEDOWN 3
    137 #define SB_PAGERIGHT 3
    138 #define SB_THUMBPOSITION 4
    139 #define SB_THUMBTRACK 5
    140 #define SB_TOP 6
    141 #define SB_LEFT 6
    142 #define SB_BOTTOM 7
    143 #define SB_RIGHT 7
    144 #define SB_ENDSCROLL 8
    145 #endif
    146 
    147 #ifndef NOSHOWWINDOW
    148 #define SW_HIDE 0
    149 #define SW_SHOWNORMAL 1
    150 #define SW_NORMAL 1
    151 #define SW_SHOWMINIMIZED 2
    152 #define SW_SHOWMAXIMIZED 3
    153 #define SW_MAXIMIZE 3
    154 #define SW_SHOWNOACTIVATE 4
    155 #define SW_SHOW 5
    156 #define SW_MINIMIZE 6
    157 #define SW_SHOWMINNOACTIVE 7
    158 #define SW_SHOWNA 8
    159 #define SW_RESTORE 9
    160 #define SW_SHOWDEFAULT 10
    161 #define SW_FORCEMINIMIZE 11
    162 #define SW_MAX 11
    163 
    164 #define HIDE_WINDOW 0
    165 #define SHOW_OPENWINDOW 1
    166 #define SHOW_ICONWINDOW 2
    167 #define SHOW_FULLSCREEN 3
    168 #define SHOW_OPENNOACTIVATE 4
    169 
    170 #define SW_PARENTCLOSING 1
    171 #define SW_OTHERZOOM 2
    172 #define SW_PARENTOPENING 3
    173 #define SW_OTHERUNZOOM 4
    174 #endif
    175 
    176 #define AW_HOR_POSITIVE 0x00000001
    177 #define AW_HOR_NEGATIVE 0x00000002
    178 #define AW_VER_POSITIVE 0x00000004
    179 #define AW_VER_NEGATIVE 0x00000008
    180 #define AW_CENTER 0x00000010
    181 #define AW_HIDE 0x00010000
    182 #define AW_ACTIVATE 0x00020000
    183 #define AW_SLIDE 0x00040000
    184 #define AW_BLEND 0x00080000
    185 
    186 #define KF_EXTENDED 0x0100
    187 #define KF_DLGMODE 0x0800
    188 #define KF_MENUMODE 0x1000
    189 #define KF_ALTDOWN 0x2000
    190 #define KF_REPEAT 0x4000
    191 #define KF_UP 0x8000
    192 
    193 #ifndef NOVIRTUALKEYCODES
    194 
    195 #define VK_LBUTTON 0x01
    196 #define VK_RBUTTON 0x02
    197 #define VK_CANCEL 0x03
    198 #define VK_MBUTTON 0x04
    199 #define VK_XBUTTON1 0x05
    200 #define VK_XBUTTON2 0x06
    201 #define VK_BACK 0x08
    202 #define VK_TAB 0x09
    203 #define VK_CLEAR 0x0C
    204 #define VK_RETURN 0x0D
    205 #define VK_SHIFT 0x10
    206 #define VK_CONTROL 0x11
    207 #define VK_MENU 0x12
    208 #define VK_PAUSE 0x13
    209 #define VK_CAPITAL 0x14
    210 #define VK_KANA 0x15
    211 #define VK_HANGEUL 0x15
    212 #define VK_HANGUL 0x15
    213 #define VK_JUNJA 0x17
    214 #define VK_FINAL 0x18
    215 #define VK_HANJA 0x19
    216 #define VK_KANJI 0x19
    217 #define VK_ESCAPE 0x1B
    218 #define VK_CONVERT 0x1C
    219 #define VK_NONCONVERT 0x1D
    220 #define VK_ACCEPT 0x1E
    221 #define VK_MODECHANGE 0x1F
    222 #define VK_SPACE 0x20
    223 #define VK_PRIOR 0x21
    224 #define VK_NEXT 0x22
    225 #define VK_END 0x23
    226 #define VK_HOME 0x24
    227 #define VK_LEFT 0x25
    228 #define VK_UP 0x26
    229 #define VK_RIGHT 0x27
    230 #define VK_DOWN 0x28
    231 #define VK_SELECT 0x29
    232 #define VK_PRINT 0x2A
    233 #define VK_EXECUTE 0x2B
    234 #define VK_SNAPSHOT 0x2C
    235 #define VK_INSERT 0x2D
    236 #define VK_DELETE 0x2E
    237 #define VK_HELP 0x2F
    238 
    239 #define VK_LWIN 0x5B
    240 #define VK_RWIN 0x5C
    241 #define VK_APPS 0x5D
    242 #define VK_SLEEP 0x5F
    243 #define VK_NUMPAD0 0x60
    244 #define VK_NUMPAD1 0x61
    245 #define VK_NUMPAD2 0x62
    246 #define VK_NUMPAD3 0x63
    247 #define VK_NUMPAD4 0x64
    248 #define VK_NUMPAD5 0x65
    249 #define VK_NUMPAD6 0x66
    250 #define VK_NUMPAD7 0x67
    251 #define VK_NUMPAD8 0x68
    252 #define VK_NUMPAD9 0x69
    253 #define VK_MULTIPLY 0x6A
    254 #define VK_ADD 0x6B
    255 #define VK_SEPARATOR 0x6C
    256 #define VK_SUBTRACT 0x6D
    257 #define VK_DECIMAL 0x6E
    258 #define VK_DIVIDE 0x6F
    259 #define VK_F1 0x70
    260 #define VK_F2 0x71
    261 #define VK_F3 0x72
    262 #define VK_F4 0x73
    263 #define VK_F5 0x74
    264 #define VK_F6 0x75
    265 #define VK_F7 0x76
    266 #define VK_F8 0x77
    267 #define VK_F9 0x78
    268 #define VK_F10 0x79
    269 #define VK_F11 0x7A
    270 #define VK_F12 0x7B
    271 #define VK_F13 0x7C
    272 #define VK_F14 0x7D
    273 #define VK_F15 0x7E
    274 #define VK_F16 0x7F
    275 #define VK_F17 0x80
    276 #define VK_F18 0x81
    277 #define VK_F19 0x82
    278 #define VK_F20 0x83
    279 #define VK_F21 0x84
    280 #define VK_F22 0x85
    281 #define VK_F23 0x86
    282 #define VK_F24 0x87
    283 #define VK_NUMLOCK 0x90
    284 #define VK_SCROLL 0x91
    285 #define VK_OEM_NEC_EQUAL 0x92
    286 #define VK_OEM_FJ_JISHO 0x92
    287 #define VK_OEM_FJ_MASSHOU 0x93
    288 #define VK_OEM_FJ_TOUROKU 0x94
    289 #define VK_OEM_FJ_LOYA 0x95
    290 #define VK_OEM_FJ_ROYA 0x96
    291 #define VK_LSHIFT 0xA0
    292 #define VK_RSHIFT 0xA1
    293 #define VK_LCONTROL 0xA2
    294 #define VK_RCONTROL 0xA3
    295 #define VK_LMENU 0xA4
    296 #define VK_RMENU 0xA5
    297 #define VK_BROWSER_BACK 0xA6
    298 #define VK_BROWSER_FORWARD 0xA7
    299 #define VK_BROWSER_REFRESH 0xA8
    300 #define VK_BROWSER_STOP 0xA9
    301 #define VK_BROWSER_SEARCH 0xAA
    302 #define VK_BROWSER_FAVORITES 0xAB
    303 #define VK_BROWSER_HOME 0xAC
    304 #define VK_VOLUME_MUTE 0xAD
    305 #define VK_VOLUME_DOWN 0xAE
    306 #define VK_VOLUME_UP 0xAF
    307 #define VK_MEDIA_NEXT_TRACK 0xB0
    308 #define VK_MEDIA_PREV_TRACK 0xB1
    309 #define VK_MEDIA_STOP 0xB2
    310 #define VK_MEDIA_PLAY_PAUSE 0xB3
    311 #define VK_LAUNCH_MAIL 0xB4
    312 #define VK_LAUNCH_MEDIA_SELECT 0xB5
    313 #define VK_LAUNCH_APP1 0xB6
    314 #define VK_LAUNCH_APP2 0xB7
    315 #define VK_OEM_1 0xBA
    316 #define VK_OEM_PLUS 0xBB
    317 #define VK_OEM_COMMA 0xBC
    318 #define VK_OEM_MINUS 0xBD
    319 #define VK_OEM_PERIOD 0xBE
    320 #define VK_OEM_2 0xBF
    321 #define VK_OEM_3 0xC0
    322 #define VK_OEM_4 0xDB
    323 #define VK_OEM_5 0xDC
    324 #define VK_OEM_6 0xDD
    325 #define VK_OEM_7 0xDE
    326 #define VK_OEM_8 0xDF
    327 #define VK_OEM_AX 0xE1
    328 #define VK_OEM_102 0xE2
    329 #define VK_ICO_HELP 0xE3
    330 #define VK_ICO_00 0xE4
    331 #define VK_PROCESSKEY 0xE5
    332 #define VK_ICO_CLEAR 0xE6
    333 #define VK_PACKET 0xE7
    334 #define VK_OEM_RESET 0xE9
    335 #define VK_OEM_JUMP 0xEA
    336 #define VK_OEM_PA1 0xEB
    337 #define VK_OEM_PA2 0xEC
    338 #define VK_OEM_PA3 0xED
    339 #define VK_OEM_WSCTRL 0xEE
    340 #define VK_OEM_CUSEL 0xEF
    341 #define VK_OEM_ATTN 0xF0
    342 #define VK_OEM_FINISH 0xF1
    343 #define VK_OEM_COPY 0xF2
    344 #define VK_OEM_AUTO 0xF3
    345 #define VK_OEM_ENLW 0xF4
    346 #define VK_OEM_BACKTAB 0xF5
    347 #define VK_ATTN 0xF6
    348 #define VK_CRSEL 0xF7
    349 #define VK_EXSEL 0xF8
    350 #define VK_EREOF 0xF9
    351 #define VK_PLAY 0xFA
    352 #define VK_ZOOM 0xFB
    353 #define VK_NONAME 0xFC
    354 #define VK_PA1 0xFD
    355 #define VK_OEM_CLEAR 0xFE
    356 #endif
    357 
    358 #ifndef NOWH
    359 
    360 #define WH_MIN (-1)
    361 #define WH_MSGFILTER (-1)
    362 #define WH_JOURNALRECORD 0
    363 #define WH_JOURNALPLAYBACK 1
    364 #define WH_KEYBOARD 2
    365 #define WH_GETMESSAGE 3
    366 #define WH_CALLWNDPROC 4
    367 #define WH_CBT 5
    368 #define WH_SYSMSGFILTER 6
    369 #define WH_MOUSE 7
    370 #define WH_HARDWARE 8
    371 #define WH_DEBUG 9
    372 #define WH_SHELL 10
    373 #define WH_FOREGROUNDIDLE 11
    374 #define WH_CALLWNDPROCRET 12
    375 
    376 #define WH_KEYBOARD_LL 13
    377 #define WH_MOUSE_LL 14
    378 
    379 #define WH_MAX 14
    380 
    381 #define WH_MINHOOK WH_MIN
    382 #define WH_MAXHOOK WH_MAX
    383 
    384 #define HC_ACTION 0
    385 #define HC_GETNEXT 1
    386 #define HC_SKIP 2
    387 #define HC_NOREMOVE 3
    388 #define HC_NOREM HC_NOREMOVE
    389 #define HC_SYSMODALON 4
    390 #define HC_SYSMODALOFF 5
    391 
    392 #define HCBT_MOVESIZE 0
    393 #define HCBT_MINMAX 1
    394 #define HCBT_QS 2
    395 #define HCBT_CREATEWND 3
    396 #define HCBT_DESTROYWND 4
    397 #define HCBT_ACTIVATE 5
    398 #define HCBT_CLICKSKIPPED 6
    399 #define HCBT_KEYSKIPPED 7
    400 #define HCBT_SYSCOMMAND 8
    401 #define HCBT_SETFOCUS 9
    402 
    403   typedef struct tagCBT_CREATEWNDA {
    404     struct tagCREATESTRUCTA *lpcs;
    405     HWND hwndInsertAfter;
    406   } CBT_CREATEWNDA,*LPCBT_CREATEWNDA;
    407 
    408   typedef struct tagCBT_CREATEWNDW {
    409     struct tagCREATESTRUCTW *lpcs;
    410     HWND hwndInsertAfter;
    411   } CBT_CREATEWNDW,*LPCBT_CREATEWNDW;
    412 
    413   __MINGW_TYPEDEF_AW(CBT_CREATEWND)
    414   __MINGW_TYPEDEF_AW(LPCBT_CREATEWND)
    415 
    416   typedef struct tagCBTACTIVATESTRUCT
    417   {
    418     WINBOOL fMouse;
    419     HWND hWndActive;
    420   } CBTACTIVATESTRUCT,*LPCBTACTIVATESTRUCT;
    421 
    422   typedef struct tagWTSSESSION_NOTIFICATION {
    423     DWORD cbSize;
    424     DWORD dwSessionId;
    425 
    426   } WTSSESSION_NOTIFICATION,*PWTSSESSION_NOTIFICATION;
    427 
    428 #define WTS_CONSOLE_CONNECT 0x1
    429 #define WTS_CONSOLE_DISCONNECT 0x2
    430 #define WTS_REMOTE_CONNECT 0x3
    431 #define WTS_REMOTE_DISCONNECT 0x4
    432 #define WTS_SESSION_LOGON 0x5
    433 #define WTS_SESSION_LOGOFF 0x6
    434 #define WTS_SESSION_LOCK 0x7
    435 #define WTS_SESSION_UNLOCK 0x8
    436 #define WTS_SESSION_REMOTE_CONTROL 0x9
    437 
    438 #define MSGF_DIALOGBOX 0
    439 #define MSGF_MESSAGEBOX 1
    440 #define MSGF_MENU 2
    441 #define MSGF_SCROLLBAR 5
    442 #define MSGF_NEXTWINDOW 6
    443 #define MSGF_MAX 8
    444 #define MSGF_USER 4096
    445 
    446 #define HSHELL_WINDOWCREATED 1
    447 #define HSHELL_WINDOWDESTROYED 2
    448 #define HSHELL_ACTIVATESHELLWINDOW 3
    449 
    450 #define HSHELL_WINDOWACTIVATED 4
    451 #define HSHELL_GETMINRECT 5
    452 #define HSHELL_REDRAW 6
    453 #define HSHELL_TASKMAN 7
    454 #define HSHELL_LANGUAGE 8
    455 #define HSHELL_SYSMENU 9
    456 #define HSHELL_ENDTASK 10
    457 #define HSHELL_ACCESSIBILITYSTATE 11
    458 #define HSHELL_APPCOMMAND 12
    459 #define HSHELL_WINDOWREPLACED 13
    460 #define HSHELL_WINDOWREPLACING 14
    461 #define HSHELL_HIGHBIT 0x8000
    462 #define HSHELL_FLASH (HSHELL_REDRAW|HSHELL_HIGHBIT)
    463 #define HSHELL_RUDEAPPACTIVATED (HSHELL_WINDOWACTIVATED|HSHELL_HIGHBIT)
    464 
    465 #define ACCESS_STICKYKEYS 0x0001
    466 #define ACCESS_FILTERKEYS 0x0002
    467 #define ACCESS_MOUSEKEYS 0x0003
    468 
    469 #define APPCOMMAND_BROWSER_BACKWARD 1
    470 #define APPCOMMAND_BROWSER_FORWARD 2
    471 #define APPCOMMAND_BROWSER_REFRESH 3
    472 #define APPCOMMAND_BROWSER_STOP 4
    473 #define APPCOMMAND_BROWSER_SEARCH 5
    474 #define APPCOMMAND_BROWSER_FAVORITES 6
    475 #define APPCOMMAND_BROWSER_HOME 7
    476 #define APPCOMMAND_VOLUME_MUTE 8
    477 #define APPCOMMAND_VOLUME_DOWN 9
    478 #define APPCOMMAND_VOLUME_UP 10
    479 #define APPCOMMAND_MEDIA_NEXTTRACK 11
    480 #define APPCOMMAND_MEDIA_PREVIOUSTRACK 12
    481 #define APPCOMMAND_MEDIA_STOP 13
    482 #define APPCOMMAND_MEDIA_PLAY_PAUSE 14
    483 #define APPCOMMAND_LAUNCH_MAIL 15
    484 #define APPCOMMAND_LAUNCH_MEDIA_SELECT 16
    485 #define APPCOMMAND_LAUNCH_APP1 17
    486 #define APPCOMMAND_LAUNCH_APP2 18
    487 #define APPCOMMAND_BASS_DOWN 19
    488 #define APPCOMMAND_BASS_BOOST 20
    489 #define APPCOMMAND_BASS_UP 21
    490 #define APPCOMMAND_TREBLE_DOWN 22
    491 #define APPCOMMAND_TREBLE_UP 23
    492 #define APPCOMMAND_MICROPHONE_VOLUME_MUTE 24
    493 #define APPCOMMAND_MICROPHONE_VOLUME_DOWN 25
    494 #define APPCOMMAND_MICROPHONE_VOLUME_UP 26
    495 #define APPCOMMAND_HELP 27
    496 #define APPCOMMAND_FIND 28
    497 #define APPCOMMAND_NEW 29
    498 #define APPCOMMAND_OPEN 30
    499 #define APPCOMMAND_CLOSE 31
    500 #define APPCOMMAND_SAVE 32
    501 #define APPCOMMAND_PRINT 33
    502 #define APPCOMMAND_UNDO 34
    503 #define APPCOMMAND_REDO 35
    504 #define APPCOMMAND_COPY 36
    505 #define APPCOMMAND_CUT 37
    506 #define APPCOMMAND_PASTE 38
    507 #define APPCOMMAND_REPLY_TO_MAIL 39
    508 #define APPCOMMAND_FORWARD_MAIL 40
    509 #define APPCOMMAND_SEND_MAIL 41
    510 #define APPCOMMAND_SPELL_CHECK 42
    511 #define APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE 43
    512 #define APPCOMMAND_MIC_ON_OFF_TOGGLE 44
    513 #define APPCOMMAND_CORRECTION_LIST 45
    514 #define APPCOMMAND_MEDIA_PLAY 46
    515 #define APPCOMMAND_MEDIA_PAUSE 47
    516 #define APPCOMMAND_MEDIA_RECORD 48
    517 #define APPCOMMAND_MEDIA_FAST_FORWARD 49
    518 #define APPCOMMAND_MEDIA_REWIND 50
    519 #define APPCOMMAND_MEDIA_CHANNEL_UP 51
    520 #define APPCOMMAND_MEDIA_CHANNEL_DOWN 52
    521 
    522 #define FAPPCOMMAND_MOUSE 0x8000
    523 #define FAPPCOMMAND_KEY 0
    524 #define FAPPCOMMAND_OEM 0x1000
    525 #define FAPPCOMMAND_MASK 0xF000
    526 
    527 #define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
    528 #define GET_DEVICE_LPARAM(lParam) ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))
    529 #define GET_MOUSEORKEY_LPARAM GET_DEVICE_LPARAM
    530 #define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
    531 #define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
    532 
    533   typedef struct {
    534     HWND hwnd;
    535     RECT rc;
    536   } SHELLHOOKINFO,*LPSHELLHOOKINFO;
    537 
    538   typedef struct tagEVENTMSG {
    539     UINT message;
    540     UINT paramL;
    541     UINT paramH;
    542     DWORD time;
    543     HWND hwnd;
    544   } EVENTMSG,*PEVENTMSGMSG,*NPEVENTMSGMSG,*LPEVENTMSGMSG;
    545 
    546   typedef struct tagEVENTMSG *PEVENTMSG,*NPEVENTMSG,*LPEVENTMSG;
    547 
    548   typedef struct tagCWPSTRUCT {
    549     LPARAM lParam;
    550     WPARAM wParam;
    551     UINT message;
    552     HWND hwnd;
    553   } CWPSTRUCT,*PCWPSTRUCT,*NPCWPSTRUCT,*LPCWPSTRUCT;
    554 
    555   typedef struct tagCWPRETSTRUCT {
    556     LRESULT lResult;
    557     LPARAM lParam;
    558     WPARAM wParam;
    559     UINT message;
    560     HWND hwnd;
    561   } CWPRETSTRUCT,*PCWPRETSTRUCT,*NPCWPRETSTRUCT,*LPCWPRETSTRUCT;
    562 
    563 #define LLKHF_EXTENDED (KF_EXTENDED >> 8)
    564 #define LLKHF_INJECTED 0x00000010
    565 #define LLKHF_ALTDOWN (KF_ALTDOWN >> 8)
    566 #define LLKHF_UP (KF_UP >> 8)
    567 
    568 #define LLMHF_INJECTED 0x00000001
    569 
    570   typedef struct tagKBDLLHOOKSTRUCT {
    571     DWORD vkCode;
    572     DWORD scanCode;
    573     DWORD flags;
    574     DWORD time;
    575     ULONG_PTR dwExtraInfo;
    576   } KBDLLHOOKSTRUCT,*LPKBDLLHOOKSTRUCT,*PKBDLLHOOKSTRUCT;
    577 
    578   typedef struct tagMSLLHOOKSTRUCT {
    579     POINT pt;
    580     DWORD mouseData;
    581     DWORD flags;
    582     DWORD time;
    583     ULONG_PTR dwExtraInfo;
    584   } MSLLHOOKSTRUCT,*LPMSLLHOOKSTRUCT,*PMSLLHOOKSTRUCT;
    585 
    586   typedef struct tagDEBUGHOOKINFO {
    587     DWORD idThread;
    588     DWORD idThreadInstaller;
    589     LPARAM lParam;
    590     WPARAM wParam;
    591     int code;
    592   } DEBUGHOOKINFO,*PDEBUGHOOKINFO,*NPDEBUGHOOKINFO,*LPDEBUGHOOKINFO;
    593 
    594   typedef struct tagMOUSEHOOKSTRUCT {
    595     POINT pt;
    596     HWND hwnd;
    597     UINT wHitTestCode;
    598     ULONG_PTR dwExtraInfo;
    599   } MOUSEHOOKSTRUCT,*LPMOUSEHOOKSTRUCT,*PMOUSEHOOKSTRUCT;
    600 
    601 #ifdef __cplusplus
    602   typedef struct tagMOUSEHOOKSTRUCTEX : public tagMOUSEHOOKSTRUCT {
    603     DWORD mouseData;
    604   } MOUSEHOOKSTRUCTEX,*LPMOUSEHOOKSTRUCTEX,*PMOUSEHOOKSTRUCTEX;
    605 #else
    606   typedef struct tagMOUSEHOOKSTRUCTEX {
    607     MOUSEHOOKSTRUCT _unnamed;
    608     DWORD mouseData;
    609   } MOUSEHOOKSTRUCTEX,*LPMOUSEHOOKSTRUCTEX,*PMOUSEHOOKSTRUCTEX;
    610 #endif
    611 
    612   typedef struct tagHARDWAREHOOKSTRUCT {
    613     HWND hwnd;
    614     UINT message;
    615     WPARAM wParam;
    616     LPARAM lParam;
    617   } HARDWAREHOOKSTRUCT,*LPHARDWAREHOOKSTRUCT,*PHARDWAREHOOKSTRUCT;
    618 #endif
    619 
    620 #define HKL_PREV 0
    621 #define HKL_NEXT 1
    622 
    623 #define KLF_ACTIVATE 0x00000001
    624 #define KLF_SUBSTITUTE_OK 0x00000002
    625 #define KLF_REORDER 0x00000008
    626 #define KLF_REPLACELANG 0x00000010
    627 #define KLF_NOTELLSHELL 0x00000080
    628 #define KLF_SETFORPROCESS 0x00000100
    629 #define KLF_SHIFTLOCK 0x00010000
    630 #define KLF_RESET 0x40000000
    631 
    632 #define INPUTLANGCHANGE_SYSCHARSET 0x0001
    633 #define INPUTLANGCHANGE_FORWARD 0x0002
    634 #define INPUTLANGCHANGE_BACKWARD 0x0004
    635 
    636 #define KL_NAMELENGTH 9
    637 
    638 #define LoadKeyboardLayout __MINGW_NAME_AW(LoadKeyboardLayout)
    639 #define GetKeyboardLayoutName __MINGW_NAME_AW(GetKeyboardLayoutName)
    640 
    641   WINUSERAPI HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID,UINT Flags);
    642   WINUSERAPI HKL WINAPI LoadKeyboardLayoutW(LPCWSTR pwszKLID,UINT Flags);
    643   WINUSERAPI HKL WINAPI ActivateKeyboardLayout(HKL hkl,UINT Flags);
    644   WINUSERAPI int WINAPI ToUnicodeEx(UINT wVirtKey,UINT wScanCode,CONST BYTE *lpKeyState,LPWSTR pwszBuff,int cchBuff,UINT wFlags,HKL dwhkl);
    645   WINUSERAPI WINBOOL WINAPI UnloadKeyboardLayout(HKL hkl);
    646   WINUSERAPI WINBOOL WINAPI GetKeyboardLayoutNameA(LPSTR pwszKLID);
    647   WINUSERAPI WINBOOL WINAPI GetKeyboardLayoutNameW(LPWSTR pwszKLID);
    648   WINUSERAPI int WINAPI GetKeyboardLayoutList(int nBuff,HKL *lpList);
    649   WINUSERAPI HKL WINAPI GetKeyboardLayout(DWORD idThread);
    650 
    651   typedef struct tagMOUSEMOVEPOINT {
    652     int x;
    653     int y;
    654     DWORD time;
    655     ULONG_PTR dwExtraInfo;
    656   } MOUSEMOVEPOINT,*PMOUSEMOVEPOINT,*LPMOUSEMOVEPOINT;
    657 
    658 #define GMMP_USE_DISPLAY_POINTS 1
    659 #define GMMP_USE_HIGH_RESOLUTION_POINTS 2
    660 
    661   WINUSERAPI int WINAPI GetMouseMovePointsEx(UINT cbSize,LPMOUSEMOVEPOINT lppt,LPMOUSEMOVEPOINT lpptBuf,int nBufPoints,DWORD resolution);
    662 
    663 #ifndef NODESKTOP
    664 
    665 #define DESKTOP_READOBJECTS __MSABI_LONG(0x0001)
    666 #define DESKTOP_CREATEWINDOW __MSABI_LONG(0x0002)
    667 #define DESKTOP_CREATEMENU __MSABI_LONG(0x0004)
    668 #define DESKTOP_HOOKCONTROL __MSABI_LONG(0x0008)
    669 #define DESKTOP_JOURNALRECORD __MSABI_LONG(0x0010)
    670 #define DESKTOP_JOURNALPLAYBACK __MSABI_LONG(0x0020)
    671 #define DESKTOP_ENUMERATE __MSABI_LONG(0x0040)
    672 #define DESKTOP_WRITEOBJECTS __MSABI_LONG(0x0080)
    673 #define DESKTOP_SWITCHDESKTOP __MSABI_LONG(0x0100)
    674 
    675 #define DF_ALLOWOTHERACCOUNTHOOK __MSABI_LONG(0x0001)
    676 
    677 #ifdef _WINGDI_
    678 #ifndef NOGDI
    679 #define CreateDesktop __MINGW_NAME_AW(CreateDesktop)
    680 
    681   WINUSERAPI HDESK WINAPI CreateDesktopA(LPCSTR lpszDesktop,LPCSTR lpszDevice,LPDEVMODEA pDevmode,DWORD dwFlags,ACCESS_MASK dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa);
    682   WINUSERAPI HDESK WINAPI CreateDesktopW(LPCWSTR lpszDesktop,LPCWSTR lpszDevice,LPDEVMODEW pDevmode,DWORD dwFlags,ACCESS_MASK dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa);
    683 #endif
    684 #endif
    685 
    686 #define OpenDesktop __MINGW_NAME_AW(OpenDesktop)
    687 #define EnumDesktops __MINGW_NAME_AW(EnumDesktops)
    688 
    689   WINUSERAPI HDESK WINAPI OpenDesktopA(LPCSTR lpszDesktop,DWORD dwFlags,WINBOOL fInherit,ACCESS_MASK dwDesiredAccess);
    690   WINUSERAPI HDESK WINAPI OpenDesktopW(LPCWSTR lpszDesktop,DWORD dwFlags,WINBOOL fInherit,ACCESS_MASK dwDesiredAccess);
    691   WINUSERAPI HDESK WINAPI OpenInputDesktop(DWORD dwFlags,WINBOOL fInherit,ACCESS_MASK dwDesiredAccess);
    692   WINUSERAPI WINBOOL WINAPI EnumDesktopsA(HWINSTA hwinsta,DESKTOPENUMPROCA lpEnumFunc,LPARAM lParam);
    693   WINUSERAPI WINBOOL WINAPI EnumDesktopsW(HWINSTA hwinsta,DESKTOPENUMPROCW lpEnumFunc,LPARAM lParam);
    694   WINUSERAPI WINBOOL WINAPI EnumDesktopWindows(HDESK hDesktop,WNDENUMPROC lpfn,LPARAM lParam);
    695   WINUSERAPI WINBOOL WINAPI SwitchDesktop(HDESK hDesktop);
    696   WINUSERAPI WINBOOL WINAPI SetThreadDesktop(HDESK hDesktop);
    697   WINUSERAPI WINBOOL WINAPI CloseDesktop(HDESK hDesktop);
    698   WINUSERAPI HDESK WINAPI GetThreadDesktop(DWORD dwThreadId);
    699 #endif
    700 
    701 #ifndef NOWINDOWSTATION
    702 #define WINSTA_ENUMDESKTOPS __MSABI_LONG(0x0001)
    703 #define WINSTA_READATTRIBUTES __MSABI_LONG(0x0002)
    704 #define WINSTA_ACCESSCLIPBOARD __MSABI_LONG(0x0004)
    705 #define WINSTA_CREATEDESKTOP __MSABI_LONG(0x0008)
    706 #define WINSTA_WRITEATTRIBUTES __MSABI_LONG(0x0010)
    707 #define WINSTA_ACCESSGLOBALATOMS __MSABI_LONG(0x0020)
    708 #define WINSTA_EXITWINDOWS __MSABI_LONG(0x0040)
    709 #define WINSTA_ENUMERATE __MSABI_LONG(0x0100)
    710 #define WINSTA_READSCREEN __MSABI_LONG(0x0200)
    711 #define WINSTA_ALL_ACCESS (WINSTA_ENUMDESKTOPS | WINSTA_READATTRIBUTES | WINSTA_ACCESSCLIPBOARD | WINSTA_CREATEDESKTOP | WINSTA_WRITEATTRIBUTES | WINSTA_ACCESSGLOBALATOMS | WINSTA_EXITWINDOWS | WINSTA_ENUMERATE | WINSTA_READSCREEN)
    712 
    713 #define CWF_CREATE_ONLY __MSABI_LONG(0x0001)
    714 
    715 #define WSF_VISIBLE __MSABI_LONG(0x0001)
    716 
    717 #define CreateWindowStation __MINGW_NAME_AW(CreateWindowStation)
    718 #define OpenWindowStation __MINGW_NAME_AW(OpenWindowStation)
    719 #define EnumWindowStations __MINGW_NAME_AW(EnumWindowStations)
    720 
    721   WINUSERAPI HWINSTA WINAPI CreateWindowStationA(LPCSTR lpwinsta,DWORD dwFlags,ACCESS_MASK dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa);
    722   WINUSERAPI HWINSTA WINAPI CreateWindowStationW(LPCWSTR lpwinsta,DWORD dwFlags,ACCESS_MASK dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa);
    723   WINUSERAPI HWINSTA WINAPI OpenWindowStationA(LPCSTR lpszWinSta,WINBOOL fInherit,ACCESS_MASK dwDesiredAccess);
    724   WINUSERAPI HWINSTA WINAPI OpenWindowStationW(LPCWSTR lpszWinSta,WINBOOL fInherit,ACCESS_MASK dwDesiredAccess);
    725   WINUSERAPI WINBOOL WINAPI EnumWindowStationsA(WINSTAENUMPROCA lpEnumFunc,LPARAM lParam);
    726   WINUSERAPI WINBOOL WINAPI EnumWindowStationsW(WINSTAENUMPROCW lpEnumFunc,LPARAM lParam);
    727   WINUSERAPI WINBOOL WINAPI CloseWindowStation(HWINSTA hWinSta);
    728   WINUSERAPI WINBOOL WINAPI SetProcessWindowStation(HWINSTA hWinSta);
    729   WINUSERAPI HWINSTA WINAPI GetProcessWindowStation(VOID);
    730 #endif
    731 
    732 #ifndef NOSECURITY
    733   WINUSERAPI WINBOOL WINAPI SetUserObjectSecurity(HANDLE hObj,PSECURITY_INFORMATION pSIRequested,PSECURITY_DESCRIPTOR pSID);
    734   WINUSERAPI WINBOOL WINAPI GetUserObjectSecurity(HANDLE hObj,PSECURITY_INFORMATION pSIRequested,PSECURITY_DESCRIPTOR pSID,DWORD nLength,LPDWORD lpnLengthNeeded);
    735 
    736 #define UOI_FLAGS 1
    737 #define UOI_NAME 2
    738 #define UOI_TYPE 3
    739 #define UOI_USER_SID 4
    740 
    741   typedef struct tagUSEROBJECTFLAGS {
    742     WINBOOL fInherit;
    743     WINBOOL fReserved;
    744     DWORD dwFlags;
    745   } USEROBJECTFLAGS,*PUSEROBJECTFLAGS;
    746 
    747 #define GetUserObjectInformation __MINGW_NAME_AW(GetUserObjectInformation)
    748 #define SetUserObjectInformation __MINGW_NAME_AW(SetUserObjectInformation)
    749 
    750   WINUSERAPI WINBOOL WINAPI GetUserObjectInformationA(HANDLE hObj,int nIndex,PVOID pvInfo,DWORD nLength,LPDWORD lpnLengthNeeded);
    751   WINUSERAPI WINBOOL WINAPI GetUserObjectInformationW(HANDLE hObj,int nIndex,PVOID pvInfo,DWORD nLength,LPDWORD lpnLengthNeeded);
    752   WINUSERAPI WINBOOL WINAPI SetUserObjectInformationA(HANDLE hObj,int nIndex,PVOID pvInfo,DWORD nLength);
    753   WINUSERAPI WINBOOL WINAPI SetUserObjectInformationW(HANDLE hObj,int nIndex,PVOID pvInfo,DWORD nLength);
    754 #endif
    755 
    756   typedef struct tagWNDCLASSEXA {
    757     UINT cbSize;
    758     UINT style;
    759     WNDPROC lpfnWndProc;
    760     int cbClsExtra;
    761     int cbWndExtra;
    762     HINSTANCE hInstance;
    763     HICON hIcon;
    764     HCURSOR hCursor;
    765     HBRUSH hbrBackground;
    766     LPCSTR lpszMenuName;
    767     LPCSTR lpszClassName;
    768     HICON hIconSm;
    769   } WNDCLASSEXA,*PWNDCLASSEXA,*NPWNDCLASSEXA,*LPWNDCLASSEXA;
    770 
    771   typedef struct tagWNDCLASSEXW {
    772     UINT cbSize;
    773     UINT style;
    774     WNDPROC lpfnWndProc;
    775     int cbClsExtra;
    776     int cbWndExtra;
    777     HINSTANCE hInstance;
    778     HICON hIcon;
    779     HCURSOR hCursor;
    780     HBRUSH hbrBackground;
    781     LPCWSTR lpszMenuName;
    782     LPCWSTR lpszClassName;
    783 
    784     HICON hIconSm;
    785   } WNDCLASSEXW,*PWNDCLASSEXW,*NPWNDCLASSEXW,*LPWNDCLASSEXW;
    786 
    787   __MINGW_TYPEDEF_AW(WNDCLASSEX)
    788   __MINGW_TYPEDEF_AW(PWNDCLASSEX)
    789   __MINGW_TYPEDEF_AW(NPWNDCLASSEX)
    790   __MINGW_TYPEDEF_AW(LPWNDCLASSEX)
    791 
    792   typedef struct tagWNDCLASSA {
    793     UINT style;
    794     WNDPROC lpfnWndProc;
    795     int cbClsExtra;
    796     int cbWndExtra;
    797     HINSTANCE hInstance;
    798     HICON hIcon;
    799     HCURSOR hCursor;
    800     HBRUSH hbrBackground;
    801     LPCSTR lpszMenuName;
    802     LPCSTR lpszClassName;
    803   } WNDCLASSA,*PWNDCLASSA,*NPWNDCLASSA,*LPWNDCLASSA;
    804 
    805   typedef struct tagWNDCLASSW {
    806     UINT style;
    807     WNDPROC lpfnWndProc;
    808     int cbClsExtra;
    809     int cbWndExtra;
    810     HINSTANCE hInstance;
    811     HICON hIcon;
    812     HCURSOR hCursor;
    813     HBRUSH hbrBackground;
    814     LPCWSTR lpszMenuName;
    815     LPCWSTR lpszClassName;
    816   } WNDCLASSW,*PWNDCLASSW,*NPWNDCLASSW,*LPWNDCLASSW;
    817 
    818   __MINGW_TYPEDEF_AW(WNDCLASS)
    819   __MINGW_TYPEDEF_AW(PWNDCLASS)
    820   __MINGW_TYPEDEF_AW(NPWNDCLASS)
    821   __MINGW_TYPEDEF_AW(LPWNDCLASS)
    822 
    823   WINUSERAPI WINBOOL WINAPI IsHungAppWindow(HWND hwnd);
    824   WINUSERAPI VOID WINAPI DisableProcessWindowsGhosting(VOID);
    825 
    826 #ifndef NOMSG
    827   typedef struct tagMSG {
    828     HWND hwnd;
    829     UINT message;
    830     WPARAM wParam;
    831     LPARAM lParam;
    832     DWORD time;
    833     POINT pt;
    834   } MSG,*PMSG,*NPMSG,*LPMSG;
    835 
    836 #define POINTSTOPOINT(pt,pts) { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts); (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); }
    837 
    838 #define POINTTOPOINTS(pt) (MAKELONG((short)((pt).x),(short)((pt).y)))
    839 #define MAKEWPARAM(l,h) ((WPARAM)(DWORD)MAKELONG(l,h))
    840 #define MAKELPARAM(l,h) ((LPARAM)(DWORD)MAKELONG(l,h))
    841 #define MAKELRESULT(l,h) ((LRESULT)(DWORD)MAKELONG(l,h))
    842 #endif
    843 
    844 #ifndef NOWINOFFSETS
    845 #define GWL_WNDPROC (-4)
    846 #define GWL_HINSTANCE (-6)
    847 #define GWL_HWNDPARENT (-8)
    848 #define GWL_STYLE (-16)
    849 #define GWL_EXSTYLE (-20)
    850 #define GWL_USERDATA (-21)
    851 #define GWL_ID (-12)
    852 
    853 #ifdef _WIN64
    854 #undef GWL_WNDPROC
    855 #undef GWL_HINSTANCE
    856 #undef GWL_HWNDPARENT
    857 #undef GWL_USERDATA
    858 #endif
    859 
    860 #define GWLP_WNDPROC (-4)
    861 #define GWLP_HINSTANCE (-6)
    862 #define GWLP_HWNDPARENT (-8)
    863 #define GWLP_USERDATA (-21)
    864 #define GWLP_ID (-12)
    865 
    866 #define GCL_MENUNAME (-8)
    867 #define GCL_HBRBACKGROUND (-10)
    868 #define GCL_HCURSOR (-12)
    869 #define GCL_HICON (-14)
    870 #define GCL_HMODULE (-16)
    871 #define GCL_CBWNDEXTRA (-18)
    872 #define GCL_CBCLSEXTRA (-20)
    873 #define GCL_WNDPROC (-24)
    874 #define GCL_STYLE (-26)
    875 #define GCW_ATOM (-32)
    876 #define GCL_HICONSM (-34)
    877 
    878 #ifdef _WIN64
    879 
    880 #undef GCL_MENUNAME
    881 #undef GCL_HBRBACKGROUND
    882 #undef GCL_HCURSOR
    883 #undef GCL_HICON
    884 #undef GCL_HMODULE
    885 #undef GCL_WNDPROC
    886 #undef GCL_HICONSM
    887 #endif
    888 
    889 #define GCLP_MENUNAME (-8)
    890 #define GCLP_HBRBACKGROUND (-10)
    891 #define GCLP_HCURSOR (-12)
    892 #define GCLP_HICON (-14)
    893 #define GCLP_HMODULE (-16)
    894 #define GCLP_WNDPROC (-24)
    895 #define GCLP_HICONSM (-34)
    896 #endif
    897 
    898 #ifndef NOWINMESSAGES
    899 
    900 #define WM_NULL 0x0000
    901 #define WM_CREATE 0x0001
    902 #define WM_DESTROY 0x0002
    903 #define WM_MOVE 0x0003
    904 #define WM_SIZE 0x0005
    905 
    906 #define WM_ACTIVATE 0x0006
    907 
    908 #define WA_INACTIVE 0
    909 #define WA_ACTIVE 1
    910 #define WA_CLICKACTIVE 2
    911 
    912 #define WM_SETFOCUS 0x0007
    913 #define WM_KILLFOCUS 0x0008
    914 #define WM_ENABLE 0x000A
    915 #define WM_SETREDRAW 0x000B
    916 #define WM_SETTEXT 0x000C
    917 #define WM_GETTEXT 0x000D
    918 #define WM_GETTEXTLENGTH 0x000E
    919 #define WM_PAINT 0x000F
    920 #define WM_CLOSE 0x0010
    921 #ifndef _WIN32_WCE
    922 #define WM_QUERYENDSESSION 0x0011
    923 #define WM_QUERYOPEN 0x0013
    924 #define WM_ENDSESSION 0x0016
    925 #endif
    926 #define WM_QUIT 0x0012
    927 #define WM_ERASEBKGND 0x0014
    928 #define WM_SYSCOLORCHANGE 0x0015
    929 #define WM_SHOWWINDOW 0x0018
    930 #define WM_WININICHANGE 0x001A
    931 #define WM_SETTINGCHANGE WM_WININICHANGE
    932 #define WM_DEVMODECHANGE 0x001B
    933 #define WM_ACTIVATEAPP 0x001C
    934 #define WM_FONTCHANGE 0x001D
    935 #define WM_TIMECHANGE 0x001E
    936 #define WM_CANCELMODE 0x001F
    937 #define WM_SETCURSOR 0x0020
    938 #define WM_MOUSEACTIVATE 0x0021
    939 #define WM_CHILDACTIVATE 0x0022
    940 #define WM_QUEUESYNC 0x0023
    941 
    942 #define WM_GETMINMAXINFO 0x0024
    943 
    944   typedef struct tagMINMAXINFO {
    945     POINT ptReserved;
    946     POINT ptMaxSize;
    947     POINT ptMaxPosition;
    948     POINT ptMinTrackSize;
    949     POINT ptMaxTrackSize;
    950   } MINMAXINFO,*PMINMAXINFO,*LPMINMAXINFO;
    951 
    952 #define WM_PAINTICON 0x0026
    953 #define WM_ICONERASEBKGND 0x0027
    954 #define WM_NEXTDLGCTL 0x0028
    955 #define WM_SPOOLERSTATUS 0x002A
    956 #define WM_DRAWITEM 0x002B
    957 #define WM_MEASUREITEM 0x002C
    958 #define WM_DELETEITEM 0x002D
    959 #define WM_VKEYTOITEM 0x002E
    960 #define WM_CHARTOITEM 0x002F
    961 #define WM_SETFONT 0x0030
    962 #define WM_GETFONT 0x0031
    963 #define WM_SETHOTKEY 0x0032
    964 #define WM_GETHOTKEY 0x0033
    965 #define WM_QUERYDRAGICON 0x0037
    966 #define WM_COMPAREITEM 0x0039
    967 #ifndef _WIN32_WCE
    968 #define WM_GETOBJECT 0x003D
    969 #endif
    970 #define WM_COMPACTING 0x0041
    971 #define WM_COMMNOTIFY 0x0044
    972 #define WM_WINDOWPOSCHANGING 0x0046
    973 #define WM_WINDOWPOSCHANGED 0x0047
    974 
    975 #define WM_POWER 0x0048
    976 
    977 #define PWR_OK 1
    978 #define PWR_FAIL (-1)
    979 #define PWR_SUSPENDREQUEST 1
    980 #define PWR_SUSPENDRESUME 2
    981 #define PWR_CRITICALRESUME 3
    982 
    983 #define WM_COPYDATA 0x004A
    984 #define WM_CANCELJOURNAL 0x004B
    985 
    986   typedef struct tagCOPYDATASTRUCT {
    987     ULONG_PTR dwData;
    988     DWORD cbData;
    989     PVOID lpData;
    990   } COPYDATASTRUCT,*PCOPYDATASTRUCT;
    991 
    992   typedef struct tagMDINEXTMENU {
    993     HMENU hmenuIn;
    994     HMENU hmenuNext;
    995     HWND hwndNext;
    996   } MDINEXTMENU,*PMDINEXTMENU,*LPMDINEXTMENU;
    997 
    998 #define WM_NOTIFY 0x004E
    999 #define WM_INPUTLANGCHANGEREQUEST 0x0050
   1000 #define WM_INPUTLANGCHANGE 0x0051
   1001 #define WM_TCARD 0x0052
   1002 #define WM_HELP 0x0053
   1003 #define WM_USERCHANGED 0x0054
   1004 #define WM_NOTIFYFORMAT 0x0055
   1005 
   1006 #define NFR_ANSI 1
   1007 #define NFR_UNICODE 2
   1008 #define NF_QUERY 3
   1009 #define NF_REQUERY 4
   1010 
   1011 #define WM_CONTEXTMENU 0x007B
   1012 #define WM_STYLECHANGING 0x007C
   1013 #define WM_STYLECHANGED 0x007D
   1014 #define WM_DISPLAYCHANGE 0x007E
   1015 #define WM_GETICON 0x007F
   1016 #define WM_SETICON 0x0080
   1017 
   1018 #define WM_NCCREATE 0x0081
   1019 #define WM_NCDESTROY 0x0082
   1020 #define WM_NCCALCSIZE 0x0083
   1021 #define WM_NCHITTEST 0x0084
   1022 #define WM_NCPAINT 0x0085
   1023 #define WM_NCACTIVATE 0x0086
   1024 #define WM_GETDLGCODE 0x0087
   1025 #ifndef _WIN32_WCE
   1026 #define WM_SYNCPAINT 0x0088
   1027 #endif
   1028 #define WM_NCMOUSEMOVE 0x00A0
   1029 #define WM_NCLBUTTONDOWN 0x00A1
   1030 #define WM_NCLBUTTONUP 0x00A2
   1031 #define WM_NCLBUTTONDBLCLK 0x00A3
   1032 #define WM_NCRBUTTONDOWN 0x00A4
   1033 #define WM_NCRBUTTONUP 0x00A5
   1034 #define WM_NCRBUTTONDBLCLK 0x00A6
   1035 #define WM_NCMBUTTONDOWN 0x00A7
   1036 #define WM_NCMBUTTONUP 0x00A8
   1037 #define WM_NCMBUTTONDBLCLK 0x00A9
   1038 
   1039 #define WM_NCXBUTTONDOWN 0x00AB
   1040 #define WM_NCXBUTTONUP 0x00AC
   1041 #define WM_NCXBUTTONDBLCLK 0x00AD
   1042 #define WM_INPUT 0x00FF
   1043 #define WM_KEYFIRST 0x0100
   1044 #define WM_KEYDOWN 0x0100
   1045 #define WM_KEYUP 0x0101
   1046 #define WM_CHAR 0x0102
   1047 #define WM_DEADCHAR 0x0103
   1048 #define WM_SYSKEYDOWN 0x0104
   1049 #define WM_SYSKEYUP 0x0105
   1050 #define WM_SYSCHAR 0x0106
   1051 #define WM_SYSDEADCHAR 0x0107
   1052 #define WM_UNICHAR 0x0109
   1053 #define WM_KEYLAST 0x0109
   1054 #define UNICODE_NOCHAR 0xFFFF
   1055 #define WM_IME_STARTCOMPOSITION 0x010D
   1056 #define WM_IME_ENDCOMPOSITION 0x010E
   1057 #define WM_IME_COMPOSITION 0x010F
   1058 #define WM_IME_KEYLAST 0x010F
   1059 #define WM_INITDIALOG 0x0110
   1060 #define WM_COMMAND 0x0111
   1061 #define WM_SYSCOMMAND 0x0112
   1062 #define WM_TIMER 0x0113
   1063 #define WM_HSCROLL 0x0114
   1064 #define WM_VSCROLL 0x0115
   1065 #define WM_INITMENU 0x0116
   1066 #define WM_INITMENUPOPUP 0x0117
   1067 #define WM_MENUSELECT 0x011F
   1068 #if (_WIN32_WINNT >= 0x0601)
   1069 #define WM_GESTURE 0x0119
   1070 #define WM_GESTURENOTIFY 0x011A
   1071 #endif /* _WIN32_WINNT >= 0x0601 */
   1072 #define WM_MENUCHAR 0x0120
   1073 #define WM_ENTERIDLE 0x0121
   1074 #ifndef _WIN32_WCE
   1075 #define WM_MENURBUTTONUP 0x0122
   1076 #define WM_MENUDRAG 0x0123
   1077 #define WM_MENUGETOBJECT 0x0124
   1078 #define WM_UNINITMENUPOPUP 0x0125
   1079 #define WM_MENUCOMMAND 0x0126
   1080 
   1081 #ifndef _WIN32_WCE
   1082 #define WM_CHANGEUISTATE 0x0127
   1083 #define WM_UPDATEUISTATE 0x0128
   1084 #define WM_QUERYUISTATE 0x0129
   1085 
   1086 #define UIS_SET 1
   1087 #define UIS_CLEAR 2
   1088 #define UIS_INITIALIZE 3
   1089 
   1090 #define UISF_HIDEFOCUS 0x1
   1091 #define UISF_HIDEACCEL 0x2
   1092 #define UISF_ACTIVE 0x4
   1093 #endif
   1094 #endif
   1095 
   1096 #define WM_CTLCOLORMSGBOX 0x0132
   1097 #define WM_CTLCOLOREDIT 0x0133
   1098 #define WM_CTLCOLORLISTBOX 0x0134
   1099 #define WM_CTLCOLORBTN 0x0135
   1100 #define WM_CTLCOLORDLG 0x0136
   1101 #define WM_CTLCOLORSCROLLBAR 0x0137
   1102 #define WM_CTLCOLORSTATIC 0x0138
   1103 #define MN_GETHMENU 0x01E1
   1104 
   1105 #define WM_MOUSEFIRST 0x0200
   1106 #define WM_MOUSEMOVE 0x0200
   1107 #define WM_LBUTTONDOWN 0x0201
   1108 #define WM_LBUTTONUP 0x0202
   1109 #define WM_LBUTTONDBLCLK 0x0203
   1110 #define WM_RBUTTONDOWN 0x0204
   1111 #define WM_RBUTTONUP 0x0205
   1112 #define WM_RBUTTONDBLCLK 0x0206
   1113 #define WM_MBUTTONDOWN 0x0207
   1114 #define WM_MBUTTONUP 0x0208
   1115 #define WM_MBUTTONDBLCLK 0x0209
   1116 #define WM_MOUSEWHEEL 0x020A
   1117 #define WM_XBUTTONDOWN 0x020B
   1118 #define WM_XBUTTONUP 0x020C
   1119 #define WM_XBUTTONDBLCLK 0x020D
   1120 #define WM_MOUSELAST 0x020D
   1121 
   1122 #if (_WIN32_WINNT >= 0x0600)
   1123 #define WM_MOUSEHWHEEL 0x020E
   1124 #endif
   1125 
   1126 #define WHEEL_DELTA 120
   1127 #define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
   1128 
   1129 #define WHEEL_PAGESCROLL (UINT_MAX)
   1130 
   1131 #define GET_KEYSTATE_WPARAM(wParam) (LOWORD(wParam))
   1132 #define GET_NCHITTEST_WPARAM(wParam) ((short)LOWORD(wParam))
   1133 #define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
   1134 
   1135 #define XBUTTON1 0x0001
   1136 #define XBUTTON2 0x0002
   1137 
   1138 #define WM_PARENTNOTIFY 0x0210
   1139 #define WM_ENTERMENULOOP 0x0211
   1140 #define WM_EXITMENULOOP 0x0212
   1141 
   1142 #define WM_NEXTMENU 0x0213
   1143 #define WM_SIZING 0x0214
   1144 #define WM_CAPTURECHANGED 0x0215
   1145 #define WM_MOVING 0x0216
   1146 
   1147 #define WM_POWERBROADCAST 0x0218
   1148 
   1149 #ifndef _WIN32_WCE
   1150 #define PBT_APMQUERYSUSPEND 0x0000
   1151 #define PBT_APMQUERYSTANDBY 0x0001
   1152 
   1153 #define PBT_APMQUERYSUSPENDFAILED 0x0002
   1154 #define PBT_APMQUERYSTANDBYFAILED 0x0003
   1155 
   1156 #define PBT_APMSUSPEND 0x0004
   1157 #define PBT_APMSTANDBY 0x0005
   1158 
   1159 #define PBT_APMRESUMECRITICAL 0x0006
   1160 #define PBT_APMRESUMESUSPEND 0x0007
   1161 #define PBT_APMRESUMESTANDBY 0x0008
   1162 
   1163 #define PBTF_APMRESUMEFROMFAILURE 0x00000001
   1164 
   1165 #define PBT_APMBATTERYLOW 0x0009
   1166 #define PBT_APMPOWERSTATUSCHANGE 0x000A
   1167 
   1168 #define PBT_APMOEMEVENT 0x000B
   1169 #define PBT_APMRESUMEAUTOMATIC 0x0012
   1170 #endif
   1171 
   1172 #if (_WIN32_WINNT >= 0x0502)
   1173 #define PBT_POWERSETTINGCHANGE 32787
   1174 #endif
   1175 
   1176 #define WM_DEVICECHANGE 0x0219
   1177 
   1178 #define WM_MDICREATE 0x0220
   1179 #define WM_MDIDESTROY 0x0221
   1180 #define WM_MDIACTIVATE 0x0222
   1181 #define WM_MDIRESTORE 0x0223
   1182 #define WM_MDINEXT 0x0224
   1183 #define WM_MDIMAXIMIZE 0x0225
   1184 #define WM_MDITILE 0x0226
   1185 #define WM_MDICASCADE 0x0227
   1186 #define WM_MDIICONARRANGE 0x0228
   1187 #define WM_MDIGETACTIVE 0x0229
   1188 
   1189 #define WM_MDISETMENU 0x0230
   1190 #define WM_ENTERSIZEMOVE 0x0231
   1191 #define WM_EXITSIZEMOVE 0x0232
   1192 #define WM_DROPFILES 0x0233
   1193 #define WM_MDIREFRESHMENU 0x0234
   1194 
   1195 #define WM_IME_SETCONTEXT 0x0281
   1196 #define WM_IME_NOTIFY 0x0282
   1197 #define WM_IME_CONTROL 0x0283
   1198 #define WM_IME_COMPOSITIONFULL 0x0284
   1199 #define WM_IME_SELECT 0x0285
   1200 #define WM_IME_CHAR 0x0286
   1201 #define WM_IME_REQUEST 0x0288
   1202 #define WM_IME_KEYDOWN 0x0290
   1203 #define WM_IME_KEYUP 0x0291
   1204 
   1205 #define WM_MOUSEHOVER 0x02A1
   1206 #define WM_MOUSELEAVE 0x02A3
   1207 #define WM_NCMOUSEHOVER 0x02A0
   1208 #define WM_NCMOUSELEAVE 0x02A2
   1209 #define WM_WTSSESSION_CHANGE 0x02B1
   1210 #define WM_TABLET_FIRST 0x02c0
   1211 #define WM_TABLET_LAST 0x02df
   1212 #define WM_CUT 0x0300
   1213 #define WM_COPY 0x0301
   1214 #define WM_PASTE 0x0302
   1215 #define WM_CLEAR 0x0303
   1216 #define WM_UNDO 0x0304
   1217 #define WM_RENDERFORMAT 0x0305
   1218 #define WM_RENDERALLFORMATS 0x0306
   1219 #define WM_DESTROYCLIPBOARD 0x0307
   1220 #define WM_DRAWCLIPBOARD 0x0308
   1221 #define WM_PAINTCLIPBOARD 0x0309
   1222 #define WM_VSCROLLCLIPBOARD 0x030A
   1223 #define WM_SIZECLIPBOARD 0x030B
   1224 #define WM_ASKCBFORMATNAME 0x030C
   1225 #define WM_CHANGECBCHAIN 0x030D
   1226 #define WM_HSCROLLCLIPBOARD 0x030E
   1227 #define WM_QUERYNEWPALETTE 0x030F
   1228 #define WM_PALETTEISCHANGING 0x0310
   1229 #define WM_PALETTECHANGED 0x0311
   1230 #define WM_HOTKEY 0x0312
   1231 #define WM_PRINT 0x0317
   1232 #define WM_PRINTCLIENT 0x0318
   1233 #define WM_APPCOMMAND 0x0319
   1234 #define WM_THEMECHANGED 0x031A
   1235 #define WM_HANDHELDFIRST 0x0358
   1236 #define WM_HANDHELDLAST 0x035F
   1237 #define WM_AFXFIRST 0x0360
   1238 #define WM_AFXLAST 0x037F
   1239 #define WM_PENWINFIRST 0x0380
   1240 #define WM_PENWINLAST 0x038F
   1241 #define WM_APP 0x8000
   1242 #define WM_USER 0x0400
   1243 
   1244 #define WMSZ_LEFT 1
   1245 #define WMSZ_RIGHT 2
   1246 #define WMSZ_TOP 3
   1247 #define WMSZ_TOPLEFT 4
   1248 #define WMSZ_TOPRIGHT 5
   1249 #define WMSZ_BOTTOM 6
   1250 #define WMSZ_BOTTOMLEFT 7
   1251 #define WMSZ_BOTTOMRIGHT 8
   1252 
   1253 #ifndef NONCMESSAGES
   1254 
   1255 #define HTERROR (-2)
   1256 #define HTTRANSPARENT (-1)
   1257 #define HTNOWHERE 0
   1258 #define HTCLIENT 1
   1259 #define HTCAPTION 2
   1260 #define HTSYSMENU 3
   1261 #define HTGROWBOX 4
   1262 #define HTSIZE HTGROWBOX
   1263 #define HTMENU 5
   1264 #define HTHSCROLL 6
   1265 #define HTVSCROLL 7
   1266 #define HTMINBUTTON 8
   1267 #define HTMAXBUTTON 9
   1268 #define HTLEFT 10
   1269 #define HTRIGHT 11
   1270 #define HTTOP 12
   1271 #define HTTOPLEFT 13
   1272 #define HTTOPRIGHT 14
   1273 #define HTBOTTOM 15
   1274 #define HTBOTTOMLEFT 16
   1275 #define HTBOTTOMRIGHT 17
   1276 #define HTBORDER 18
   1277 #define HTREDUCE HTMINBUTTON
   1278 #define HTZOOM HTMAXBUTTON
   1279 #define HTSIZEFIRST HTLEFT
   1280 #define HTSIZELAST HTBOTTOMRIGHT
   1281 #define HTOBJECT 19
   1282 #define HTCLOSE 20
   1283 #define HTHELP 21
   1284 
   1285 #define SMTO_NORMAL 0x0000
   1286 #define SMTO_BLOCK 0x0001
   1287 #define SMTO_ABORTIFHUNG 0x0002
   1288 #define SMTO_NOTIMEOUTIFNOTHUNG 0x0008
   1289 #endif
   1290 
   1291 #define MA_ACTIVATE 1
   1292 #define MA_ACTIVATEANDEAT 2
   1293 #define MA_NOACTIVATE 3
   1294 #define MA_NOACTIVATEANDEAT 4
   1295 
   1296 #define ICON_SMALL 0
   1297 #define ICON_BIG 1
   1298 #define ICON_SMALL2 2
   1299 
   1300 #define RegisterWindowMessage __MINGW_NAME_AW(RegisterWindowMessage)
   1301 
   1302   WINUSERAPI UINT WINAPI RegisterWindowMessageA(LPCSTR lpString);
   1303   WINUSERAPI UINT WINAPI RegisterWindowMessageW(LPCWSTR lpString);
   1304 
   1305 #define SIZE_RESTORED 0
   1306 #define SIZE_MINIMIZED 1
   1307 #define SIZE_MAXIMIZED 2
   1308 #define SIZE_MAXSHOW 3
   1309 #define SIZE_MAXHIDE 4
   1310 
   1311 #define SIZENORMAL SIZE_RESTORED
   1312 #define SIZEICONIC SIZE_MINIMIZED
   1313 #define SIZEFULLSCREEN SIZE_MAXIMIZED
   1314 #define SIZEZOOMSHOW SIZE_MAXSHOW
   1315 #define SIZEZOOMHIDE SIZE_MAXHIDE
   1316 
   1317   typedef struct tagWINDOWPOS {
   1318     HWND hwnd;
   1319     HWND hwndInsertAfter;
   1320     int x;
   1321     int y;
   1322     int cx;
   1323     int cy;
   1324     UINT flags;
   1325   } WINDOWPOS,*LPWINDOWPOS,*PWINDOWPOS;
   1326 
   1327   typedef struct tagNCCALCSIZE_PARAMS {
   1328     RECT rgrc[3];
   1329     PWINDOWPOS lppos;
   1330   } NCCALCSIZE_PARAMS,*LPNCCALCSIZE_PARAMS;
   1331 
   1332 #define WVR_ALIGNTOP 0x0010
   1333 #define WVR_ALIGNLEFT 0x0020
   1334 #define WVR_ALIGNBOTTOM 0x0040
   1335 #define WVR_ALIGNRIGHT 0x0080
   1336 #define WVR_HREDRAW 0x0100
   1337 #define WVR_VREDRAW 0x0200
   1338 #define WVR_REDRAW (WVR_HREDRAW | WVR_VREDRAW)
   1339 #define WVR_VALIDRECTS 0x0400
   1340 
   1341 #ifndef NOKEYSTATES
   1342 
   1343 #define MK_LBUTTON 0x0001
   1344 #define MK_RBUTTON 0x0002
   1345 #define MK_SHIFT 0x0004
   1346 #define MK_CONTROL 0x0008
   1347 #define MK_MBUTTON 0x0010
   1348 #define MK_XBUTTON1 0x0020
   1349 #define MK_XBUTTON2 0x0040
   1350 #endif
   1351 
   1352 #ifndef NOTRACKMOUSEEVENT
   1353 #define TME_HOVER 0x00000001
   1354 #define TME_LEAVE 0x00000002
   1355 #define TME_NONCLIENT 0x00000010
   1356 #define TME_QUERY 0x40000000
   1357 #define TME_CANCEL 0x80000000
   1358 
   1359 #define HOVER_DEFAULT 0xFFFFFFFF
   1360 #endif
   1361 
   1362   typedef struct tagTRACKMOUSEEVENT {
   1363     DWORD cbSize;
   1364     DWORD dwFlags;
   1365     HWND hwndTrack;
   1366     DWORD dwHoverTime;
   1367   } TRACKMOUSEEVENT,*LPTRACKMOUSEEVENT;
   1368 
   1369   WINUSERAPI WINBOOL WINAPI TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack);
   1370 #endif
   1371 
   1372 #ifndef NOWINSTYLES
   1373 
   1374 #define WS_OVERLAPPED __MSABI_LONG(0x00000000)
   1375 #define WS_POPUP __MSABI_LONG(0x80000000)
   1376 #define WS_CHILD __MSABI_LONG(0x40000000)
   1377 #define WS_MINIMIZE __MSABI_LONG(0x20000000)
   1378 #define WS_VISIBLE __MSABI_LONG(0x10000000)
   1379 #define WS_DISABLED __MSABI_LONG(0x08000000)
   1380 #define WS_CLIPSIBLINGS __MSABI_LONG(0x04000000)
   1381 #define WS_CLIPCHILDREN __MSABI_LONG(0x02000000)
   1382 #define WS_MAXIMIZE __MSABI_LONG(0x01000000)
   1383 #define WS_CAPTION __MSABI_LONG(0x00C00000)
   1384 #define WS_BORDER __MSABI_LONG(0x00800000)
   1385 #define WS_DLGFRAME __MSABI_LONG(0x00400000)
   1386 #define WS_VSCROLL __MSABI_LONG(0x00200000)
   1387 #define WS_HSCROLL __MSABI_LONG(0x00100000)
   1388 #define WS_SYSMENU __MSABI_LONG(0x00080000)
   1389 #define WS_THICKFRAME __MSABI_LONG(0x00040000)
   1390 #define WS_GROUP __MSABI_LONG(0x00020000)
   1391 #define WS_TABSTOP __MSABI_LONG(0x00010000)
   1392 #define WS_MINIMIZEBOX __MSABI_LONG(0x00020000)
   1393 #define WS_MAXIMIZEBOX __MSABI_LONG(0x00010000)
   1394 #define WS_TILED WS_OVERLAPPED
   1395 #define WS_ICONIC WS_MINIMIZE
   1396 #define WS_SIZEBOX WS_THICKFRAME
   1397 #define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
   1398 #define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
   1399 #define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
   1400 #define WS_CHILDWINDOW (WS_CHILD)
   1401 
   1402 #define WS_EX_DLGMODALFRAME __MSABI_LONG(0x00000001)
   1403 #define WS_EX_NOPARENTNOTIFY __MSABI_LONG(0x00000004)
   1404 #define WS_EX_TOPMOST __MSABI_LONG(0x00000008)
   1405 #define WS_EX_ACCEPTFILES __MSABI_LONG(0x00000010)
   1406 #define WS_EX_TRANSPARENT __MSABI_LONG(0x00000020)
   1407 #define WS_EX_MDICHILD __MSABI_LONG(0x00000040)
   1408 #define WS_EX_TOOLWINDOW __MSABI_LONG(0x00000080)
   1409 #define WS_EX_WINDOWEDGE __MSABI_LONG(0x00000100)
   1410 #define WS_EX_CLIENTEDGE __MSABI_LONG(0x00000200)
   1411 #define WS_EX_CONTEXTHELP __MSABI_LONG(0x00000400)
   1412 #define WS_EX_RIGHT __MSABI_LONG(0x00001000)
   1413 #define WS_EX_LEFT __MSABI_LONG(0x00000000)
   1414 #define WS_EX_RTLREADING __MSABI_LONG(0x00002000)
   1415 #define WS_EX_LTRREADING __MSABI_LONG(0x00000000)
   1416 #define WS_EX_LEFTSCROLLBAR __MSABI_LONG(0x00004000)
   1417 #define WS_EX_RIGHTSCROLLBAR __MSABI_LONG(0x00000000)
   1418 #define WS_EX_CONTROLPARENT __MSABI_LONG(0x00010000)
   1419 #define WS_EX_STATICEDGE __MSABI_LONG(0x00020000)
   1420 #define WS_EX_APPWINDOW __MSABI_LONG(0x00040000)
   1421 #define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
   1422 #define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
   1423 #define WS_EX_LAYERED 0x00080000
   1424 #define WS_EX_NOINHERITLAYOUT __MSABI_LONG(0x00100000)
   1425 #define WS_EX_LAYOUTRTL __MSABI_LONG(0x00400000)
   1426 #define WS_EX_COMPOSITED __MSABI_LONG(0x02000000)
   1427 #define WS_EX_NOACTIVATE __MSABI_LONG(0x08000000)
   1428 
   1429 #define CS_VREDRAW 0x0001
   1430 #define CS_HREDRAW 0x0002
   1431 #define CS_DBLCLKS 0x0008
   1432 #define CS_OWNDC 0x0020
   1433 #define CS_CLASSDC 0x0040
   1434 #define CS_PARENTDC 0x0080
   1435 #define CS_NOCLOSE 0x0200
   1436 #define CS_SAVEBITS 0x0800
   1437 #define CS_BYTEALIGNCLIENT 0x1000
   1438 #define CS_BYTEALIGNWINDOW 0x2000
   1439 #define CS_GLOBALCLASS 0x4000
   1440 #define CS_IME 0x00010000
   1441 #define CS_DROPSHADOW 0x00020000
   1442 #endif
   1443 
   1444 #define PRF_CHECKVISIBLE __MSABI_LONG(0x00000001)
   1445 #define PRF_NONCLIENT __MSABI_LONG(0x00000002)
   1446 #define PRF_CLIENT __MSABI_LONG(0x00000004)
   1447 #define PRF_ERASEBKGND __MSABI_LONG(0x00000008)
   1448 #define PRF_CHILDREN __MSABI_LONG(0x00000010)
   1449 #define PRF_OWNED __MSABI_LONG(0x00000020)
   1450 
   1451 #define BDR_RAISEDOUTER 0x0001
   1452 #define BDR_SUNKENOUTER 0x0002
   1453 #define BDR_RAISEDINNER 0x0004
   1454 #define BDR_SUNKENINNER 0x0008
   1455 
   1456 #define BDR_OUTER (BDR_RAISEDOUTER | BDR_SUNKENOUTER)
   1457 #define BDR_INNER (BDR_RAISEDINNER | BDR_SUNKENINNER)
   1458 #define BDR_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER)
   1459 #define BDR_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER)
   1460 
   1461 #define EDGE_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER)
   1462 #define EDGE_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER)
   1463 #define EDGE_ETCHED (BDR_SUNKENOUTER | BDR_RAISEDINNER)
   1464 #define EDGE_BUMP (BDR_RAISEDOUTER | BDR_SUNKENINNER)
   1465 
   1466 #define BF_LEFT 0x0001
   1467 #define BF_TOP 0x0002
   1468 #define BF_RIGHT 0x0004
   1469 #define BF_BOTTOM 0x0008
   1470 
   1471 #define BF_TOPLEFT (BF_TOP | BF_LEFT)
   1472 #define BF_TOPRIGHT (BF_TOP | BF_RIGHT)
   1473 #define BF_BOTTOMLEFT (BF_BOTTOM | BF_LEFT)
   1474 #define BF_BOTTOMRIGHT (BF_BOTTOM | BF_RIGHT)
   1475 #define BF_RECT (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM)
   1476 
   1477 #define BF_DIAGONAL 0x0010
   1478 
   1479 #define BF_DIAGONAL_ENDTOPRIGHT (BF_DIAGONAL | BF_TOP | BF_RIGHT)
   1480 #define BF_DIAGONAL_ENDTOPLEFT (BF_DIAGONAL | BF_TOP | BF_LEFT)
   1481 #define BF_DIAGONAL_ENDBOTTOMLEFT (BF_DIAGONAL | BF_BOTTOM | BF_LEFT)
   1482 #define BF_DIAGONAL_ENDBOTTOMRIGHT (BF_DIAGONAL | BF_BOTTOM | BF_RIGHT)
   1483 
   1484 #define BF_MIDDLE 0x0800
   1485 #define BF_SOFT 0x1000
   1486 #define BF_ADJUST 0x2000
   1487 #define BF_FLAT 0x4000
   1488 #define BF_MONO 0x8000
   1489 
   1490   WINUSERAPI WINBOOL WINAPI DrawEdge(HDC hdc,LPRECT qrc,UINT edge,UINT grfFlags);
   1491 
   1492 #define DFC_CAPTION 1
   1493 #define DFC_MENU 2
   1494 #define DFC_SCROLL 3
   1495 #define DFC_BUTTON 4
   1496 #define DFC_POPUPMENU 5
   1497 
   1498 #define DFCS_CAPTIONCLOSE 0x0000
   1499 #define DFCS_CAPTIONMIN 0x0001
   1500 #define DFCS_CAPTIONMAX 0x0002
   1501 #define DFCS_CAPTIONRESTORE 0x0003
   1502 #define DFCS_CAPTIONHELP 0x0004
   1503 
   1504 #define DFCS_MENUARROW 0x0000
   1505 #define DFCS_MENUCHECK 0x0001
   1506 #define DFCS_MENUBULLET 0x0002
   1507 #define DFCS_MENUARROWRIGHT 0x0004
   1508 #define DFCS_SCROLLUP 0x0000
   1509 #define DFCS_SCROLLDOWN 0x0001
   1510 #define DFCS_SCROLLLEFT 0x0002
   1511 #define DFCS_SCROLLRIGHT 0x0003
   1512 #define DFCS_SCROLLCOMBOBOX 0x0005
   1513 #define DFCS_SCROLLSIZEGRIP 0x0008
   1514 #define DFCS_SCROLLSIZEGRIPRIGHT 0x0010
   1515 
   1516 #define DFCS_BUTTONCHECK 0x0000
   1517 #define DFCS_BUTTONRADIOIMAGE 0x0001
   1518 #define DFCS_BUTTONRADIOMASK 0x0002
   1519 #define DFCS_BUTTONRADIO 0x0004
   1520 #define DFCS_BUTTON3STATE 0x0008
   1521 #define DFCS_BUTTONPUSH 0x0010
   1522 
   1523 #define DFCS_INACTIVE 0x0100
   1524 #define DFCS_PUSHED 0x0200
   1525 #define DFCS_CHECKED 0x0400
   1526 
   1527 #define DFCS_TRANSPARENT 0x0800
   1528 #define DFCS_HOT 0x1000
   1529 
   1530 #define DFCS_ADJUSTRECT 0x2000
   1531 #define DFCS_FLAT 0x4000
   1532 #define DFCS_MONO 0x8000
   1533 
   1534   WINUSERAPI WINBOOL WINAPI DrawFrameControl(HDC,LPRECT,UINT,UINT);
   1535 
   1536 #define DC_ACTIVE 0x0001
   1537 #define DC_SMALLCAP 0x0002
   1538 #define DC_ICON 0x0004
   1539 #define DC_TEXT 0x0008
   1540 #define DC_INBUTTON 0x0010
   1541 #define DC_GRADIENT 0x0020
   1542 #define DC_BUTTONS 0x1000
   1543 
   1544   WINUSERAPI WINBOOL WINAPI DrawCaption(HWND hwnd,HDC hdc,CONST RECT *lprect,UINT flags);
   1545 
   1546 #define IDANI_OPEN 1
   1547 #define IDANI_CAPTION 3
   1548 
   1549   WINUSERAPI WINBOOL WINAPI DrawAnimatedRects(HWND hwnd,int idAni,CONST RECT *lprcFrom,CONST RECT *lprcTo);
   1550 
   1551 #ifndef NOCLIPBOARD
   1552 
   1553 #define CF_TEXT 1
   1554 #define CF_BITMAP 2
   1555 #define CF_METAFILEPICT 3
   1556 #define CF_SYLK 4
   1557 #define CF_DIF 5
   1558 #define CF_TIFF 6
   1559 #define CF_OEMTEXT 7
   1560 #define CF_DIB 8
   1561 #define CF_PALETTE 9
   1562 #define CF_PENDATA 10
   1563 #define CF_RIFF 11
   1564 #define CF_WAVE 12
   1565 #define CF_UNICODETEXT 13
   1566 #define CF_ENHMETAFILE 14
   1567 #define CF_HDROP 15
   1568 #define CF_LOCALE 16
   1569 #define CF_DIBV5 17
   1570 #define CF_MAX 18
   1571 
   1572 #define CF_OWNERDISPLAY 0x0080
   1573 #define CF_DSPTEXT 0x0081
   1574 #define CF_DSPBITMAP 0x0082
   1575 #define CF_DSPMETAFILEPICT 0x0083
   1576 #define CF_DSPENHMETAFILE 0x008E
   1577 
   1578 #define CF_PRIVATEFIRST 0x0200
   1579 #define CF_PRIVATELAST 0x02FF
   1580 
   1581 #define CF_GDIOBJFIRST 0x0300
   1582 #define CF_GDIOBJLAST 0x03FF
   1583 #endif
   1584 
   1585 #define FVIRTKEY TRUE
   1586 #define FNOINVERT 0x02
   1587 #define FSHIFT 0x04
   1588 #define FCONTROL 0x08
   1589 #define FALT 0x10
   1590 
   1591   typedef struct tagACCEL {
   1592     BYTE fVirt;
   1593     WORD key;
   1594     WORD cmd;
   1595   } ACCEL,*LPACCEL;
   1596 
   1597   typedef struct tagPAINTSTRUCT {
   1598     HDC hdc;
   1599     WINBOOL fErase;
   1600     RECT rcPaint;
   1601     WINBOOL fRestore;
   1602     WINBOOL fIncUpdate;
   1603     BYTE rgbReserved[32];
   1604   } PAINTSTRUCT,*PPAINTSTRUCT,*NPPAINTSTRUCT,*LPPAINTSTRUCT;
   1605 
   1606   typedef struct tagCREATESTRUCTA {
   1607     LPVOID lpCreateParams;
   1608     HINSTANCE hInstance;
   1609     HMENU hMenu;
   1610     HWND hwndParent;
   1611     int cy;
   1612     int cx;
   1613     int y;
   1614     int x;
   1615     LONG style;
   1616     LPCSTR lpszName;
   1617     LPCSTR lpszClass;
   1618     DWORD dwExStyle;
   1619   } CREATESTRUCTA,*LPCREATESTRUCTA;
   1620 
   1621   typedef struct tagCREATESTRUCTW {
   1622     LPVOID lpCreateParams;
   1623     HINSTANCE hInstance;
   1624     HMENU hMenu;
   1625     HWND hwndParent;
   1626     int cy;
   1627     int cx;
   1628     int y;
   1629     int x;
   1630     LONG style;
   1631     LPCWSTR lpszName;
   1632     LPCWSTR lpszClass;
   1633     DWORD dwExStyle;
   1634   } CREATESTRUCTW,*LPCREATESTRUCTW;
   1635 
   1636   __MINGW_TYPEDEF_AW(CREATESTRUCT)
   1637   __MINGW_TYPEDEF_AW(LPCREATESTRUCT)
   1638 
   1639   typedef struct tagWINDOWPLACEMENT {
   1640     UINT length;
   1641     UINT flags;
   1642     UINT showCmd;
   1643     POINT ptMinPosition;
   1644     POINT ptMaxPosition;
   1645     RECT rcNormalPosition;
   1646   } WINDOWPLACEMENT;
   1647   typedef WINDOWPLACEMENT *PWINDOWPLACEMENT,*LPWINDOWPLACEMENT;
   1648 
   1649 #define WPF_SETMINPOSITION 0x0001
   1650 #define WPF_RESTORETOMAXIMIZED 0x0002
   1651 #define WPF_ASYNCWINDOWPLACEMENT 0x0004
   1652 
   1653   typedef struct tagNMHDR {
   1654     HWND hwndFrom;
   1655     UINT_PTR idFrom;
   1656     UINT code;
   1657   } NMHDR;
   1658 
   1659   typedef NMHDR *LPNMHDR;
   1660 
   1661   typedef struct tagSTYLESTRUCT {
   1662     DWORD styleOld;
   1663     DWORD styleNew;
   1664   } STYLESTRUCT,*LPSTYLESTRUCT;
   1665 
   1666 #define ODT_MENU 1
   1667 #define ODT_LISTBOX 2
   1668 #define ODT_COMBOBOX 3
   1669 #define ODT_BUTTON 4
   1670 #define ODT_STATIC 5
   1671 
   1672 #define ODA_DRAWENTIRE 0x0001
   1673 #define ODA_SELECT 0x0002
   1674 #define ODA_FOCUS 0x0004
   1675 
   1676 #define ODS_SELECTED 0x0001
   1677 #define ODS_GRAYED 0x0002
   1678 #define ODS_DISABLED 0x0004
   1679 #define ODS_CHECKED 0x0008
   1680 #define ODS_FOCUS 0x0010
   1681 #define ODS_DEFAULT 0x0020
   1682 #define ODS_COMBOBOXEDIT 0x1000
   1683 #define ODS_HOTLIGHT 0x0040
   1684 #define ODS_INACTIVE 0x0080
   1685 #define ODS_NOACCEL 0x0100
   1686 #define ODS_NOFOCUSRECT 0x0200
   1687 
   1688   typedef struct tagMEASUREITEMSTRUCT {
   1689     UINT CtlType;
   1690     UINT CtlID;
   1691     UINT itemID;
   1692     UINT itemWidth;
   1693     UINT itemHeight;
   1694     ULONG_PTR itemData;
   1695   } MEASUREITEMSTRUCT,*PMEASUREITEMSTRUCT,*LPMEASUREITEMSTRUCT;
   1696 
   1697   typedef struct tagDRAWITEMSTRUCT {
   1698     UINT CtlType;
   1699     UINT CtlID;
   1700     UINT itemID;
   1701     UINT itemAction;
   1702     UINT itemState;
   1703     HWND hwndItem;
   1704     HDC hDC;
   1705     RECT rcItem;
   1706     ULONG_PTR itemData;
   1707   } DRAWITEMSTRUCT,*PDRAWITEMSTRUCT,*LPDRAWITEMSTRUCT;
   1708 
   1709   typedef struct tagDELETEITEMSTRUCT {
   1710     UINT CtlType;
   1711     UINT CtlID;
   1712     UINT itemID;
   1713     HWND hwndItem;
   1714     ULONG_PTR itemData;
   1715   } DELETEITEMSTRUCT,*PDELETEITEMSTRUCT,*LPDELETEITEMSTRUCT;
   1716 
   1717   typedef struct tagCOMPAREITEMSTRUCT {
   1718     UINT CtlType;
   1719     UINT CtlID;
   1720     HWND hwndItem;
   1721     UINT itemID1;
   1722     ULONG_PTR itemData1;
   1723     UINT itemID2;
   1724     ULONG_PTR itemData2;
   1725     DWORD dwLocaleId;
   1726   } COMPAREITEMSTRUCT,*PCOMPAREITEMSTRUCT,*LPCOMPAREITEMSTRUCT;
   1727 
   1728 #ifndef NOMSG
   1729 #define GetMessage __MINGW_NAME_AW(GetMessage)
   1730 #define DispatchMessage __MINGW_NAME_AW(DispatchMessage)
   1731 #define PeekMessage __MINGW_NAME_AW(PeekMessage)
   1732 
   1733   WINUSERAPI WINBOOL WINAPI GetMessageA(LPMSG lpMsg,HWND hWnd,UINT wMsgFilterMin,UINT wMsgFilterMax);
   1734   WINUSERAPI WINBOOL WINAPI GetMessageW(LPMSG lpMsg,HWND hWnd,UINT wMsgFilterMin,UINT wMsgFilterMax);
   1735   WINUSERAPI WINBOOL WINAPI TranslateMessage(CONST MSG *lpMsg);
   1736   WINUSERAPI LRESULT WINAPI DispatchMessageA(CONST MSG *lpMsg);
   1737   WINUSERAPI LRESULT WINAPI DispatchMessageW(CONST MSG *lpMsg);
   1738   WINUSERAPI WINBOOL WINAPI SetMessageQueue(int cMessagesMax);
   1739   WINUSERAPI WINBOOL WINAPI PeekMessageA(LPMSG lpMsg,HWND hWnd,UINT wMsgFilterMin,UINT wMsgFilterMax,UINT wRemoveMsg);
   1740   WINUSERAPI WINBOOL WINAPI PeekMessageW(LPMSG lpMsg,HWND hWnd,UINT wMsgFilterMin,UINT wMsgFilterMax,UINT wRemoveMsg);
   1741 
   1742 #define PM_NOREMOVE 0x0000
   1743 #define PM_REMOVE 0x0001
   1744 #define PM_NOYIELD 0x0002
   1745 #define PM_QS_INPUT (QS_INPUT << 16)
   1746 #define PM_QS_POSTMESSAGE ((QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16)
   1747 #define PM_QS_PAINT (QS_PAINT << 16)
   1748 #define PM_QS_SENDMESSAGE (QS_SENDMESSAGE << 16)
   1749 #endif
   1750 
   1751   WINUSERAPI WINBOOL WINAPI RegisterHotKey(HWND hWnd,int id,UINT fsModifiers,UINT vk);
   1752   WINUSERAPI WINBOOL WINAPI UnregisterHotKey(HWND hWnd,int id);
   1753 
   1754 #define MOD_ALT 0x0001
   1755 #define MOD_CONTROL 0x0002
   1756 #define MOD_SHIFT 0x0004
   1757 #define MOD_WIN 0x0008
   1758 
   1759 #define IDHOT_SNAPWINDOW (-1)
   1760 #define IDHOT_SNAPDESKTOP (-2)
   1761 
   1762 #ifdef WIN_INTERNAL
   1763 #ifndef LSTRING
   1764 #define NOLSTRING
   1765 #endif
   1766 #ifndef LFILEIO
   1767 #define NOLFILEIO
   1768 #endif
   1769 #endif
   1770 
   1771 #define ENDSESSION_LOGOFF 0x80000000
   1772 
   1773 #define EWX_LOGOFF 0
   1774 #define EWX_SHUTDOWN 0x00000001
   1775 #define EWX_REBOOT 0x00000002
   1776 #define EWX_FORCE 0x00000004
   1777 #define EWX_POWEROFF 0x00000008
   1778 #define EWX_FORCEIFHUNG 0x00000010
   1779 
   1780 #define ExitWindows(dwReserved,Code) ExitWindowsEx(EWX_LOGOFF,0xFFFFFFFF)
   1781 
   1782 #define SendMessage __MINGW_NAME_AW(SendMessage)
   1783 #define SendMessageTimeout __MINGW_NAME_AW(SendMessageTimeout)
   1784 #define SendNotifyMessage __MINGW_NAME_AW(SendNotifyMessage)
   1785 #define SendMessageCallback __MINGW_NAME_AW(SendMessageCallback)
   1786 
   1787   WINUSERAPI WINBOOL WINAPI ExitWindowsEx(UINT uFlags,DWORD dwReason);
   1788   WINUSERAPI WINBOOL WINAPI SwapMouseButton(WINBOOL fSwap);
   1789   WINUSERAPI DWORD WINAPI GetMessagePos(VOID);
   1790   WINUSERAPI LONG WINAPI GetMessageTime(VOID);
   1791   WINUSERAPI LPARAM WINAPI GetMessageExtraInfo(VOID);
   1792   WINUSERAPI WINBOOL WINAPI IsWow64Message(VOID);
   1793   WINUSERAPI LPARAM WINAPI SetMessageExtraInfo(LPARAM lParam);
   1794   WINUSERAPI LRESULT WINAPI SendMessageA(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1795   WINUSERAPI LRESULT WINAPI SendMessageW(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1796   WINUSERAPI LRESULT WINAPI SendMessageTimeoutA(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam,UINT fuFlags,UINT uTimeout,PDWORD_PTR lpdwResult);
   1797   WINUSERAPI LRESULT WINAPI SendMessageTimeoutW(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam,UINT fuFlags,UINT uTimeout,PDWORD_PTR lpdwResult);
   1798   WINUSERAPI WINBOOL WINAPI SendNotifyMessageA(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1799   WINUSERAPI WINBOOL WINAPI SendNotifyMessageW(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1800   WINUSERAPI WINBOOL WINAPI SendMessageCallbackA(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam,SENDASYNCPROC lpResultCallBack,ULONG_PTR dwData);
   1801   WINUSERAPI WINBOOL WINAPI SendMessageCallbackW(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam,SENDASYNCPROC lpResultCallBack,ULONG_PTR dwData);
   1802 
   1803   typedef struct {
   1804     UINT cbSize;
   1805     HDESK hdesk;
   1806     HWND hwnd;
   1807     LUID luid;
   1808   } BSMINFO,*PBSMINFO;
   1809 
   1810 #define BroadcastSystemMessageEx __MINGW_NAME_AW(BroadcastSystemMessageEx)
   1811 #define BroadcastSystemMessage __MINGW_NAME_AW(BroadcastSystemMessage)
   1812 
   1813   WINUSERAPI __LONG32 WINAPI BroadcastSystemMessageExA(DWORD flags,LPDWORD lpInfo,UINT Msg,WPARAM wParam,LPARAM lParam,PBSMINFO pbsmInfo);
   1814   WINUSERAPI __LONG32 WINAPI BroadcastSystemMessageExW(DWORD flags,LPDWORD lpInfo,UINT Msg,WPARAM wParam,LPARAM lParam,PBSMINFO pbsmInfo);
   1815   WINUSERAPI __LONG32 WINAPI BroadcastSystemMessageA(DWORD flags,LPDWORD lpInfo,UINT Msg,WPARAM wParam,LPARAM lParam);
   1816   WINUSERAPI __LONG32 WINAPI BroadcastSystemMessageW(DWORD flags,LPDWORD lpInfo,UINT Msg,WPARAM wParam,LPARAM lParam);
   1817 
   1818 #define BSM_ALLCOMPONENTS 0x00000000
   1819 #define BSM_VXDS 0x00000001
   1820 #define BSM_NETDRIVER 0x00000002
   1821 #define BSM_INSTALLABLEDRIVERS 0x00000004
   1822 #define BSM_APPLICATIONS 0x00000008
   1823 #define BSM_ALLDESKTOPS 0x00000010
   1824 
   1825 #define BSF_QUERY 0x00000001
   1826 #define BSF_IGNORECURRENTTASK 0x00000002
   1827 #define BSF_FLUSHDISK 0x00000004
   1828 #define BSF_NOHANG 0x00000008
   1829 #define BSF_POSTMESSAGE 0x00000010
   1830 #define BSF_FORCEIFHUNG 0x00000020
   1831 #define BSF_NOTIMEOUTIFNOTHUNG 0x00000040
   1832 #define BSF_ALLOWSFW 0x00000080
   1833 #define BSF_SENDNOTIFYMESSAGE 0x00000100
   1834 #define BSF_RETURNHDESK 0x00000200
   1835 #define BSF_LUID 0x00000400
   1836 
   1837 #define BROADCAST_QUERY_DENY 0x424D5144
   1838 
   1839   typedef PVOID HDEVNOTIFY;
   1840   typedef HDEVNOTIFY *PHDEVNOTIFY;
   1841 
   1842 #define DEVICE_NOTIFY_WINDOW_HANDLE 0x00000000
   1843 #define DEVICE_NOTIFY_SERVICE_HANDLE 0x00000001
   1844 #define DEVICE_NOTIFY_ALL_INTERFACE_CLASSES 0x00000004
   1845 
   1846 #define RegisterDeviceNotification __MINGW_NAME_AW(RegisterDeviceNotification)
   1847 #define PostMessage __MINGW_NAME_AW(PostMessage)
   1848 #define PostThreadMessage __MINGW_NAME_AW(PostThreadMessage)
   1849 #define PostAppMessage __MINGW_NAME_AW(PostAppMessage)
   1850 #define DefWindowProc __MINGW_NAME_AW(DefWindowProc)
   1851 #define CallWindowProc __MINGW_NAME_AW(CallWindowProc)
   1852 #define RegisterClass __MINGW_NAME_AW(RegisterClass)
   1853 #define UnregisterClass __MINGW_NAME_AW(UnregisterClass)
   1854 #define GetClassInfo __MINGW_NAME_AW(GetClassInfo)
   1855 #define RegisterClassEx __MINGW_NAME_AW(RegisterClassEx)
   1856 #define GetClassInfoEx __MINGW_NAME_AW(GetClassInfoEx)
   1857 
   1858 #if (_WIN32_WINNT >= 0x0502)
   1859   typedef HANDLE HPOWERNOTIFY;
   1860   typedef HPOWERNOTIFY *PHPOWERNOTIFY;
   1861 
   1862   typedef struct {
   1863     GUID PowerSetting;
   1864     DWORD DataLength;
   1865     UCHAR Data[1];
   1866   } POWERBROADCAST_SETTING, *PPOWERBROADCAST_SETTING;
   1867 
   1868   extern const GUID GUID_POWERSCHEME_PERSONALITY;
   1869   extern const GUID GUID_MIN_POWER_SAVINGS;
   1870   extern const GUID GUID_MAX_POWER_SAVINGS;
   1871   extern const GUID GUID_TYPICAL_POWER_SAVINGS;
   1872   extern const GUID GUID_ACDC_POWER_SOURCE;
   1873   extern const GUID GUID_BATTERY_PERCENTAGE_REMAINING;
   1874   extern const GUID GUID_IDLE_BACKGROUND_TASK;
   1875   extern const GUID GUID_SYSTEM_AWAYMODE;
   1876   extern const GUID GUID_MONITOR_POWER_ON;
   1877 #endif
   1878 
   1879   WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hRecipient,LPVOID NotificationFilter,DWORD Flags);
   1880   WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE hRecipient,LPVOID NotificationFilter,DWORD Flags);
   1881 #if (_WIN32_WINNT >= 0x0600)
   1882   WINUSERAPI HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE hRecipient,LPCGUID PowerSettingGuid,DWORD Flags);
   1883   WINUSERAPI WINBOOL WINAPI UnregisterPowerSettingNotification(HPOWERNOTIFY Handle);
   1884 #endif
   1885   WINUSERAPI WINBOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY Handle);
   1886   WINUSERAPI WINBOOL WINAPI PostMessageA(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1887   WINUSERAPI WINBOOL WINAPI PostMessageW(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1888   WINUSERAPI WINBOOL WINAPI PostThreadMessageA(DWORD idThread,UINT Msg,WPARAM wParam,LPARAM lParam);
   1889   WINUSERAPI WINBOOL WINAPI PostThreadMessageW(DWORD idThread,UINT Msg,WPARAM wParam,LPARAM lParam);
   1890 #define PostAppMessageA(idThread,wMsg,wParam,lParam) PostThreadMessageA((DWORD)idThread,wMsg,wParam,lParam)
   1891 #define PostAppMessageW(idThread,wMsg,wParam,lParam) PostThreadMessageW((DWORD)idThread,wMsg,wParam,lParam)
   1892 
   1893 #define HWND_BROADCAST ((HWND)0xffff)
   1894 #define HWND_MESSAGE ((HWND)-3)
   1895 
   1896   WINUSERAPI WINBOOL WINAPI AttachThreadInput(DWORD idAttach,DWORD idAttachTo,WINBOOL fAttach);
   1897   WINUSERAPI WINBOOL WINAPI ReplyMessage(LRESULT lResult);
   1898   WINUSERAPI WINBOOL WINAPI WaitMessage(VOID);
   1899   WINUSERAPI DWORD WINAPI WaitForInputIdle(HANDLE hProcess,DWORD dwMilliseconds);
   1900   WINUSERAPI LRESULT WINAPI DefWindowProcA(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1901   WINUSERAPI LRESULT WINAPI DefWindowProcW(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1902   WINUSERAPI VOID WINAPI PostQuitMessage(int nExitCode);
   1903   WINUSERAPI LRESULT WINAPI CallWindowProcA(WNDPROC lpPrevWndFunc,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1904   WINUSERAPI LRESULT WINAPI CallWindowProcW(WNDPROC lpPrevWndFunc,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
   1905   WINUSERAPI WINBOOL WINAPI InSendMessage(VOID);
   1906   WINUSERAPI DWORD WINAPI InSendMessageEx(LPVOID lpReserved);
   1907 
   1908 #define ISMEX_NOSEND 0x00000000
   1909 #define ISMEX_SEND 0x00000001
   1910 #define ISMEX_NOTIFY 0x00000002
   1911 #define ISMEX_CALLBACK 0x00000004
   1912 #define ISMEX_REPLIED 0x00000008
   1913 
   1914   WINUSERAPI UINT WINAPI GetDoubleClickTime(VOID);
   1915   WINUSERAPI WINBOOL WINAPI SetDoubleClickTime(UINT);
   1916   WINUSERAPI ATOM WINAPI RegisterClassA(CONST WNDCLASSA *lpWndClass);
   1917   WINUSERAPI ATOM WINAPI RegisterClassW(CONST WNDCLASSW *lpWndClass);
   1918   WINUSERAPI WINBOOL WINAPI UnregisterClassA(LPCSTR lpClassName,HINSTANCE hInstance);
   1919   WINUSERAPI WINBOOL WINAPI UnregisterClassW(LPCWSTR lpClassName,HINSTANCE hInstance);
   1920   WINUSERAPI WINBOOL WINAPI GetClassInfoA(HINSTANCE hInstance,LPCSTR lpClassName,LPWNDCLASSA lpWndClass);
   1921   WINUSERAPI WINBOOL WINAPI GetClassInfoW(HINSTANCE hInstance,LPCWSTR lpClassName,LPWNDCLASSW lpWndClass);
   1922   WINUSERAPI ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA *);
   1923   WINUSERAPI ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW *);
   1924   WINUSERAPI WINBOOL WINAPI GetClassInfoExA(HINSTANCE hInstance,LPCSTR lpszClass,LPWNDCLASSEXA lpwcx);
   1925   WINUSERAPI WINBOOL WINAPI GetClassInfoExW(HINSTANCE hInstance,LPCWSTR lpszClass,LPWNDCLASSEXW lpwcx);
   1926 
   1927 #define CW_USEDEFAULT ((int)0x80000000)
   1928 
   1929 #define HWND_DESKTOP ((HWND)0)
   1930 
   1931   typedef BOOLEAN (WINAPI *PREGISTERCLASSNAMEW)(LPCWSTR);
   1932 
   1933 #define CreateWindowEx __MINGW_NAME_AW(CreateWindowEx)
   1934 #define CreateWindow __MINGW_NAME_AW(CreateWindow)
   1935 
   1936   WINUSERAPI HWND WINAPI CreateWindowExA(DWORD dwExStyle,LPCSTR lpClassName,LPCSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam);
   1937   WINUSERAPI HWND WINAPI CreateWindowExW(DWORD dwExStyle,LPCWSTR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam);
   1938 #define CreateWindowA(lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam) CreateWindowExA((DWORD)0,lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam)
   1939 #define CreateWindowW(lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam) CreateWindowExW((DWORD)0,lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam)
   1940   WINUSERAPI WINBOOL WINAPI IsWindow(HWND hWnd);
   1941   WINUSERAPI WINBOOL WINAPI IsMenu(HMENU hMenu);
   1942   WINUSERAPI WINBOOL WINAPI IsChild(HWND hWndParent,HWND hWnd);
   1943   WINUSERAPI WINBOOL WINAPI DestroyWindow(HWND hWnd);
   1944   WINUSERAPI WINBOOL WINAPI ShowWindow(HWND hWnd,int nCmdShow);
   1945   WINUSERAPI WINBOOL WINAPI AnimateWindow(HWND hWnd,DWORD dwTime,DWORD dwFlags);
   1946 
   1947 #if defined(_WINGDI_) && !defined(NOGDI)
   1948   WINUSERAPI WINBOOL WINAPI UpdateLayeredWindow(HWND hWnd,HDC hdcDst,POINT *pptDst,SIZE *psize,HDC hdcSrc,POINT *pptSrc,COLORREF crKey,BLENDFUNCTION *pblend,DWORD dwFlags);
   1949 
   1950   typedef struct tagUPDATELAYEREDWINDOWINFO {
   1951     DWORD cbSize;
   1952     HDC hdcDst;
   1953     POINT CONST *pptDst;
   1954     SIZE CONST *psize;
   1955     HDC hdcSrc;
   1956     POINT CONST *pptSrc;
   1957     COLORREF crKey;
   1958     BLENDFUNCTION CONST *pblend;
   1959     DWORD dwFlags;
   1960     RECT CONST *prcDirty;
   1961   } UPDATELAYEREDWINDOWINFO,*PUPDATELAYEREDWINDOWINFO;
   1962 
   1963   WINUSERAPI WINBOOL WINAPI UpdateLayeredWindowIndirect(HWND hWnd,UPDATELAYEREDWINDOWINFO CONST *pULWInfo);
   1964   WINUSERAPI WINBOOL WINAPI GetLayeredWindowAttributes(HWND hwnd,COLORREF *pcrKey,BYTE *pbAlpha,DWORD *pdwFlags);
   1965 
   1966 #define PW_CLIENTONLY 0x00000001
   1967 
   1968   WINUSERAPI WINBOOL WINAPI PrintWindow(HWND hwnd,HDC hdcBlt,UINT nFlags);
   1969   WINUSERAPI WINBOOL WINAPI SetLayeredWindowAttributes(HWND hwnd,COLORREF crKey,BYTE bAlpha,DWORD dwFlags);
   1970 
   1971 #define LWA_COLORKEY 0x00000001
   1972 #define LWA_ALPHA 0x00000002
   1973 
   1974 #define ULW_COLORKEY 0x00000001
   1975 #define ULW_ALPHA 0x00000002
   1976 #define ULW_OPAQUE 0x00000004
   1977 
   1978 #define ULW_EX_NORESIZE 0x00000008
   1979 
   1980   WINUSERAPI WINBOOL WINAPI ShowWindowAsync(HWND hWnd,int nCmdShow);
   1981   WINUSERAPI WINBOOL WINAPI FlashWindow(HWND hWnd,WINBOOL bInvert);
   1982 
   1983   typedef struct {
   1984     UINT cbSize;
   1985     HWND hwnd;
   1986     DWORD dwFlags;
   1987     UINT uCount;
   1988     DWORD dwTimeout;
   1989   } FLASHWINFO,*PFLASHWINFO;
   1990 
   1991   WINUSERAPI WINBOOL WINAPI FlashWindowEx(PFLASHWINFO pfwi);
   1992 
   1993 #define FLASHW_STOP 0
   1994 #define FLASHW_CAPTION 0x00000001
   1995 #define FLASHW_TRAY 0x00000002
   1996 #define FLASHW_ALL (FLASHW_CAPTION | FLASHW_TRAY)
   1997 #define FLASHW_TIMER 0x00000004
   1998 #define FLASHW_TIMERNOFG 0x0000000C
   1999 
   2000   WINUSERAPI WINBOOL WINAPI ShowOwnedPopups(HWND hWnd,WINBOOL fShow);
   2001   WINUSERAPI WINBOOL WINAPI OpenIcon(HWND hWnd);
   2002   WINUSERAPI WINBOOL WINAPI CloseWindow(HWND hWnd);
   2003   WINUSERAPI WINBOOL WINAPI MoveWindow(HWND hWnd,int X,int Y,int nWidth,int nHeight,WINBOOL bRepaint);
   2004   WINUSERAPI WINBOOL WINAPI SetWindowPos(HWND hWnd,HWND hWndInsertAfter,int X,int Y,int cx,int cy,UINT uFlags);
   2005   WINUSERAPI WINBOOL WINAPI GetWindowPlacement(HWND hWnd,WINDOWPLACEMENT *lpwndpl);
   2006   WINUSERAPI WINBOOL WINAPI SetWindowPlacement(HWND hWnd,CONST WINDOWPLACEMENT *lpwndpl);
   2007 
   2008 #ifndef NODEFERWINDOWPOS
   2009   WINUSERAPI HDWP WINAPI BeginDeferWindowPos(int nNumWindows);
   2010   WINUSERAPI HDWP WINAPI DeferWindowPos(HDWP hWinPosInfo,HWND hWnd,HWND hWndInsertAfter,int x,int y,int cx,int cy,UINT uFlags);
   2011   WINUSERAPI WINBOOL WINAPI EndDeferWindowPos(HDWP hWinPosInfo);
   2012 #endif
   2013 
   2014   WINUSERAPI WINBOOL WINAPI IsWindowVisible(HWND hWnd);
   2015   WINUSERAPI WINBOOL WINAPI IsIconic(HWND hWnd);
   2016   WINUSERAPI WINBOOL WINAPI AnyPopup(VOID);
   2017   WINUSERAPI WINBOOL WINAPI BringWindowToTop(HWND hWnd);
   2018   WINUSERAPI WINBOOL WINAPI IsZoomed(HWND hWnd);
   2019 
   2020 #define SWP_NOSIZE 0x0001
   2021 #define SWP_NOMOVE 0x0002
   2022 #define SWP_NOZORDER 0x0004
   2023 #define SWP_NOREDRAW 0x0008
   2024 #define SWP_NOACTIVATE 0x0010
   2025 #define SWP_FRAMECHANGED 0x0020
   2026 #define SWP_SHOWWINDOW 0x0040
   2027 #define SWP_HIDEWINDOW 0x0080
   2028 #define SWP_NOCOPYBITS 0x0100
   2029 #define SWP_NOOWNERZORDER 0x0200
   2030 #define SWP_NOSENDCHANGING 0x0400
   2031 
   2032 #define SWP_DRAWFRAME SWP_FRAMECHANGED
   2033 #define SWP_NOREPOSITION SWP_NOOWNERZORDER
   2034 #define SWP_DEFERERASE 0x2000
   2035 #define SWP_ASYNCWINDOWPOS 0x4000
   2036 
   2037 #define HWND_TOP ((HWND)0)
   2038 #define HWND_BOTTOM ((HWND)1)
   2039 #define HWND_TOPMOST ((HWND)-1)
   2040 #define HWND_NOTOPMOST ((HWND)-2)
   2041 
   2042 #ifndef NOCTLMGR
   2043 
   2044 #include <pshpack2.h>
   2045 
   2046   typedef struct {
   2047     DWORD style;
   2048     DWORD dwExtendedStyle;
   2049     WORD cdit;
   2050     short x;
   2051     short y;
   2052     short cx;
   2053     short cy;
   2054   } DLGTEMPLATE;
   2055 
   2056   typedef DLGTEMPLATE *LPDLGTEMPLATEA;
   2057   typedef DLGTEMPLATE *LPDLGTEMPLATEW;
   2058 
   2059   __MINGW_TYPEDEF_AW(LPDLGTEMPLATE)
   2060 
   2061   typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEA;
   2062   typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEW;
   2063 
   2064   __MINGW_TYPEDEF_AW(LPCDLGTEMPLATE)
   2065 
   2066   typedef struct {
   2067     DWORD style;
   2068     DWORD dwExtendedStyle;
   2069     short x;
   2070     short y;
   2071     short cx;
   2072     short cy;
   2073     WORD id;
   2074   } DLGITEMTEMPLATE;
   2075 
   2076   typedef DLGITEMTEMPLATE *PDLGITEMTEMPLATEA;
   2077   typedef DLGITEMTEMPLATE *PDLGITEMTEMPLATEW;
   2078 
   2079   __MINGW_TYPEDEF_AW(PDLGITEMTEMPLATE)
   2080 
   2081   typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEA;
   2082   typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEW;
   2083 
   2084   __MINGW_TYPEDEF_AW(LPDLGITEMTEMPLATE)
   2085 
   2086 #include <poppack.h>
   2087 
   2088 #define CreateDialogParam __MINGW_NAME_AW(CreateDialogParam)
   2089 #define CreateDialogIndirectParam __MINGW_NAME_AW(CreateDialogIndirectParam)
   2090 #define CreateDialog __MINGW_NAME_AW(CreateDialog)
   2091 #define CreateDialogIndirect __MINGW_NAME_AW(CreateDialogIndirect)
   2092 #define DialogBoxParam __MINGW_NAME_AW(DialogBoxParam)
   2093 #define DialogBoxIndirectParam __MINGW_NAME_AW(DialogBoxIndirectParam)
   2094 #define DialogBox __MINGW_NAME_AW(DialogBox)
   2095 #define DialogBoxIndirect __MINGW_NAME_AW(DialogBoxIndirect)
   2096 #define SetDlgItemText __MINGW_NAME_AW(SetDlgItemText)
   2097 #define GetDlgItemText __MINGW_NAME_AW(GetDlgItemText)
   2098 #define SendDlgItemMessage __MINGW_NAME_AW(SendDlgItemMessage)
   2099 #define DefDlgProc __MINGW_NAME_AW(DefDlgProc)
   2100 
   2101   WINUSERAPI HWND WINAPI CreateDialogParamA(HINSTANCE hInstance,LPCSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2102   WINUSERAPI HWND WINAPI CreateDialogParamW(HINSTANCE hInstance,LPCWSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2103   WINUSERAPI HWND WINAPI CreateDialogIndirectParamA(HINSTANCE hInstance,LPCDLGTEMPLATEA lpTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2104   WINUSERAPI HWND WINAPI CreateDialogIndirectParamW(HINSTANCE hInstance,LPCDLGTEMPLATEW lpTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2105 #define CreateDialogA(hInstance,lpName,hWndParent,lpDialogFunc) CreateDialogParamA(hInstance,lpName,hWndParent,lpDialogFunc,(LPARAM)0)
   2106 #define CreateDialogW(hInstance,lpName,hWndParent,lpDialogFunc) CreateDialogParamW(hInstance,lpName,hWndParent,lpDialogFunc,(LPARAM)0)
   2107 #define CreateDialogIndirectA(hInstance,lpTemplate,hWndParent,lpDialogFunc) CreateDialogIndirectParamA(hInstance,lpTemplate,hWndParent,lpDialogFunc,(LPARAM)0)
   2108 #define CreateDialogIndirectW(hInstance,lpTemplate,hWndParent,lpDialogFunc) CreateDialogIndirectParamW(hInstance,lpTemplate,hWndParent,lpDialogFunc,(LPARAM)0)
   2109   WINUSERAPI INT_PTR WINAPI DialogBoxParamA(HINSTANCE hInstance,LPCSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2110   WINUSERAPI INT_PTR WINAPI DialogBoxParamW(HINSTANCE hInstance,LPCWSTR lpTemplateName,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2111   WINUSERAPI INT_PTR WINAPI DialogBoxIndirectParamA(HINSTANCE hInstance,LPCDLGTEMPLATEA hDialogTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2112   WINUSERAPI INT_PTR WINAPI DialogBoxIndirectParamW(HINSTANCE hInstance,LPCDLGTEMPLATEW hDialogTemplate,HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam);
   2113 #define DialogBoxA(hInstance,lpTemplate,hWndParent,lpDialogFunc) DialogBoxParamA(hInstance,lpTemplate,hWndParent,lpDialogFunc,(LPARAM)0)
   2114 #define DialogBoxW(hInstance,lpTemplate,hWndParent,lpDialogFunc) DialogBoxParamW(hInstance,lpTemplate,hWndParent,lpDialogFunc,(LPARAM)0)
   2115 #define DialogBoxIndirectA(hInstance,lpTemplate,hWndParent,lpDialogFunc) DialogBoxIndirectParamA(hInstance,lpTemplate,hWndParent,lpDialogFunc,(LPARAM)0)
   2116 #define DialogBoxIndirectW(hInstance,lpTemplate,hWndParent,lpDialogFunc) DialogBoxIndirectParamW(hInstance,lpTemplate,hWndParent,lpDialogFunc,(LPARAM)0)
   2117   WINUSERAPI WINBOOL WINAPI EndDialog(HWND hDlg,INT_PTR nResult);
   2118   WINUSERAPI HWND WINAPI GetDlgItem(HWND hDlg,int nIDDlgItem);
   2119   WINUSERAPI WINBOOL WINAPI SetDlgItemInt(HWND hDlg,int nIDDlgItem,UINT uValue,WINBOOL bSigned);
   2120   WINUSERAPI UINT WINAPI GetDlgItemInt(HWND hDlg,int nIDDlgItem,WINBOOL *lpTranslated,WINBOOL bSigned);
   2121   WINUSERAPI WINBOOL WINAPI SetDlgItemTextA(HWND hDlg,int nIDDlgItem,LPCSTR lpString);
   2122   WINUSERAPI WINBOOL WINAPI SetDlgItemTextW(HWND hDlg,int nIDDlgItem,LPCWSTR lpString);
   2123   WINUSERAPI UINT WINAPI GetDlgItemTextA(HWND hDlg,int nIDDlgItem,LPSTR lpString,int cchMax);
   2124   WINUSERAPI UINT WINAPI GetDlgItemTextW(HWND hDlg,int nIDDlgItem,LPWSTR lpString,int cchMax);
   2125   WINUSERAPI WINBOOL WINAPI CheckDlgButton(HWND hDlg,int nIDButton,UINT uCheck);
   2126   WINUSERAPI WINBOOL WINAPI CheckRadioButton(HWND hDlg,int nIDFirstButton,int nIDLastButton,int nIDCheckButton);
   2127   WINUSERAPI UINT WINAPI IsDlgButtonChecked(HWND hDlg,int nIDButton);
   2128   WINUSERAPI LRESULT WINAPI SendDlgItemMessageA(HWND hDlg,int nIDDlgItem,UINT Msg,WPARAM wParam,LPARAM lParam);
   2129   WINUSERAPI LRESULT WINAPI SendDlgItemMessageW(HWND hDlg,int nIDDlgItem,UINT Msg,WPARAM wParam,LPARAM lParam);
   2130   WINUSERAPI HWND WINAPI GetNextDlgGroupItem(HWND hDlg,HWND hCtl,WINBOOL bPrevious);
   2131   WINUSERAPI HWND WINAPI GetNextDlgTabItem(HWND hDlg,HWND hCtl,WINBOOL bPrevious);
   2132   WINUSERAPI int WINAPI GetDlgCtrlID(HWND hWnd);
   2133   WINUSERAPI __LONG32 WINAPI GetDialogBaseUnits(VOID);
   2134   WINUSERAPI LRESULT WINAPI DefDlgProcA(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lParam);
   2135   WINUSERAPI LRESULT WINAPI DefDlgProcW(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lParam);
   2136 
   2137 #define DLGWINDOWEXTRA 30
   2138 #endif
   2139 
   2140 #ifndef NOMSG
   2141 
   2142 #define CallMsgFilter __MINGW_NAME_AW(CallMsgFilter)
   2143 
   2144   WINUSERAPI WINBOOL WINAPI CallMsgFilterA(LPMSG lpMsg,int nCode);
   2145   WINUSERAPI WINBOOL WINAPI CallMsgFilterW(LPMSG lpMsg,int nCode);
   2146 #endif
   2147 
   2148 #ifndef NOCLIPBOARD
   2149 
   2150 #define RegisterClipboardFormat __MINGW_NAME_AW(RegisterClipboardFormat)
   2151 #define GetClipboardFormatName __MINGW_NAME_AW(GetClipboardFormatName)
   2152 
   2153   WINUSERAPI WINBOOL WINAPI OpenClipboard(HWND hWndNewOwner);
   2154   WINUSERAPI WINBOOL WINAPI CloseClipboard(VOID);
   2155   WINUSERAPI DWORD WINAPI GetClipboardSequenceNumber(VOID);
   2156   WINUSERAPI HWND WINAPI GetClipboardOwner(VOID);
   2157   WINUSERAPI HWND WINAPI SetClipboardViewer(HWND hWndNewViewer);
   2158   WINUSERAPI HWND WINAPI GetClipboardViewer(VOID);
   2159   WINUSERAPI WINBOOL WINAPI ChangeClipboardChain(HWND hWndRemove,HWND hWndNewNext);
   2160   WINUSERAPI HANDLE WINAPI SetClipboardData(UINT uFormat,HANDLE hMem);
   2161   WINUSERAPI HANDLE WINAPI GetClipboardData(UINT uFormat);
   2162   WINUSERAPI UINT WINAPI RegisterClipboardFormatA(LPCSTR lpszFormat);
   2163   WINUSERAPI UINT WINAPI RegisterClipboardFormatW(LPCWSTR lpszFormat);
   2164   WINUSERAPI int WINAPI CountClipboardFormats(VOID);
   2165   WINUSERAPI UINT WINAPI EnumClipboardFormats(UINT format);
   2166   WINUSERAPI int WINAPI GetClipboardFormatNameA(UINT format,LPSTR lpszFormatName,int cchMaxCount);
   2167   WINUSERAPI int WINAPI GetClipboardFormatNameW(UINT format,LPWSTR lpszFormatName,int cchMaxCount);
   2168   WINUSERAPI WINBOOL WINAPI EmptyClipboard(VOID);
   2169   WINUSERAPI WINBOOL WINAPI IsClipboardFormatAvailable(UINT format);
   2170   WINUSERAPI int WINAPI GetPriorityClipboardFormat(UINT *paFormatPriorityList,int cFormats);
   2171   WINUSERAPI HWND WINAPI GetOpenClipboardWindow(VOID);
   2172 #endif
   2173 
   2174 #define CharToOem __MINGW_NAME_AW(CharToOem)
   2175 #define OemToChar __MINGW_NAME_AW(OemToChar)
   2176 #define CharToOemBuff __MINGW_NAME_AW(CharToOemBuff)
   2177 #define OemToCharBuff __MINGW_NAME_AW(OemToCharBuff)
   2178 #define CharUpper __MINGW_NAME_AW(CharUpper)
   2179 #define CharUpperBuff __MINGW_NAME_AW(CharUpperBuff)
   2180 #define CharLower __MINGW_NAME_AW(CharLower)
   2181 #define CharLowerBuff __MINGW_NAME_AW(CharLowerBuff)
   2182 #define CharNext __MINGW_NAME_AW(CharNext)
   2183 #define CharPrev __MINGW_NAME_AW(CharPrev)
   2184 
   2185   WINUSERAPI WINBOOL WINAPI CharToOemA(LPCSTR lpszSrc,LPSTR lpszDst);
   2186   WINUSERAPI WINBOOL WINAPI CharToOemW(LPCWSTR lpszSrc,LPSTR lpszDst);
   2187   WINUSERAPI WINBOOL WINAPI OemToCharA(LPCSTR lpszSrc,LPSTR lpszDst);
   2188   WINUSERAPI WINBOOL WINAPI OemToCharW(LPCSTR lpszSrc,LPWSTR lpszDst);
   2189   WINUSERAPI WINBOOL WINAPI CharToOemBuffA(LPCSTR lpszSrc,LPSTR lpszDst,DWORD cchDstLength);
   2190   WINUSERAPI WINBOOL WINAPI CharToOemBuffW(LPCWSTR lpszSrc,LPSTR lpszDst,DWORD cchDstLength);
   2191   WINUSERAPI WINBOOL WINAPI OemToCharBuffA(LPCSTR lpszSrc,LPSTR lpszDst,DWORD cchDstLength);
   2192   WINUSERAPI WINBOOL WINAPI OemToCharBuffW(LPCSTR lpszSrc,LPWSTR lpszDst,DWORD cchDstLength);
   2193   WINUSERAPI LPSTR WINAPI CharUpperA(LPSTR lpsz);
   2194   WINUSERAPI LPWSTR WINAPI CharUpperW(LPWSTR lpsz);
   2195   WINUSERAPI DWORD WINAPI CharUpperBuffA(LPSTR lpsz,DWORD cchLength);
   2196   WINUSERAPI DWORD WINAPI CharUpperBuffW(LPWSTR lpsz,DWORD cchLength);
   2197   WINUSERAPI LPSTR WINAPI CharLowerA(LPSTR lpsz);
   2198   WINUSERAPI LPWSTR WINAPI CharLowerW(LPWSTR lpsz);
   2199   WINUSERAPI DWORD WINAPI CharLowerBuffA(LPSTR lpsz,DWORD cchLength);
   2200   WINUSERAPI DWORD WINAPI CharLowerBuffW(LPWSTR lpsz,DWORD cchLength);
   2201   WINUSERAPI LPSTR WINAPI CharNextA(LPCSTR lpsz);
   2202   WINUSERAPI LPWSTR WINAPI CharNextW(LPCWSTR lpsz);
   2203   WINUSERAPI LPSTR WINAPI CharPrevA(LPCSTR lpszStart,LPCSTR lpszCurrent);
   2204   WINUSERAPI LPWSTR WINAPI CharPrevW(LPCWSTR lpszStart,LPCWSTR lpszCurrent);
   2205   WINUSERAPI LPSTR WINAPI CharNextExA(WORD CodePage,LPCSTR lpCurrentChar,DWORD dwFlags);
   2206   WINUSERAPI LPSTR WINAPI CharPrevExA(WORD CodePage,LPCSTR lpStart,LPCSTR lpCurrentChar,DWORD dwFlags);
   2207 
   2208 #define AnsiToOem CharToOemA
   2209 #define OemToAnsi OemToCharA
   2210 #define AnsiToOemBuff CharToOemBuffA
   2211 #define OemToAnsiBuff OemToCharBuffA
   2212 #define AnsiUpper CharUpperA
   2213 #define AnsiUpperBuff CharUpperBuffA
   2214 #define AnsiLower CharLowerA
   2215 #define AnsiLowerBuff CharLowerBuffA
   2216 #define AnsiNext CharNextA
   2217 #define AnsiPrev CharPrevA
   2218 
   2219 #ifndef NOLANGUAGE
   2220 
   2221 #define IsCharAlpha __MINGW_NAME_AW(IsCharAlpha)
   2222 #define IsCharAlphaNumeric __MINGW_NAME_AW(IsCharAlphaNumeric)
   2223 #define IsCharUpper __MINGW_NAME_AW(IsCharUpper)
   2224 #define IsCharLower __MINGW_NAME_AW(IsCharLower)
   2225 
   2226   WINUSERAPI WINBOOL WINAPI IsCharAlphaA(CHAR ch);
   2227   WINUSERAPI WINBOOL WINAPI IsCharAlphaW(WCHAR ch);
   2228   WINUSERAPI WINBOOL WINAPI IsCharAlphaNumericA(CHAR ch);
   2229   WINUSERAPI WINBOOL WINAPI IsCharAlphaNumericW(WCHAR ch);
   2230   WINUSERAPI WINBOOL WINAPI IsCharUpperA(CHAR ch);
   2231   WINUSERAPI WINBOOL WINAPI IsCharUpperW(WCHAR ch);
   2232   WINUSERAPI WINBOOL WINAPI IsCharLowerA(CHAR ch);
   2233   WINUSERAPI WINBOOL WINAPI IsCharLowerW(WCHAR ch);
   2234 #endif
   2235 
   2236 #define GetKeyNameText __MINGW_NAME_AW(GetKeyNameText)
   2237 #define VkKeyScan __MINGW_NAME_AW(VkKeyScan)
   2238 #define VkKeyScanEx __MINGW_NAME_AW(VkKeyScanEx)
   2239 
   2240   WINUSERAPI HWND WINAPI SetFocus(HWND hWnd);
   2241   WINUSERAPI HWND WINAPI GetActiveWindow(VOID);
   2242   WINUSERAPI HWND WINAPI GetFocus(VOID);
   2243   WINUSERAPI UINT WINAPI GetKBCodePage(VOID);
   2244   WINUSERAPI SHORT WINAPI GetKeyState(int nVirtKey);
   2245   WINUSERAPI SHORT WINAPI GetAsyncKeyState(int vKey);
   2246   WINUSERAPI WINBOOL WINAPI GetKeyboardState(PBYTE lpKeyState);
   2247   WINUSERAPI WINBOOL WINAPI SetKeyboardState(LPBYTE lpKeyState);
   2248   WINUSERAPI int WINAPI GetKeyNameTextA(LONG lParam,LPSTR lpString,int cchSize);
   2249   WINUSERAPI int WINAPI GetKeyNameTextW(LONG lParam,LPWSTR lpString,int cchSize);
   2250   WINUSERAPI int WINAPI GetKeyboardType(int nTypeFlag);
   2251   WINUSERAPI int WINAPI ToAscii(UINT uVirtKey,UINT uScanCode,CONST BYTE *lpKeyState,LPWORD lpChar,UINT uFlags);
   2252   WINUSERAPI int WINAPI ToAsciiEx(UINT uVirtKey,UINT uScanCode,CONST BYTE *lpKeyState,LPWORD lpChar,UINT uFlags,HKL dwhkl);
   2253   WINUSERAPI int WINAPI ToUnicode(UINT wVirtKey,UINT wScanCode,CONST BYTE *lpKeyState,LPWSTR pwszBuff,int cchBuff,UINT wFlags);
   2254   WINUSERAPI DWORD WINAPI OemKeyScan(WORD wOemChar);
   2255   WINUSERAPI SHORT WINAPI VkKeyScanA(CHAR ch);
   2256   WINUSERAPI SHORT WINAPI VkKeyScanW(WCHAR ch);
   2257   WINUSERAPI SHORT WINAPI VkKeyScanExA(CHAR ch,HKL dwhkl);
   2258   WINUSERAPI SHORT WINAPI VkKeyScanExW(WCHAR ch,HKL dwhkl);
   2259 
   2260 #define KEYEVENTF_EXTENDEDKEY 0x0001
   2261 #define KEYEVENTF_KEYUP 0x0002
   2262 #define KEYEVENTF_UNICODE 0x0004
   2263 #define KEYEVENTF_SCANCODE 0x0008
   2264 
   2265   WINUSERAPI VOID WINAPI keybd_event(BYTE bVk,BYTE bScan,DWORD dwFlags,ULONG_PTR dwExtraInfo);
   2266 
   2267 #define MOUSEEVENTF_MOVE 0x0001
   2268 #define MOUSEEVENTF_LEFTDOWN 0x0002
   2269 #define MOUSEEVENTF_LEFTUP 0x0004
   2270 #define MOUSEEVENTF_RIGHTDOWN 0x0008
   2271 #define MOUSEEVENTF_RIGHTUP 0x0010
   2272 #define MOUSEEVENTF_MIDDLEDOWN 0x0020
   2273 #define MOUSEEVENTF_MIDDLEUP 0x0040
   2274 #define MOUSEEVENTF_XDOWN 0x0080
   2275 #define MOUSEEVENTF_XUP 0x0100
   2276 #define MOUSEEVENTF_WHEEL 0x0800
   2277 #define MOUSEEVENTF_VIRTUALDESK 0x4000
   2278 #define MOUSEEVENTF_ABSOLUTE 0x8000
   2279 
   2280   WINUSERAPI VOID WINAPI mouse_event(DWORD dwFlags,DWORD dx,DWORD dy,DWORD dwData,ULONG_PTR dwExtraInfo);
   2281 
   2282   typedef struct tagMOUSEINPUT {
   2283     LONG dx;
   2284     LONG dy;
   2285     DWORD mouseData;
   2286     DWORD dwFlags;
   2287     DWORD time;
   2288     ULONG_PTR dwExtraInfo;
   2289   } MOUSEINPUT,*PMOUSEINPUT,*LPMOUSEINPUT;
   2290 
   2291   typedef struct tagKEYBDINPUT {
   2292     WORD wVk;
   2293     WORD wScan;
   2294     DWORD dwFlags;
   2295     DWORD time;
   2296     ULONG_PTR dwExtraInfo;
   2297   } KEYBDINPUT,*PKEYBDINPUT,*LPKEYBDINPUT;
   2298 
   2299   typedef struct tagHARDWAREINPUT {
   2300     DWORD uMsg;
   2301     WORD wParamL;
   2302     WORD wParamH;
   2303   } HARDWAREINPUT,*PHARDWAREINPUT,*LPHARDWAREINPUT;
   2304 
   2305 #define INPUT_MOUSE 0
   2306 #define INPUT_KEYBOARD 1
   2307 #define INPUT_HARDWARE 2
   2308 
   2309   typedef struct tagINPUT {
   2310     DWORD type;
   2311     __C89_NAMELESS union {
   2312       MOUSEINPUT mi;
   2313       KEYBDINPUT ki;
   2314       HARDWAREINPUT hi;
   2315     } DUMMYUNIONNAME;
   2316   } INPUT,*PINPUT,*LPINPUT;
   2317 
   2318   WINUSERAPI UINT WINAPI SendInput(UINT cInputs,LPINPUT pInputs,int cbSize);
   2319 
   2320   typedef struct tagLASTINPUTINFO {
   2321     UINT cbSize;
   2322     DWORD dwTime;
   2323   } LASTINPUTINFO,*PLASTINPUTINFO;
   2324 
   2325 #define MapVirtualKey __MINGW_NAME_AW(MapVirtualKey)
   2326 #define MapVirtualKeyEx __MINGW_NAME_AW(MapVirtualKeyEx)
   2327 
   2328   WINUSERAPI WINBOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii);
   2329   WINUSERAPI UINT WINAPI MapVirtualKeyA(UINT uCode,UINT uMapType);
   2330   WINUSERAPI UINT WINAPI MapVirtualKeyW(UINT uCode,UINT uMapType);
   2331   WINUSERAPI UINT WINAPI MapVirtualKeyExA(UINT uCode,UINT uMapType,HKL dwhkl);
   2332   WINUSERAPI UINT WINAPI MapVirtualKeyExW(UINT uCode,UINT uMapType,HKL dwhkl);
   2333   WINUSERAPI WINBOOL WINAPI GetInputState(VOID);
   2334   WINUSERAPI DWORD WINAPI GetQueueStatus(UINT flags);
   2335   WINUSERAPI HWND WINAPI GetCapture(VOID);
   2336   WINUSERAPI HWND WINAPI SetCapture(HWND hWnd);
   2337   WINUSERAPI WINBOOL WINAPI ReleaseCapture(VOID);
   2338   WINUSERAPI DWORD WINAPI MsgWaitForMultipleObjects(DWORD nCount,CONST HANDLE *pHandles,WINBOOL fWaitAll,DWORD dwMilliseconds,DWORD dwWakeMask);
   2339   WINUSERAPI DWORD WINAPI MsgWaitForMultipleObjectsEx(DWORD nCount,CONST HANDLE *pHandles,DWORD dwMilliseconds,DWORD dwWakeMask,DWORD dwFlags);
   2340 
   2341 #define MWMO_WAITALL 0x0001
   2342 #define MWMO_ALERTABLE 0x0002
   2343 #define MWMO_INPUTAVAILABLE 0x0004
   2344 
   2345 #define QS_KEY 0x0001
   2346 #define QS_MOUSEMOVE 0x0002
   2347 #define QS_MOUSEBUTTON 0x0004
   2348 #define QS_POSTMESSAGE 0x0008
   2349 #define QS_TIMER 0x0010
   2350 #define QS_PAINT 0x0020
   2351 #define QS_SENDMESSAGE 0x0040
   2352 #define QS_HOTKEY 0x0080
   2353 #define QS_ALLPOSTMESSAGE 0x0100
   2354 #define QS_RAWINPUT 0x0400
   2355 #define QS_MOUSE (QS_MOUSEMOVE | QS_MOUSEBUTTON)
   2356 #define QS_INPUT (QS_MOUSE | QS_KEY | QS_RAWINPUT)
   2357 #define QS_ALLEVENTS (QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY)
   2358 #define QS_ALLINPUT (QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY | QS_SENDMESSAGE)
   2359 
   2360 #define USER_TIMER_MAXIMUM 0x7FFFFFFF
   2361 #define USER_TIMER_MINIMUM 0x0000000A
   2362 
   2363 #define LoadAccelerators __MINGW_NAME_AW(LoadAccelerators)
   2364 #define CreateAcceleratorTable __MINGW_NAME_AW(CreateAcceleratorTable)
   2365 #define CopyAcceleratorTable __MINGW_NAME_AW(CopyAcceleratorTable)
   2366 
   2367   WINUSERAPI UINT_PTR WINAPI SetTimer(HWND hWnd,UINT_PTR nIDEvent,UINT uElapse,TIMERPROC lpTimerFunc);
   2368   WINUSERAPI WINBOOL WINAPI KillTimer(HWND hWnd,UINT_PTR uIDEvent);
   2369   WINUSERAPI WINBOOL WINAPI IsWindowUnicode(HWND hWnd);
   2370   WINUSERAPI WINBOOL WINAPI EnableWindow(HWND hWnd,WINBOOL bEnable);
   2371   WINUSERAPI WINBOOL WINAPI IsWindowEnabled(HWND hWnd);
   2372   WINUSERAPI HACCEL WINAPI LoadAcceleratorsA(HINSTANCE hInstance,LPCSTR lpTableName);
   2373   WINUSERAPI HACCEL WINAPI LoadAcceleratorsW(HINSTANCE hInstance,LPCWSTR lpTableName);
   2374   WINUSERAPI HACCEL WINAPI CreateAcceleratorTableA(LPACCEL paccel,int cAccel);
   2375   WINUSERAPI HACCEL WINAPI CreateAcceleratorTableW(LPACCEL paccel,int cAccel);
   2376   WINUSERAPI WINBOOL WINAPI DestroyAcceleratorTable(HACCEL hAccel);
   2377   WINUSERAPI int WINAPI CopyAcceleratorTableA(HACCEL hAccelSrc,LPACCEL lpAccelDst,int cAccelEntries);
   2378   WINUSERAPI int WINAPI CopyAcceleratorTableW(HACCEL hAccelSrc,LPACCEL lpAccelDst,int cAccelEntries);
   2379 
   2380 #ifndef NOMSG
   2381 
   2382 #define TranslateAccelerator __MINGW_NAME_AW(TranslateAccelerator)
   2383 
   2384   WINUSERAPI int WINAPI TranslateAcceleratorA(HWND hWnd,HACCEL hAccTable,LPMSG lpMsg);
   2385   WINUSERAPI int WINAPI TranslateAcceleratorW(HWND hWnd,HACCEL hAccTable,LPMSG lpMsg);
   2386 #endif
   2387 
   2388 #ifndef NOSYSMETRICS
   2389 
   2390 #define SM_CXSCREEN 0
   2391 #define SM_CYSCREEN 1
   2392 #define SM_CXVSCROLL 2
   2393 #define SM_CYHSCROLL 3
   2394 #define SM_CYCAPTION 4
   2395 #define SM_CXBORDER 5
   2396 #define SM_CYBORDER 6
   2397 #define SM_CXDLGFRAME 7
   2398 #define SM_CYDLGFRAME 8
   2399 #define SM_CYVTHUMB 9
   2400 #define SM_CXHTHUMB 10
   2401 #define SM_CXICON 11
   2402 #define SM_CYICON 12
   2403 #define SM_CXCURSOR 13
   2404 #define SM_CYCURSOR 14
   2405 #define SM_CYMENU 15
   2406 #define SM_CXFULLSCREEN 16
   2407 #define SM_CYFULLSCREEN 17
   2408 #define SM_CYKANJIWINDOW 18
   2409 #define SM_MOUSEPRESENT 19
   2410 #define SM_CYVSCROLL 20
   2411 #define SM_CXHSCROLL 21
   2412 #define SM_DEBUG 22
   2413 #define SM_SWAPBUTTON 23
   2414 #define SM_RESERVED1 24
   2415 #define SM_RESERVED2 25
   2416 #define SM_RESERVED3 26
   2417 #define SM_RESERVED4 27
   2418 #define SM_CXMIN 28
   2419 #define SM_CYMIN 29
   2420 #define SM_CXSIZE 30
   2421 #define SM_CYSIZE 31
   2422 #define SM_CXFRAME 32
   2423 #define SM_CYFRAME 33
   2424 #define SM_CXMINTRACK 34
   2425 #define SM_CYMINTRACK 35
   2426 #define SM_CXDOUBLECLK 36
   2427 #define SM_CYDOUBLECLK 37
   2428 #define SM_CXICONSPACING 38
   2429 #define SM_CYICONSPACING 39
   2430 #define SM_MENUDROPALIGNMENT 40
   2431 #define SM_PENWINDOWS 41
   2432 #define SM_DBCSENABLED 42
   2433 #define SM_CMOUSEBUTTONS 43
   2434 
   2435 #define SM_CXFIXEDFRAME SM_CXDLGFRAME
   2436 #define SM_CYFIXEDFRAME SM_CYDLGFRAME
   2437 #define SM_CXSIZEFRAME SM_CXFRAME
   2438 #define SM_CYSIZEFRAME SM_CYFRAME
   2439 
   2440 #define SM_SECURE 44
   2441 #define SM_CXEDGE 45
   2442 #define SM_CYEDGE 46
   2443 #define SM_CXMINSPACING 47
   2444 #define SM_CYMINSPACING 48
   2445 #define SM_CXSMICON 49
   2446 #define SM_CYSMICON 50
   2447 #define SM_CYSMCAPTION 51
   2448 #define SM_CXSMSIZE 52
   2449 #define SM_CYSMSIZE 53
   2450 #define SM_CXMENUSIZE 54
   2451 #define SM_CYMENUSIZE 55
   2452 #define SM_ARRANGE 56
   2453 #define SM_CXMINIMIZED 57
   2454 #define SM_CYMINIMIZED 58
   2455 #define SM_CXMAXTRACK 59
   2456 #define SM_CYMAXTRACK 60
   2457 #define SM_CXMAXIMIZED 61
   2458 #define SM_CYMAXIMIZED 62
   2459 #define SM_NETWORK 63
   2460 #define SM_CLEANBOOT 67
   2461 #define SM_CXDRAG 68
   2462 #define SM_CYDRAG 69
   2463 #define SM_SHOWSOUNDS 70
   2464 #define SM_CXMENUCHECK 71
   2465 #define SM_CYMENUCHECK 72
   2466 #define SM_SLOWMACHINE 73
   2467 #define SM_MIDEASTENABLED 74
   2468 #define SM_MOUSEWHEELPRESENT 75
   2469 #define SM_XVIRTUALSCREEN 76
   2470 #define SM_YVIRTUALSCREEN 77
   2471 #define SM_CXVIRTUALSCREEN 78
   2472 #define SM_CYVIRTUALSCREEN 79
   2473 #define SM_CMONITORS 80
   2474 #define SM_SAMEDISPLAYFORMAT 81
   2475 #define SM_IMMENABLED 82
   2476 #define SM_CXFOCUSBORDER 83
   2477 #define SM_CYFOCUSBORDER 84
   2478 #define SM_TABLETPC 86
   2479 #define SM_MEDIACENTER 87
   2480 #define SM_STARTER 88
   2481 #define SM_SERVERR2 89
   2482 
   2483 #if (_WIN32_WINNT < 0x0600)
   2484 #define SM_CMETRICS 90
   2485 #endif
   2486 
   2487 #define SM_REMOTESESSION 0x1000
   2488 #define SM_SHUTTINGDOWN 0x2000
   2489 #define SM_REMOTECONTROL 0x2001
   2490 #define SM_CARETBLINKINGENABLED 0x2002
   2491 
   2492 #if (_WIN32_WINNT >= 0x0600)
   2493 #define SM_MOUSEHORIZONTALWHEELPRESENT 91
   2494 #define SM_CXPADDEDBORDER 92
   2495 # if (_WIN32_WINNT < 0x0601)
   2496 # define SM_CMETRICS 93
   2497 # endif
   2498 #endif
   2499 
   2500 #if (_WIN32_WINNT >= 0x0601)
   2501 #define SM_DIGITIZER 94
   2502 #define SM_MAXIMUMTOUCHES 95
   2503 /**/
   2504 # define SM_CMETRICS 96
   2505 #endif
   2506 
   2507 #if (_WIN32_WINNT >= 0x0601)
   2508 /* flags for SM_DIGITIZER: */
   2509 #define NID_INTEGRATED_TOUCH	0x01
   2510 #define NID_EXTERNAL_TOUCH	0x02
   2511 #define NID_INTEGRATED_PEN	0x04
   2512 #define NID_EXTERNAL_PEN	0x08
   2513 #define NID_MULTI_INPUT		0x40
   2514 #define NID_READY		0x80
   2515 #endif
   2516 
   2517   WINUSERAPI int WINAPI GetSystemMetrics(int nIndex);
   2518 #endif
   2519 
   2520 #ifndef NOMENUS
   2521 
   2522 #define LoadMenu __MINGW_NAME_AW(LoadMenu)
   2523 #define LoadMenuIndirect __MINGW_NAME_AW(LoadMenuIndirect)
   2524 #define ChangeMenu __MINGW_NAME_AW(ChangeMenu)
   2525 #define GetMenuString __MINGW_NAME_AW(GetMenuString)
   2526 #define InsertMenu __MINGW_NAME_AW(InsertMenu)
   2527 #define AppendMenu __MINGW_NAME_AW(AppendMenu)
   2528 #define ModifyMenu __MINGW_NAME_AW(ModifyMenu)
   2529 
   2530   WINUSERAPI HMENU WINAPI LoadMenuA(HINSTANCE hInstance,LPCSTR lpMenuName);
   2531   WINUSERAPI HMENU WINAPI LoadMenuW(HINSTANCE hInstance,LPCWSTR lpMenuName);
   2532   WINUSERAPI HMENU WINAPI LoadMenuIndirectA(CONST MENUTEMPLATEA *lpMenuTemplate);
   2533   WINUSERAPI HMENU WINAPI LoadMenuIndirectW(CONST MENUTEMPLATEW *lpMenuTemplate);
   2534   WINUSERAPI HMENU WINAPI GetMenu(HWND hWnd);
   2535   WINUSERAPI WINBOOL WINAPI SetMenu(HWND hWnd,HMENU hMenu);
   2536   WINUSERAPI WINBOOL WINAPI ChangeMenuA(HMENU hMenu,UINT cmd,LPCSTR lpszNewItem,UINT cmdInsert,UINT flags);
   2537   WINUSERAPI WINBOOL WINAPI ChangeMenuW(HMENU hMenu,UINT cmd,LPCWSTR lpszNewItem,UINT cmdInsert,UINT flags);
   2538   WINUSERAPI WINBOOL WINAPI HiliteMenuItem(HWND hWnd,HMENU hMenu,UINT uIDHiliteItem,UINT uHilite);
   2539   WINUSERAPI int WINAPI GetMenuStringA(HMENU hMenu,UINT uIDItem,LPSTR lpString,int cchMax,UINT flags);
   2540   WINUSERAPI int WINAPI GetMenuStringW(HMENU hMenu,UINT uIDItem,LPWSTR lpString,int cchMax,UINT flags);
   2541   WINUSERAPI UINT WINAPI GetMenuState(HMENU hMenu,UINT uId,UINT uFlags);
   2542   WINUSERAPI WINBOOL WINAPI DrawMenuBar(HWND hWnd);
   2543 
   2544 #define PMB_ACTIVE 0x00000001
   2545 
   2546   WINUSERAPI HMENU WINAPI GetSystemMenu(HWND hWnd,WINBOOL bRevert);
   2547   WINUSERAPI HMENU WINAPI CreateMenu(VOID);
   2548   WINUSERAPI HMENU WINAPI CreatePopupMenu(VOID);
   2549   WINUSERAPI WINBOOL WINAPI DestroyMenu(HMENU hMenu);
   2550   WINUSERAPI DWORD WINAPI CheckMenuItem(HMENU hMenu,UINT uIDCheckItem,UINT uCheck);
   2551   WINUSERAPI WINBOOL WINAPI EnableMenuItem(HMENU hMenu,UINT uIDEnableItem,UINT uEnable);
   2552   WINUSERAPI HMENU WINAPI GetSubMenu(HMENU hMenu,int nPos);
   2553   WINUSERAPI UINT WINAPI GetMenuItemID(HMENU hMenu,int nPos);
   2554   WINUSERAPI int WINAPI GetMenuItemCount(HMENU hMenu);
   2555   WINUSERAPI WINBOOL WINAPI InsertMenuA(HMENU hMenu,UINT uPosition,UINT uFlags,UINT_PTR uIDNewItem,LPCSTR lpNewItem);
   2556   WINUSERAPI WINBOOL WINAPI InsertMenuW(HMENU hMenu,UINT uPosition,UINT uFlags,UINT_PTR uIDNewItem,LPCWSTR lpNewItem);
   2557   WINUSERAPI WINBOOL WINAPI AppendMenuA(HMENU hMenu,UINT uFlags,UINT_PTR uIDNewItem,LPCSTR lpNewItem);
   2558   WINUSERAPI WINBOOL WINAPI AppendMenuW(HMENU hMenu,UINT uFlags,UINT_PTR uIDNewItem,LPCWSTR lpNewItem);
   2559   WINUSERAPI WINBOOL WINAPI ModifyMenuA(HMENU hMnu,UINT uPosition,UINT uFlags,UINT_PTR uIDNewItem,LPCSTR lpNewItem);
   2560   WINUSERAPI WINBOOL WINAPI ModifyMenuW(HMENU hMnu,UINT uPosition,UINT uFlags,UINT_PTR uIDNewItem,LPCWSTR lpNewItem);
   2561   WINUSERAPI WINBOOL WINAPI RemoveMenu(HMENU hMenu,UINT uPosition,UINT uFlags);
   2562   WINUSERAPI WINBOOL WINAPI DeleteMenu(HMENU hMenu,UINT uPosition,UINT uFlags);
   2563   WINUSERAPI WINBOOL WINAPI SetMenuItemBitmaps(HMENU hMenu,UINT uPosition,UINT uFlags,HBITMAP hBitmapUnchecked,HBITMAP hBitmapChecked);
   2564   WINUSERAPI LONG WINAPI GetMenuCheckMarkDimensions(VOID);
   2565   WINUSERAPI WINBOOL WINAPI TrackPopupMenu(HMENU hMenu,UINT uFlags,int x,int y,int nReserved,HWND hWnd,CONST RECT *prcRect);
   2566 
   2567 #define MNC_IGNORE 0
   2568 #define MNC_CLOSE 1
   2569 #define MNC_EXECUTE 2
   2570 #define MNC_SELECT 3
   2571 
   2572   typedef struct tagTPMPARAMS {
   2573     UINT cbSize;
   2574     RECT rcExclude;
   2575   } TPMPARAMS;
   2576 
   2577   typedef TPMPARAMS *LPTPMPARAMS;
   2578 
   2579   WINUSERAPI WINBOOL WINAPI TrackPopupMenuEx(HMENU,UINT,int,int,HWND,LPTPMPARAMS);
   2580 
   2581 #define MNS_NOCHECK 0x80000000
   2582 #define MNS_MODELESS 0x40000000
   2583 #define MNS_DRAGDROP 0x20000000
   2584 #define MNS_AUTODISMISS 0x10000000
   2585 #define MNS_NOTIFYBYPOS 0x08000000
   2586 #define MNS_CHECKORBMP 0x04000000
   2587 
   2588 #define MIM_MAXHEIGHT 0x00000001
   2589 #define MIM_BACKGROUND 0x00000002
   2590 #define MIM_HELPID 0x00000004
   2591 #define MIM_MENUDATA 0x00000008
   2592 #define MIM_STYLE 0x00000010
   2593 #define MIM_APPLYTOSUBMENUS 0x80000000
   2594 
   2595   typedef struct tagMENUINFO {
   2596     DWORD cbSize;
   2597     DWORD fMask;
   2598     DWORD dwStyle;
   2599     UINT cyMax;
   2600     HBRUSH hbrBack;
   2601     DWORD dwContextHelpID;
   2602     ULONG_PTR dwMenuData;
   2603   } MENUINFO,*LPMENUINFO;
   2604 
   2605   typedef MENUINFO CONST *LPCMENUINFO;
   2606 
   2607   WINUSERAPI WINBOOL WINAPI GetMenuInfo(HMENU,LPMENUINFO);
   2608   WINUSERAPI WINBOOL WINAPI SetMenuInfo(HMENU,LPCMENUINFO);
   2609   WINUSERAPI WINBOOL WINAPI EndMenu(VOID);
   2610 
   2611 #define MND_CONTINUE 0
   2612 #define MND_ENDMENU 1
   2613 
   2614   typedef struct tagMENUGETOBJECTINFO {
   2615     DWORD dwFlags;
   2616     UINT uPos;
   2617     HMENU hmenu;
   2618     PVOID riid;
   2619     PVOID pvObj;
   2620   } MENUGETOBJECTINFO,*PMENUGETOBJECTINFO;
   2621 
   2622 #define MNGOF_TOPGAP 0x00000001
   2623 #define MNGOF_BOTTOMGAP 0x00000002
   2624 
   2625 #define MNGO_NOINTERFACE 0x00000000
   2626 #define MNGO_NOERROR 0x00000001
   2627 
   2628 #define MIIM_STATE 0x00000001
   2629 #define MIIM_ID 0x00000002
   2630 #define MIIM_SUBMENU 0x00000004
   2631 #define MIIM_CHECKMARKS 0x00000008
   2632 #define MIIM_TYPE 0x00000010
   2633 #define MIIM_DATA 0x00000020
   2634 
   2635 #define MIIM_STRING 0x00000040
   2636 #define MIIM_BITMAP 0x00000080
   2637 #define MIIM_FTYPE 0x00000100
   2638 
   2639 #define HBMMENU_CALLBACK ((HBITMAP) -1)
   2640 #define HBMMENU_SYSTEM ((HBITMAP) 1)
   2641 #define HBMMENU_MBAR_RESTORE ((HBITMAP) 2)
   2642 #define HBMMENU_MBAR_MINIMIZE ((HBITMAP) 3)
   2643 #define HBMMENU_MBAR_CLOSE ((HBITMAP) 5)
   2644 #define HBMMENU_MBAR_CLOSE_D ((HBITMAP) 6)
   2645 #define HBMMENU_MBAR_MINIMIZE_D ((HBITMAP) 7)
   2646 #define HBMMENU_POPUP_CLOSE ((HBITMAP) 8)
   2647 #define HBMMENU_POPUP_RESTORE ((HBITMAP) 9)
   2648 #define HBMMENU_POPUP_MAXIMIZE ((HBITMAP) 10)
   2649 #define HBMMENU_POPUP_MINIMIZE ((HBITMAP) 11)
   2650 
   2651   typedef struct tagMENUITEMINFOA {
   2652     UINT cbSize;
   2653     UINT fMask;
   2654     UINT fType;
   2655     UINT fState;
   2656     UINT wID;
   2657     HMENU hSubMenu;
   2658     HBITMAP hbmpChecked;
   2659     HBITMAP hbmpUnchecked;
   2660     ULONG_PTR dwItemData;
   2661     LPSTR dwTypeData;
   2662     UINT cch;
   2663     HBITMAP hbmpItem;
   2664   } MENUITEMINFOA,*LPMENUITEMINFOA;
   2665 
   2666   typedef struct tagMENUITEMINFOW {
   2667     UINT cbSize;
   2668     UINT fMask;
   2669     UINT fType;
   2670     UINT fState;
   2671     UINT wID;
   2672     HMENU hSubMenu;
   2673     HBITMAP hbmpChecked;
   2674     HBITMAP hbmpUnchecked;
   2675     ULONG_PTR dwItemData;
   2676     LPWSTR dwTypeData;
   2677     UINT cch;
   2678     HBITMAP hbmpItem;
   2679   } MENUITEMINFOW,*LPMENUITEMINFOW;
   2680 
   2681   __MINGW_TYPEDEF_AW(MENUITEMINFO)
   2682   __MINGW_TYPEDEF_AW(LPMENUITEMINFO)
   2683 
   2684   typedef MENUITEMINFOA CONST *LPCMENUITEMINFOA;
   2685   typedef MENUITEMINFOW CONST *LPCMENUITEMINFOW;
   2686 
   2687   __MINGW_TYPEDEF_AW(LPCMENUITEMINFO)
   2688 
   2689 #define InsertMenuItem __MINGW_NAME_AW(InsertMenuItem)
   2690 #define GetMenuItemInfo __MINGW_NAME_AW(GetMenuItemInfo)
   2691 #define SetMenuItemInfo __MINGW_NAME_AW(SetMenuItemInfo)
   2692 
   2693   WINUSERAPI WINBOOL WINAPI InsertMenuItemA(HMENU hmenu,UINT item,WINBOOL fByPosition,LPCMENUITEMINFOA lpmi);
   2694   WINUSERAPI WINBOOL WINAPI InsertMenuItemW(HMENU hmenu,UINT item,WINBOOL fByPosition,LPCMENUITEMINFOW lpmi);
   2695   WINUSERAPI WINBOOL WINAPI GetMenuItemInfoA(HMENU hmenu,UINT item,WINBOOL fByPosition,LPMENUITEMINFOA lpmii);
   2696   WINUSERAPI WINBOOL WINAPI GetMenuItemInfoW(HMENU hmenu,UINT item,WINBOOL fByPosition,LPMENUITEMINFOW lpmii);
   2697   WINUSERAPI WINBOOL WINAPI SetMenuItemInfoA(HMENU hmenu,UINT item,WINBOOL fByPositon,LPCMENUITEMINFOA lpmii);
   2698   WINUSERAPI WINBOOL WINAPI SetMenuItemInfoW(HMENU hmenu,UINT item,WINBOOL fByPositon,LPCMENUITEMINFOW lpmii);
   2699 
   2700 #define GMDI_USEDISABLED __MSABI_LONG(0x0001)
   2701 #define GMDI_GOINTOPOPUPS __MSABI_LONG(0x0002)
   2702 
   2703   WINUSERAPI UINT WINAPI GetMenuDefaultItem(HMENU hMenu,UINT fByPos,UINT gmdiFlags);
   2704   WINUSERAPI WINBOOL WINAPI SetMenuDefaultItem(HMENU hMenu,UINT uItem,UINT fByPos);
   2705   WINUSERAPI WINBOOL WINAPI GetMenuItemRect(HWND hWnd,HMENU hMenu,UINT uItem,LPRECT lprcItem);
   2706   WINUSERAPI int WINAPI MenuItemFromPoint(HWND hWnd,HMENU hMenu,POINT ptScreen);
   2707 
   2708 #define TPM_LEFTBUTTON __MSABI_LONG(0x0000)
   2709 #define TPM_RIGHTBUTTON __MSABI_LONG(0x0002)
   2710 #define TPM_LEFTALIGN __MSABI_LONG(0x0000)
   2711 #define TPM_CENTERALIGN __MSABI_LONG(0x0004)
   2712 #define TPM_RIGHTALIGN __MSABI_LONG(0x0008)
   2713 #define TPM_TOPALIGN __MSABI_LONG(0x0000)
   2714 #define TPM_VCENTERALIGN __MSABI_LONG(0x0010)
   2715 #define TPM_BOTTOMALIGN __MSABI_LONG(0x0020)
   2716 
   2717 #define TPM_HORIZONTAL __MSABI_LONG(0x0000)
   2718 #define TPM_VERTICAL __MSABI_LONG(0x0040)
   2719 #define TPM_NONOTIFY __MSABI_LONG(0x0080)
   2720 #define TPM_RETURNCMD __MSABI_LONG(0x0100)
   2721 #define TPM_RECURSE __MSABI_LONG(0x0001)
   2722 #define TPM_HORPOSANIMATION __MSABI_LONG(0x0400)
   2723 #define TPM_HORNEGANIMATION __MSABI_LONG(0x0800)
   2724 #define TPM_VERPOSANIMATION __MSABI_LONG(0x1000)
   2725 #define TPM_VERNEGANIMATION __MSABI_LONG(0x2000)
   2726 #define TPM_NOANIMATION __MSABI_LONG(0x4000)
   2727 #define TPM_LAYOUTRTL __MSABI_LONG(0x8000)
   2728 #endif
   2729 
   2730   typedef struct tagDROPSTRUCT {
   2731     HWND hwndSource;
   2732     HWND hwndSink;
   2733     DWORD wFmt;
   2734     ULONG_PTR dwData;
   2735     POINT ptDrop;
   2736     DWORD dwControlData;
   2737   } DROPSTRUCT,*PDROPSTRUCT,*LPDROPSTRUCT;
   2738 
   2739 #define DOF_EXECUTABLE 0x8001
   2740 #define DOF_DOCUMENT 0x8002
   2741 #define DOF_DIRECTORY 0x8003
   2742 #define DOF_MULTIPLE 0x8004
   2743 #define DOF_PROGMAN 0x0001
   2744 #define DOF_SHELLDATA 0x0002
   2745 
   2746 #define DO_DROPFILE __MSABI_LONG(0x454C4946)
   2747 #define DO_PRINTFILE __MSABI_LONG(0x544E5250)
   2748 
   2749   WINUSERAPI DWORD WINAPI DragObject(HWND hwndParent,HWND hwndFrom,UINT fmt,ULONG_PTR data,HCURSOR hcur);
   2750   WINUSERAPI WINBOOL WINAPI DragDetect(HWND hwnd,POINT pt);
   2751   WINUSERAPI WINBOOL WINAPI DrawIcon(HDC hDC,int X,int Y,HICON hIcon);
   2752 
   2753 #ifndef NODRAWTEXT
   2754 
   2755 #define DT_TOP 0x00000000
   2756 #define DT_LEFT 0x00000000
   2757 #define DT_CENTER 0x00000001
   2758 #define DT_RIGHT 0x00000002
   2759 #define DT_VCENTER 0x00000004
   2760 #define DT_BOTTOM 0x00000008
   2761 #define DT_WORDBREAK 0x00000010
   2762 #define DT_SINGLELINE 0x00000020
   2763 #define DT_EXPANDTABS 0x00000040
   2764 #define DT_TABSTOP 0x00000080
   2765 #define DT_NOCLIP 0x00000100
   2766 #define DT_EXTERNALLEADING 0x00000200
   2767 #define DT_CALCRECT 0x00000400
   2768 #define DT_NOPREFIX 0x00000800
   2769 #define DT_INTERNAL 0x00001000
   2770 
   2771 #define DT_EDITCONTROL 0x00002000
   2772 #define DT_PATH_ELLIPSIS 0x00004000
   2773 #define DT_END_ELLIPSIS 0x00008000
   2774 #define DT_MODIFYSTRING 0x00010000
   2775 #define DT_RTLREADING 0x00020000
   2776 #define DT_WORD_ELLIPSIS 0x00040000
   2777 #define DT_NOFULLWIDTHCHARBREAK 0x00080000
   2778 #define DT_HIDEPREFIX 0x00100000
   2779 #define DT_PREFIXONLY 0x00200000
   2780 
   2781   typedef struct tagDRAWTEXTPARAMS {
   2782     UINT cbSize;
   2783     int iTabLength;
   2784     int iLeftMargin;
   2785     int iRightMargin;
   2786     UINT uiLengthDrawn;
   2787   } DRAWTEXTPARAMS,*LPDRAWTEXTPARAMS;
   2788 
   2789 #define DrawText __MINGW_NAME_AW(DrawText)
   2790 #define DrawTextEx __MINGW_NAME_AW(DrawTextEx)
   2791 
   2792   WINUSERAPI int WINAPI DrawTextA(HDC hdc,LPCSTR lpchText,int cchText,LPRECT lprc,UINT format);
   2793   WINUSERAPI int WINAPI DrawTextW(HDC hdc,LPCWSTR lpchText,int cchText,LPRECT lprc,UINT format);
   2794   WINUSERAPI int WINAPI DrawTextExA(HDC hdc,LPSTR lpchText,int cchText,LPRECT lprc,UINT format,LPDRAWTEXTPARAMS lpdtp);
   2795   WINUSERAPI int WINAPI DrawTextExW(HDC hdc,LPWSTR lpchText,int cchText,LPRECT lprc,UINT format,LPDRAWTEXTPARAMS lpdtp);
   2796 #endif
   2797 
   2798 #define GrayString __MINGW_NAME_AW(GrayString)
   2799 #define DrawState __MINGW_NAME_AW(DrawState)
   2800 #define TabbedTextOut __MINGW_NAME_AW(TabbedTextOut)
   2801 #define GetTabbedTextExtent __MINGW_NAME_AW(GetTabbedTextExtent)
   2802 
   2803   WINUSERAPI WINBOOL WINAPI GrayStringA(HDC hDC,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight);
   2804   WINUSERAPI WINBOOL WINAPI GrayStringW(HDC hDC,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight);
   2805 
   2806 #define DST_COMPLEX 0x0000
   2807 #define DST_TEXT 0x0001
   2808 #define DST_PREFIXTEXT 0x0002
   2809 #define DST_ICON 0x0003
   2810 #define DST_BITMAP 0x0004
   2811 
   2812 #define DSS_NORMAL 0x0000
   2813 #define DSS_UNION 0x0010
   2814 #define DSS_DISABLED 0x0020
   2815 #define DSS_MONO 0x0080
   2816 #define DSS_HIDEPREFIX 0x0200
   2817 #define DSS_PREFIXONLY 0x0400
   2818 #define DSS_RIGHT 0x8000
   2819 
   2820   WINUSERAPI WINBOOL WINAPI DrawStateA(HDC hdc,HBRUSH hbrFore,DRAWSTATEPROC qfnCallBack,LPARAM lData,WPARAM wData,int x,int y,int cx,int cy,UINT uFlags);
   2821   WINUSERAPI WINBOOL WINAPI DrawStateW(HDC hdc,HBRUSH hbrFore,DRAWSTATEPROC qfnCallBack,LPARAM lData,WPARAM wData,int x,int y,int cx,int cy,UINT uFlags);
   2822   WINUSERAPI LONG WINAPI TabbedTextOutA(HDC hdc,int x,int y,LPCSTR lpString,int chCount,int nTabPositions,CONST INT *lpnTabStopPositions,int nTabOrigin);
   2823   WINUSERAPI LONG WINAPI TabbedTextOutW(HDC hdc,int x,int y,LPCWSTR lpString,int chCount,int nTabPositions,CONST INT *lpnTabStopPositions,int nTabOrigin);
   2824   WINUSERAPI DWORD WINAPI GetTabbedTextExtentA(HDC hdc,LPCSTR lpString,int chCount,int nTabPositions,CONST INT *lpnTabStopPositions);
   2825   WINUSERAPI DWORD WINAPI GetTabbedTextExtentW(HDC hdc,LPCWSTR lpString,int chCount,int nTabPositions,CONST INT *lpnTabStopPositions);
   2826   WINUSERAPI WINBOOL WINAPI UpdateWindow(HWND hWnd);
   2827   WINUSERAPI HWND WINAPI SetActiveWindow(HWND hWnd);
   2828   WINUSERAPI HWND WINAPI GetForegroundWindow(VOID);
   2829   WINUSERAPI WINBOOL WINAPI PaintDesktop(HDC hdc);
   2830   WINUSERAPI VOID WINAPI SwitchToThisWindow(HWND hwnd,WINBOOL fUnknown);
   2831   WINUSERAPI WINBOOL WINAPI SetForegroundWindow(HWND hWnd);
   2832   WINUSERAPI WINBOOL WINAPI AllowSetForegroundWindow(DWORD dwProcessId);
   2833 
   2834 #define ASFW_ANY ((DWORD)-1)
   2835 
   2836   WINUSERAPI WINBOOL WINAPI LockSetForegroundWindow(UINT uLockCode);
   2837 
   2838 #define LSFW_LOCK 1
   2839 #define LSFW_UNLOCK 2
   2840 
   2841   WINUSERAPI HWND WINAPI WindowFromDC(HDC hDC);
   2842   WINUSERAPI HDC WINAPI GetDC(HWND hWnd);
   2843   WINUSERAPI HDC WINAPI GetDCEx(HWND hWnd,HRGN hrgnClip,DWORD flags);
   2844 
   2845 #define DCX_WINDOW __MSABI_LONG(0x00000001)
   2846 #define DCX_CACHE __MSABI_LONG(0x00000002)
   2847 #define DCX_NORESETATTRS __MSABI_LONG(0x00000004)
   2848 #define DCX_CLIPCHILDREN __MSABI_LONG(0x00000008)
   2849 #define DCX_CLIPSIBLINGS __MSABI_LONG(0x00000010)
   2850 #define DCX_PARENTCLIP __MSABI_LONG(0x00000020)
   2851 #define DCX_EXCLUDERGN __MSABI_LONG(0x00000040)
   2852 #define DCX_INTERSECTRGN __MSABI_LONG(0x00000080)
   2853 #define DCX_EXCLUDEUPDATE __MSABI_LONG(0x00000100)
   2854 #define DCX_INTERSECTUPDATE __MSABI_LONG(0x00000200)
   2855 #define DCX_LOCKWINDOWUPDATE __MSABI_LONG(0x00000400)
   2856 
   2857 #define DCX_VALIDATE __MSABI_LONG(0x00200000)
   2858 
   2859   WINUSERAPI HDC WINAPI GetWindowDC(HWND hWnd);
   2860   WINUSERAPI int WINAPI ReleaseDC(HWND hWnd,HDC hDC);
   2861   WINUSERAPI HDC WINAPI BeginPaint(HWND hWnd,LPPAINTSTRUCT lpPaint);
   2862   WINUSERAPI WINBOOL WINAPI EndPaint(HWND hWnd,CONST PAINTSTRUCT *lpPaint);
   2863   WINUSERAPI WINBOOL WINAPI GetUpdateRect(HWND hWnd,LPRECT lpRect,WINBOOL bErase);
   2864   WINUSERAPI int WINAPI GetUpdateRgn(HWND hWnd,HRGN hRgn,WINBOOL bErase);
   2865   WINUSERAPI int WINAPI SetWindowRgn(HWND hWnd,HRGN hRgn,WINBOOL bRedraw);
   2866   WINUSERAPI int WINAPI GetWindowRgn(HWND hWnd,HRGN hRgn);
   2867   WINUSERAPI int WINAPI GetWindowRgnBox(HWND hWnd,LPRECT lprc);
   2868   WINUSERAPI int WINAPI ExcludeUpdateRgn(HDC hDC,HWND hWnd);
   2869   WINUSERAPI WINBOOL WINAPI InvalidateRect(HWND hWnd,CONST RECT *lpRect,WINBOOL bErase);
   2870   WINUSERAPI WINBOOL WINAPI ValidateRect(HWND hWnd,CONST RECT *lpRect);
   2871   WINUSERAPI WINBOOL WINAPI InvalidateRgn(HWND hWnd,HRGN hRgn,WINBOOL bErase);
   2872   WINUSERAPI WINBOOL WINAPI ValidateRgn(HWND hWnd,HRGN hRgn);
   2873   WINUSERAPI WINBOOL WINAPI RedrawWindow(HWND hWnd,CONST RECT *lprcUpdate,HRGN hrgnUpdate,UINT flags);
   2874 
   2875 #define RDW_INVALIDATE 0x0001
   2876 #define RDW_INTERNALPAINT 0x0002
   2877 #define RDW_ERASE 0x0004
   2878 
   2879 #define RDW_VALIDATE 0x0008
   2880 #define RDW_NOINTERNALPAINT 0x0010
   2881 #define RDW_NOERASE 0x0020
   2882 
   2883 #define RDW_NOCHILDREN 0x0040
   2884 #define RDW_ALLCHILDREN 0x0080
   2885 
   2886 #define RDW_UPDATENOW 0x0100
   2887 #define RDW_ERASENOW 0x0200
   2888 
   2889 #define RDW_FRAME 0x0400
   2890 #define RDW_NOFRAME 0x0800
   2891 
   2892   WINUSERAPI WINBOOL WINAPI LockWindowUpdate(HWND hWndLock);
   2893   WINUSERAPI WINBOOL WINAPI ScrollWindow(HWND hWnd,int XAmount,int YAmount,CONST RECT *lpRect,CONST RECT *lpClipRect);
   2894   WINUSERAPI WINBOOL WINAPI ScrollDC(HDC hDC,int dx,int dy,CONST RECT *lprcScroll,CONST RECT *lprcClip,HRGN hrgnUpdate,LPRECT lprcUpdate);
   2895   WINUSERAPI int WINAPI ScrollWindowEx(HWND hWnd,int dx,int dy,CONST RECT *prcScroll,CONST RECT *prcClip,HRGN hrgnUpdate,LPRECT prcUpdate,UINT flags);
   2896 
   2897 #define SW_SCROLLCHILDREN 0x0001
   2898 #define SW_INVALIDATE 0x0002
   2899 #define SW_ERASE 0x0004
   2900 #define SW_SMOOTHSCROLL 0x0010
   2901 
   2902 #ifndef NOSCROLL
   2903   WINUSERAPI int WINAPI SetScrollPos(HWND hWnd,int nBar,int nPos,WINBOOL bRedraw);
   2904   WINUSERAPI int WINAPI GetScrollPos(HWND hWnd,int nBar);
   2905   WINUSERAPI WINBOOL WINAPI SetScrollRange(HWND hWnd,int nBar,int nMinPos,int nMaxPos,WINBOOL bRedraw);
   2906   WINUSERAPI WINBOOL WINAPI GetScrollRange(HWND hWnd,int nBar,LPINT lpMinPos,LPINT lpMaxPos);
   2907   WINUSERAPI WINBOOL WINAPI ShowScrollBar(HWND hWnd,int wBar,WINBOOL bShow);
   2908   WINUSERAPI WINBOOL WINAPI EnableScrollBar(HWND hWnd,UINT wSBflags,UINT wArrows);
   2909 
   2910 #define ESB_ENABLE_BOTH 0x0000
   2911 #define ESB_DISABLE_BOTH 0x0003
   2912 
   2913 #define ESB_DISABLE_LEFT 0x0001
   2914 #define ESB_DISABLE_RIGHT 0x0002
   2915 
   2916 #define ESB_DISABLE_UP 0x0001
   2917 #define ESB_DISABLE_DOWN 0x0002
   2918 
   2919 #define ESB_DISABLE_LTUP ESB_DISABLE_LEFT
   2920 #define ESB_DISABLE_RTDN ESB_DISABLE_RIGHT
   2921 #endif
   2922 
   2923 #define SetProp __MINGW_NAME_AW(SetProp)
   2924 #define GetProp __MINGW_NAME_AW(GetProp)
   2925 #define RemoveProp __MINGW_NAME_AW(RemoveProp)
   2926 #define EnumPropsEx __MINGW_NAME_AW(EnumPropsEx)
   2927 #define EnumProps __MINGW_NAME_AW(EnumProps)
   2928 #define SetWindowText __MINGW_NAME_AW(SetWindowText)
   2929 #define GetWindowText __MINGW_NAME_AW(GetWindowText)
   2930 #define GetWindowTextLength __MINGW_NAME_AW(GetWindowTextLength)
   2931 
   2932   WINUSERAPI WINBOOL WINAPI SetPropA(HWND hWnd,LPCSTR lpString,HANDLE hData);
   2933   WINUSERAPI WINBOOL WINAPI SetPropW(HWND hWnd,LPCWSTR lpString,HANDLE hData);
   2934   WINUSERAPI HANDLE WINAPI GetPropA(HWND hWnd,LPCSTR lpString);
   2935   WINUSERAPI HANDLE WINAPI GetPropW(HWND hWnd,LPCWSTR lpString);
   2936   WINUSERAPI HANDLE WINAPI RemovePropA(HWND hWnd,LPCSTR lpString);
   2937   WINUSERAPI HANDLE WINAPI RemovePropW(HWND hWnd,LPCWSTR lpString);
   2938   WINUSERAPI int WINAPI EnumPropsExA(HWND hWnd,PROPENUMPROCEXA lpEnumFunc,LPARAM lParam);
   2939   WINUSERAPI int WINAPI EnumPropsExW(HWND hWnd,PROPENUMPROCEXW lpEnumFunc,LPARAM lParam);
   2940   WINUSERAPI int WINAPI EnumPropsA(HWND hWnd,PROPENUMPROCA lpEnumFunc);
   2941   WINUSERAPI int WINAPI EnumPropsW(HWND hWnd,PROPENUMPROCW lpEnumFunc);
   2942   WINUSERAPI WINBOOL WINAPI SetWindowTextA(HWND hWnd,LPCSTR lpString);
   2943   WINUSERAPI WINBOOL WINAPI SetWindowTextW(HWND hWnd,LPCWSTR lpString);
   2944   WINUSERAPI int WINAPI GetWindowTextA(HWND hWnd,LPSTR lpString,int nMaxCount);
   2945   WINUSERAPI int WINAPI GetWindowTextW(HWND hWnd,LPWSTR lpString,int nMaxCount);
   2946   WINUSERAPI int WINAPI GetWindowTextLengthA(HWND hWnd);
   2947   WINUSERAPI int WINAPI GetWindowTextLengthW(HWND hWnd);
   2948   WINUSERAPI WINBOOL WINAPI GetClientRect(HWND hWnd,LPRECT lpRect);
   2949   WINUSERAPI WINBOOL WINAPI GetWindowRect(HWND hWnd,LPRECT lpRect);
   2950   WINUSERAPI WINBOOL WINAPI AdjustWindowRect(LPRECT lpRect,DWORD dwStyle,WINBOOL bMenu);
   2951   WINUSERAPI WINBOOL WINAPI AdjustWindowRectEx(LPRECT lpRect,DWORD dwStyle,WINBOOL bMenu,DWORD dwExStyle);
   2952 
   2953 #define HELPINFO_WINDOW 0x0001
   2954 #define HELPINFO_MENUITEM 0x0002
   2955 
   2956   typedef struct tagHELPINFO {
   2957     UINT cbSize;
   2958     int iContextType;
   2959     int iCtrlId;
   2960     HANDLE hItemHandle;
   2961     DWORD_PTR dwContextId;
   2962     POINT MousePos;
   2963   } HELPINFO,*LPHELPINFO;
   2964 
   2965   WINUSERAPI WINBOOL WINAPI SetWindowContextHelpId(HWND,DWORD);
   2966   WINUSERAPI DWORD WINAPI GetWindowContextHelpId(HWND);
   2967   WINUSERAPI WINBOOL WINAPI SetMenuContextHelpId(HMENU,DWORD);
   2968   WINUSERAPI DWORD WINAPI GetMenuContextHelpId(HMENU);
   2969 
   2970 #ifndef NOMB
   2971 
   2972 #define MB_OK __MSABI_LONG(0x00000000)
   2973 #define MB_OKCANCEL __MSABI_LONG(0x00000001)
   2974 #define MB_ABORTRETRYIGNORE __MSABI_LONG(0x00000002)
   2975 #define MB_YESNOCANCEL __MSABI_LONG(0x00000003)
   2976 #define MB_YESNO __MSABI_LONG(0x00000004)
   2977 #define MB_RETRYCANCEL __MSABI_LONG(0x00000005)
   2978 #define MB_CANCELTRYCONTINUE __MSABI_LONG(0x00000006)
   2979 #define MB_ICONHAND __MSABI_LONG(0x00000010)
   2980 #define MB_ICONQUESTION __MSABI_LONG(0x00000020)
   2981 #define MB_ICONEXCLAMATION __MSABI_LONG(0x00000030)
   2982 #define MB_ICONASTERISK __MSABI_LONG(0x00000040)
   2983 #define MB_USERICON __MSABI_LONG(0x00000080)
   2984 #define MB_ICONWARNING MB_ICONEXCLAMATION
   2985 #define MB_ICONERROR MB_ICONHAND
   2986 #define MB_ICONINFORMATION MB_ICONASTERISK
   2987 #define MB_ICONSTOP MB_ICONHAND
   2988 #define MB_DEFBUTTON1 __MSABI_LONG(0x00000000)
   2989 #define MB_DEFBUTTON2 __MSABI_LONG(0x00000100)
   2990 #define MB_DEFBUTTON3 __MSABI_LONG(0x00000200)
   2991 #define MB_DEFBUTTON4 __MSABI_LONG(0x00000300)
   2992 #define MB_APPLMODAL __MSABI_LONG(0x00000000)
   2993 #define MB_SYSTEMMODAL __MSABI_LONG(0x00001000)
   2994 #define MB_TASKMODAL __MSABI_LONG(0x00002000)
   2995 #define MB_HELP __MSABI_LONG(0x00004000)
   2996 #define MB_NOFOCUS __MSABI_LONG(0x00008000)
   2997 #define MB_SETFOREGROUND __MSABI_LONG(0x00010000)
   2998 #define MB_DEFAULT_DESKTOP_ONLY __MSABI_LONG(0x00020000)
   2999 #define MB_TOPMOST __MSABI_LONG(0x00040000)
   3000 #define MB_RIGHT __MSABI_LONG(0x00080000)
   3001 #define MB_RTLREADING __MSABI_LONG(0x00100000)
   3002 #define MB_SERVICE_NOTIFICATION __MSABI_LONG(0x00200000)
   3003 #define MB_SERVICE_NOTIFICATION_NT3X __MSABI_LONG(0x00040000)
   3004 #define MB_TYPEMASK __MSABI_LONG(0x0000000F)
   3005 #define MB_ICONMASK __MSABI_LONG(0x000000F0)
   3006 #define MB_DEFMASK __MSABI_LONG(0x00000F00)
   3007 #define MB_MODEMASK __MSABI_LONG(0x00003000)
   3008 #define MB_MISCMASK __MSABI_LONG(0x0000C000)
   3009 
   3010 #define MessageBox __MINGW_NAME_AW(MessageBox)
   3011 #define MessageBoxEx __MINGW_NAME_AW(MessageBoxEx)
   3012 
   3013   WINUSERAPI int WINAPI MessageBoxA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType);
   3014   WINUSERAPI int WINAPI MessageBoxW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType);
   3015   WINUSERAPI int WINAPI MessageBoxExA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType,WORD wLanguageId);
   3016   WINUSERAPI int WINAPI MessageBoxExW(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT uType,WORD wLanguageId);
   3017 
   3018   typedef VOID (CALLBACK *MSGBOXCALLBACK)(LPHELPINFO lpHelpInfo);
   3019 
   3020   typedef struct tagMSGBOXPARAMSA {
   3021     UINT cbSize;
   3022     HWND hwndOwner;
   3023     HINSTANCE hInstance;
   3024     LPCSTR lpszText;
   3025     LPCSTR lpszCaption;
   3026     DWORD dwStyle;
   3027     LPCSTR lpszIcon;
   3028     DWORD_PTR dwContextHelpId;
   3029     MSGBOXCALLBACK lpfnMsgBoxCallback;
   3030     DWORD dwLanguageId;
   3031   } MSGBOXPARAMSA,*PMSGBOXPARAMSA,*LPMSGBOXPARAMSA;
   3032 
   3033   typedef struct tagMSGBOXPARAMSW {
   3034     UINT cbSize;
   3035     HWND hwndOwner;
   3036     HINSTANCE hInstance;
   3037     LPCWSTR lpszText;
   3038     LPCWSTR lpszCaption;
   3039     DWORD dwStyle;
   3040     LPCWSTR lpszIcon;
   3041     DWORD_PTR dwContextHelpId;
   3042     MSGBOXCALLBACK lpfnMsgBoxCallback;
   3043     DWORD dwLanguageId;
   3044   } MSGBOXPARAMSW,*PMSGBOXPARAMSW,*LPMSGBOXPARAMSW;
   3045 
   3046   __MINGW_TYPEDEF_AW(MSGBOXPARAMS)
   3047   __MINGW_TYPEDEF_AW(PMSGBOXPARAMS)
   3048   __MINGW_TYPEDEF_AW(LPMSGBOXPARAMS)
   3049 
   3050 #define MessageBoxIndirect __MINGW_NAME_AW(MessageBoxIndirect)
   3051 
   3052   WINUSERAPI int WINAPI MessageBoxIndirectA(CONST MSGBOXPARAMSA *lpmbp);
   3053   WINUSERAPI int WINAPI MessageBoxIndirectW(CONST MSGBOXPARAMSW *lpmbp);
   3054   WINUSERAPI WINBOOL WINAPI MessageBeep(UINT uType);
   3055 #endif
   3056 
   3057   WINUSERAPI int WINAPI ShowCursor(WINBOOL bShow);
   3058   WINUSERAPI WINBOOL WINAPI SetCursorPos(int X,int Y);
   3059   WINUSERAPI HCURSOR WINAPI SetCursor(HCURSOR hCursor);
   3060   WINUSERAPI WINBOOL WINAPI GetCursorPos(LPPOINT lpPoint);
   3061   WINUSERAPI WINBOOL WINAPI ClipCursor(CONST RECT *lpRect);
   3062   WINUSERAPI WINBOOL WINAPI GetClipCursor(LPRECT lpRect);
   3063   WINUSERAPI HCURSOR WINAPI GetCursor(VOID);
   3064   WINUSERAPI WINBOOL WINAPI CreateCaret(HWND hWnd,HBITMAP hBitmap,int nWidth,int nHeight);
   3065   WINUSERAPI UINT WINAPI GetCaretBlinkTime(VOID);
   3066   WINUSERAPI WINBOOL WINAPI SetCaretBlinkTime(UINT uMSeconds);
   3067   WINUSERAPI WINBOOL WINAPI DestroyCaret(VOID);
   3068   WINUSERAPI WINBOOL WINAPI HideCaret(HWND hWnd);
   3069   WINUSERAPI WINBOOL WINAPI ShowCaret(HWND hWnd);
   3070   WINUSERAPI WINBOOL WINAPI SetCaretPos(int X,int Y);
   3071   WINUSERAPI WINBOOL WINAPI GetCaretPos(LPPOINT lpPoint);
   3072   WINUSERAPI WINBOOL WINAPI ClientToScreen(HWND hWnd,LPPOINT lpPoint);
   3073   WINUSERAPI WINBOOL WINAPI ScreenToClient(HWND hWnd,LPPOINT lpPoint);
   3074   WINUSERAPI int WINAPI MapWindowPoints(HWND hWndFrom,HWND hWndTo,LPPOINT lpPoints,UINT cPoints);
   3075   WINUSERAPI HWND WINAPI WindowFromPoint(POINT Point);
   3076   WINUSERAPI HWND WINAPI ChildWindowFromPoint(HWND hWndParent,POINT Point);
   3077 
   3078 #define CWP_ALL 0x0000
   3079 #define CWP_SKIPINVISIBLE 0x0001
   3080 #define CWP_SKIPDISABLED 0x0002
   3081 #define CWP_SKIPTRANSPARENT 0x0004
   3082 
   3083   WINUSERAPI HWND WINAPI ChildWindowFromPointEx(HWND hwnd,POINT pt,UINT flags);
   3084 
   3085 #ifndef NOCOLOR
   3086 
   3087 #define CTLCOLOR_MSGBOX 0
   3088 #define CTLCOLOR_EDIT 1
   3089 #define CTLCOLOR_LISTBOX 2
   3090 #define CTLCOLOR_BTN 3
   3091 #define CTLCOLOR_DLG 4
   3092 #define CTLCOLOR_SCROLLBAR 5
   3093 #define CTLCOLOR_STATIC 6
   3094 #define CTLCOLOR_MAX 7
   3095 
   3096 #define COLOR_SCROLLBAR 0
   3097 #define COLOR_BACKGROUND 1
   3098 #define COLOR_ACTIVECAPTION 2
   3099 #define COLOR_INACTIVECAPTION 3
   3100 #define COLOR_MENU 4
   3101 #define COLOR_WINDOW 5
   3102 #define COLOR_WINDOWFRAME 6
   3103 #define COLOR_MENUTEXT 7
   3104 #define COLOR_WINDOWTEXT 8
   3105 #define COLOR_CAPTIONTEXT 9
   3106 #define COLOR_ACTIVEBORDER 10
   3107 #define COLOR_INACTIVEBORDER 11
   3108 #define COLOR_APPWORKSPACE 12
   3109 #define COLOR_HIGHLIGHT 13
   3110 #define COLOR_HIGHLIGHTTEXT 14
   3111 #define COLOR_BTNFACE 15
   3112 #define COLOR_BTNSHADOW 16
   3113 #define COLOR_GRAYTEXT 17
   3114 #define COLOR_BTNTEXT 18
   3115 #define COLOR_INACTIVECAPTIONTEXT 19
   3116 #define COLOR_BTNHIGHLIGHT 20
   3117 
   3118 #define COLOR_3DDKSHADOW 21
   3119 #define COLOR_3DLIGHT 22
   3120 #define COLOR_INFOTEXT 23
   3121 #define COLOR_INFOBK 24
   3122 
   3123 #define COLOR_HOTLIGHT 26
   3124 #define COLOR_GRADIENTACTIVECAPTION 27
   3125 #define COLOR_GRADIENTINACTIVECAPTION 28
   3126 #define COLOR_MENUHILIGHT 29
   3127 #define COLOR_MENUBAR 30
   3128 
   3129 #define COLOR_DESKTOP COLOR_BACKGROUND
   3130 #define COLOR_3DFACE COLOR_BTNFACE
   3131 #define COLOR_3DSHADOW COLOR_BTNSHADOW
   3132 #define COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT
   3133 #define COLOR_3DHILIGHT COLOR_BTNHIGHLIGHT
   3134 #define COLOR_BTNHILIGHT COLOR_BTNHIGHLIGHT
   3135 
   3136   WINUSERAPI DWORD WINAPI GetSysColor(int nIndex);
   3137   WINUSERAPI HBRUSH WINAPI GetSysColorBrush(int nIndex);
   3138   WINUSERAPI WINBOOL WINAPI SetSysColors(int cElements,CONST INT *lpaElements,CONST COLORREF *lpaRgbValues);
   3139 #endif
   3140 
   3141   WINUSERAPI WINBOOL WINAPI DrawFocusRect(HDC hDC,CONST RECT *lprc);
   3142   WINUSERAPI int WINAPI FillRect(HDC hDC,CONST RECT *lprc,HBRUSH hbr);
   3143   WINUSERAPI int WINAPI FrameRect(HDC hDC,CONST RECT *lprc,HBRUSH hbr);
   3144   WINUSERAPI WINBOOL WINAPI InvertRect(HDC hDC,CONST RECT *lprc);
   3145   WINUSERAPI WINBOOL WINAPI SetRect(LPRECT lprc,int xLeft,int yTop,int xRight,int yBottom);
   3146   WINUSERAPI WINBOOL WINAPI SetRectEmpty(LPRECT lprc);
   3147   WINUSERAPI WINBOOL WINAPI CopyRect(LPRECT lprcDst,CONST RECT *lprcSrc);
   3148   WINUSERAPI WINBOOL WINAPI InflateRect(LPRECT lprc,int dx,int dy);
   3149   WINUSERAPI WINBOOL WINAPI IntersectRect(LPRECT lprcDst,CONST RECT *lprcSrc1,CONST RECT *lprcSrc2);
   3150   WINUSERAPI WINBOOL WINAPI UnionRect(LPRECT lprcDst,CONST RECT *lprcSrc1,CONST RECT *lprcSrc2);
   3151   WINUSERAPI WINBOOL WINAPI SubtractRect(LPRECT lprcDst,CONST RECT *lprcSrc1,CONST RECT *lprcSrc2);
   3152   WINUSERAPI WINBOOL WINAPI OffsetRect(LPRECT lprc,int dx,int dy);
   3153   WINUSERAPI WINBOOL WINAPI IsRectEmpty(CONST RECT *lprc);
   3154   WINUSERAPI WINBOOL WINAPI EqualRect(CONST RECT *lprc1,CONST RECT *lprc2);
   3155   WINUSERAPI WINBOOL WINAPI PtInRect(CONST RECT *lprc,POINT pt);
   3156 
   3157 #ifndef NOWINOFFSETS
   3158 
   3159 #define GetWindowLong __MINGW_NAME_AW(GetWindowLong)
   3160 #define SetWindowLong __MINGW_NAME_AW(SetWindowLong)
   3161 
   3162   WINUSERAPI WORD WINAPI GetWindowWord(HWND hWnd,int nIndex);
   3163   WINUSERAPI WORD WINAPI SetWindowWord(HWND hWnd,int nIndex,WORD wNewWord);
   3164   WINUSERAPI LONG WINAPI GetWindowLongA(HWND hWnd,int nIndex);
   3165   WINUSERAPI LONG WINAPI GetWindowLongW(HWND hWnd,int nIndex);
   3166   WINUSERAPI LONG WINAPI SetWindowLongA(HWND hWnd,int nIndex,LONG dwNewLong);
   3167   WINUSERAPI LONG WINAPI SetWindowLongW(HWND hWnd,int nIndex,LONG dwNewLong);
   3168 
   3169 #ifdef _WIN64
   3170 
   3171 #define GetWindowLongPtr __MINGW_NAME_AW(GetWindowLongPtr)
   3172 #define SetWindowLongPtr __MINGW_NAME_AW(SetWindowLongPtr)
   3173 
   3174   WINUSERAPI LONG_PTR WINAPI GetWindowLongPtrA(HWND hWnd,int nIndex);
   3175   WINUSERAPI LONG_PTR WINAPI GetWindowLongPtrW(HWND hWnd,int nIndex);
   3176   WINUSERAPI LONG_PTR WINAPI SetWindowLongPtrA(HWND hWnd,int nIndex,LONG_PTR dwNewLong);
   3177   WINUSERAPI LONG_PTR WINAPI SetWindowLongPtrW(HWND hWnd,int nIndex,LONG_PTR dwNewLong);
   3178 #else
   3179 
   3180 #define GetWindowLongPtr __MINGW_NAME_AW(GetWindowLongPtr)
   3181 #define SetWindowLongPtr __MINGW_NAME_AW(SetWindowLongPtr)
   3182 
   3183 #define GetWindowLongPtrA GetWindowLongA
   3184 #define GetWindowLongPtrW GetWindowLongW
   3185 #define SetWindowLongPtrA SetWindowLongA
   3186 #define SetWindowLongPtrW SetWindowLongW
   3187 #endif
   3188 
   3189 #define GetClassLong __MINGW_NAME_AW(GetClassLong)
   3190 #define SetClassLong __MINGW_NAME_AW(SetClassLong)
   3191 
   3192   WINUSERAPI WORD WINAPI GetClassWord(HWND hWnd,int nIndex);
   3193   WINUSERAPI WORD WINAPI SetClassWord(HWND hWnd,int nIndex,WORD wNewWord);
   3194   WINUSERAPI DWORD WINAPI GetClassLongA(HWND hWnd,int nIndex);
   3195   WINUSERAPI DWORD WINAPI GetClassLongW(HWND hWnd,int nIndex);
   3196   WINUSERAPI DWORD WINAPI SetClassLongA(HWND hWnd,int nIndex,LONG dwNewLong);
   3197   WINUSERAPI DWORD WINAPI SetClassLongW(HWND hWnd,int nIndex,LONG dwNewLong);
   3198 
   3199 #ifdef _WIN64
   3200 
   3201 #define GetClassLongPtr __MINGW_NAME_AW(GetClassLongPtr)
   3202 #define SetClassLongPtr __MINGW_NAME_AW(SetClassLongPtr)
   3203 
   3204   WINUSERAPI ULONG_PTR WINAPI GetClassLongPtrA(HWND hWnd,int nIndex);
   3205   WINUSERAPI ULONG_PTR WINAPI GetClassLongPtrW(HWND hWnd,int nIndex);
   3206   WINUSERAPI ULONG_PTR WINAPI SetClassLongPtrA(HWND hWnd,int nIndex,LONG_PTR dwNewLong);
   3207   WINUSERAPI ULONG_PTR WINAPI SetClassLongPtrW(HWND hWnd,int nIndex,LONG_PTR dwNewLong);
   3208 #else
   3209 #define GetClassLongPtr __MINGW_NAME_AW(GetClassLongPtr)
   3210 #define SetClassLongPtr __MINGW_NAME_AW(SetClassLongPtr)
   3211 
   3212 #define GetClassLongPtrA GetClassLongA
   3213 #define GetClassLongPtrW GetClassLongW
   3214 #define SetClassLongPtrA SetClassLongA
   3215 #define SetClassLongPtrW SetClassLongW
   3216 #endif
   3217 #endif
   3218 
   3219 #define FindWindow __MINGW_NAME_AW(FindWindow)
   3220 #define FindWindowEx __MINGW_NAME_AW(FindWindowEx)
   3221 #define GetClassName __MINGW_NAME_AW(GetClassName)
   3222 
   3223   WINUSERAPI WINBOOL WINAPI GetProcessDefaultLayout(DWORD *pdwDefaultLayout);
   3224   WINUSERAPI WINBOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout);
   3225   WINUSERAPI HWND WINAPI GetDesktopWindow(VOID);
   3226   WINUSERAPI HWND WINAPI GetParent(HWND hWnd);
   3227   WINUSERAPI HWND WINAPI SetParent(HWND hWndChild,HWND hWndNewParent);
   3228   WINUSERAPI WINBOOL WINAPI EnumChildWindows(HWND hWndParent,WNDENUMPROC lpEnumFunc,LPARAM lParam);
   3229   WINUSERAPI HWND WINAPI FindWindowA(LPCSTR lpClassName,LPCSTR lpWindowName);
   3230   WINUSERAPI HWND WINAPI FindWindowW(LPCWSTR lpClassName,LPCWSTR lpWindowName);
   3231   WINUSERAPI HWND WINAPI FindWindowExA(HWND hWndParent,HWND hWndChildAfter,LPCSTR lpszClass,LPCSTR lpszWindow);
   3232   WINUSERAPI HWND WINAPI FindWindowExW(HWND hWndParent,HWND hWndChildAfter,LPCWSTR lpszClass,LPCWSTR lpszWindow);
   3233   WINUSERAPI HWND WINAPI GetShellWindow(VOID);
   3234   WINUSERAPI WINBOOL WINAPI RegisterShellHookWindow(HWND hwnd);
   3235   WINUSERAPI WINBOOL WINAPI DeregisterShellHookWindow(HWND hwnd);
   3236   WINUSERAPI WINBOOL WINAPI EnumWindows(WNDENUMPROC lpEnumFunc,LPARAM lParam);
   3237   WINUSERAPI WINBOOL WINAPI EnumThreadWindows(DWORD dwThreadId,WNDENUMPROC lpfn,LPARAM lParam);
   3238 
   3239 #define EnumTaskWindows(hTask,lpfn,lParam) EnumThreadWindows(HandleToUlong(hTask),lpfn,lParam)
   3240 
   3241   WINUSERAPI int WINAPI GetClassNameA(HWND hWnd,LPSTR lpClassName,int nMaxCount);
   3242   WINUSERAPI int WINAPI GetClassNameW(HWND hWnd,LPWSTR lpClassName,int nMaxCount);
   3243   WINUSERAPI HWND WINAPI GetTopWindow(HWND hWnd);
   3244 
   3245 #define GetNextWindow(hWnd,wCmd) GetWindow(hWnd,wCmd)
   3246 #define GetSysModalWindow() (NULL)
   3247 #define SetSysModalWindow(hWnd) (NULL)
   3248 
   3249   WINUSERAPI DWORD WINAPI GetWindowThreadProcessId(HWND hWnd,LPDWORD lpdwProcessId);
   3250   WINUSERAPI WINBOOL WINAPI IsGUIThread(WINBOOL bConvert);
   3251 
   3252 #define GetWindowTask(hWnd) ((HANDLE)(DWORD_PTR)GetWindowThreadProcessId(hWnd,NULL))
   3253 
   3254   WINUSERAPI HWND WINAPI GetLastActivePopup(HWND hWnd);
   3255 
   3256 #define GW_HWNDFIRST 0
   3257 #define GW_HWNDLAST 1
   3258 #define GW_HWNDNEXT 2
   3259 #define GW_HWNDPREV 3
   3260 #define GW_OWNER 4
   3261 #define GW_CHILD 5
   3262 #define GW_ENABLEDPOPUP 6
   3263 #define GW_MAX 6
   3264 
   3265   WINUSERAPI HWND WINAPI GetWindow(HWND hWnd,UINT uCmd);
   3266 
   3267 #ifndef NOWH
   3268 
   3269 #define SetWindowsHook __MINGW_NAME_AW(SetWindowsHook)
   3270 #define SetWindowsHookEx __MINGW_NAME_AW(SetWindowsHookEx)
   3271 
   3272   WINUSERAPI HHOOK WINAPI SetWindowsHookA(int nFilterType,HOOKPROC pfnFilterProc);
   3273   WINUSERAPI HHOOK WINAPI SetWindowsHookW(int nFilterType,HOOKPROC pfnFilterProc);
   3274   WINUSERAPI WINBOOL WINAPI UnhookWindowsHook(int nCode,HOOKPROC pfnFilterProc);
   3275   WINUSERAPI HHOOK WINAPI SetWindowsHookExA(int idHook,HOOKPROC lpfn,HINSTANCE hmod,DWORD dwThreadId);
   3276   WINUSERAPI HHOOK WINAPI SetWindowsHookExW(int idHook,HOOKPROC lpfn,HINSTANCE hmod,DWORD dwThreadId);
   3277   WINUSERAPI WINBOOL WINAPI UnhookWindowsHookEx(HHOOK hhk);
   3278   WINUSERAPI LRESULT WINAPI CallNextHookEx(HHOOK hhk,int nCode,WPARAM wParam,LPARAM lParam);
   3279 #define DefHookProc(nCode,wParam,lParam,phhk) CallNextHookEx(*phhk,nCode,wParam,lParam)
   3280 #endif
   3281 
   3282 #ifndef NOMENUS
   3283 
   3284 #define MF_INSERT __MSABI_LONG(0x00000000)
   3285 #define MF_CHANGE __MSABI_LONG(0x00000080)
   3286 #define MF_APPEND __MSABI_LONG(0x00000100)
   3287 #define MF_DELETE __MSABI_LONG(0x00000200)
   3288 #define MF_REMOVE __MSABI_LONG(0x00001000)
   3289 #define MF_BYCOMMAND __MSABI_LONG(0x00000000)
   3290 #define MF_BYPOSITION __MSABI_LONG(0x00000400)
   3291 #define MF_SEPARATOR __MSABI_LONG(0x00000800)
   3292 #define MF_ENABLED __MSABI_LONG(0x00000000)
   3293 #define MF_GRAYED __MSABI_LONG(0x00000001)
   3294 #define MF_DISABLED __MSABI_LONG(0x00000002)
   3295 #define MF_UNCHECKED __MSABI_LONG(0x00000000)
   3296 #define MF_CHECKED __MSABI_LONG(0x00000008)
   3297 #define MF_USECHECKBITMAPS __MSABI_LONG(0x00000200)
   3298 #define MF_STRING __MSABI_LONG(0x00000000)
   3299 #define MF_BITMAP __MSABI_LONG(0x00000004)
   3300 #define MF_OWNERDRAW __MSABI_LONG(0x00000100)
   3301 #define MF_POPUP __MSABI_LONG(0x00000010)
   3302 #define MF_MENUBARBREAK __MSABI_LONG(0x00000020)
   3303 #define MF_MENUBREAK __MSABI_LONG(0x00000040)
   3304 #define MF_UNHILITE __MSABI_LONG(0x00000000)
   3305 #define MF_HILITE __MSABI_LONG(0x00000080)
   3306 #define MF_DEFAULT __MSABI_LONG(0x00001000)
   3307 #define MF_SYSMENU __MSABI_LONG(0x00002000)
   3308 #define MF_HELP __MSABI_LONG(0x00004000)
   3309 #define MF_RIGHTJUSTIFY __MSABI_LONG(0x00004000)
   3310 #define MF_MOUSESELECT __MSABI_LONG(0x00008000)
   3311 #define MF_END __MSABI_LONG(0x00000080)
   3312 
   3313 #define MFT_STRING MF_STRING
   3314 #define MFT_BITMAP MF_BITMAP
   3315 #define MFT_MENUBARBREAK MF_MENUBARBREAK
   3316 #define MFT_MENUBREAK MF_MENUBREAK
   3317 #define MFT_OWNERDRAW MF_OWNERDRAW
   3318 #define MFT_RADIOCHECK __MSABI_LONG(0x00000200)
   3319 #define MFT_SEPARATOR MF_SEPARATOR
   3320 #define MFT_RIGHTORDER __MSABI_LONG(0x00002000)
   3321 #define MFT_RIGHTJUSTIFY MF_RIGHTJUSTIFY
   3322 
   3323 #define MFS_GRAYED __MSABI_LONG(0x00000003)
   3324 #define MFS_DISABLED MFS_GRAYED
   3325 #define MFS_CHECKED MF_CHECKED
   3326 #define MFS_HILITE MF_HILITE
   3327 #define MFS_ENABLED MF_ENABLED
   3328 #define MFS_UNCHECKED MF_UNCHECKED
   3329 #define MFS_UNHILITE MF_UNHILITE
   3330 #define MFS_DEFAULT MF_DEFAULT
   3331 
   3332   WINUSERAPI WINBOOL WINAPI CheckMenuRadioItem(HMENU hmenu,UINT first,UINT last,UINT check,UINT flags);
   3333 
   3334   typedef struct {
   3335     WORD versionNumber;
   3336     WORD offset;
   3337   } MENUITEMTEMPLATEHEADER,*PMENUITEMTEMPLATEHEADER;
   3338 
   3339   typedef struct {
   3340     WORD mtOption;
   3341     WORD mtID;
   3342     WCHAR mtString[1];
   3343   } MENUITEMTEMPLATE,*PMENUITEMTEMPLATE;
   3344 #define MF_END __MSABI_LONG(0x00000080)
   3345 #endif
   3346 
   3347 #ifndef NOSYSCOMMANDS
   3348 
   3349 #define SC_SIZE 0xF000
   3350 #define SC_MOVE 0xF010
   3351 #define SC_MINIMIZE 0xF020
   3352 #define SC_MAXIMIZE 0xF030
   3353 #define SC_NEXTWINDOW 0xF040
   3354 #define SC_PREVWINDOW 0xF050
   3355 #define SC_CLOSE 0xF060
   3356 #define SC_VSCROLL 0xF070
   3357 #define SC_HSCROLL 0xF080
   3358 #define SC_MOUSEMENU 0xF090
   3359 #define SC_KEYMENU 0xF100
   3360 #define SC_ARRANGE 0xF110
   3361 #define SC_RESTORE 0xF120
   3362 #define SC_TASKLIST 0xF130
   3363 #define SC_SCREENSAVE 0xF140
   3364 #define SC_HOTKEY 0xF150
   3365 #define SC_DEFAULT 0xF160
   3366 #define SC_MONITORPOWER 0xF170
   3367 #define SC_CONTEXTHELP 0xF180
   3368 #define SC_SEPARATOR 0xF00F
   3369 #define SC_ICON SC_MINIMIZE
   3370 #define SC_ZOOM SC_MAXIMIZE
   3371 #endif
   3372 
   3373 #define LoadBitmap __MINGW_NAME_AW(LoadBitmap)
   3374 #define LoadCursor __MINGW_NAME_AW(LoadCursor)
   3375 #define LoadCursorFromFile __MINGW_NAME_AW(LoadCursorFromFile)
   3376 
   3377   WINUSERAPI HBITMAP WINAPI LoadBitmapA(HINSTANCE hInstance,LPCSTR lpBitmapName);
   3378   WINUSERAPI HBITMAP WINAPI LoadBitmapW(HINSTANCE hInstance,LPCWSTR lpBitmapName);
   3379   WINUSERAPI HCURSOR WINAPI LoadCursorA(HINSTANCE hInstance,LPCSTR lpCursorName);
   3380   WINUSERAPI HCURSOR WINAPI LoadCursorW(HINSTANCE hInstance,LPCWSTR lpCursorName);
   3381   WINUSERAPI HCURSOR WINAPI LoadCursorFromFileA(LPCSTR lpFileName);
   3382   WINUSERAPI HCURSOR WINAPI LoadCursorFromFileW(LPCWSTR lpFileName);
   3383   WINUSERAPI HCURSOR WINAPI CreateCursor(HINSTANCE hInst,int xHotSpot,int yHotSpot,int nWidth,int nHeight,CONST VOID *pvANDPlane,CONST VOID *pvXORPlane);
   3384   WINUSERAPI WINBOOL WINAPI DestroyCursor(HCURSOR hCursor);
   3385 
   3386 #define CopyCursor(pcur) ((HCURSOR)CopyIcon((HICON)(pcur)))
   3387 
   3388 #define IDC_ARROW MAKEINTRESOURCE(32512)
   3389 #define IDC_IBEAM MAKEINTRESOURCE(32513)
   3390 #define IDC_WAIT MAKEINTRESOURCE(32514)
   3391 #define IDC_CROSS MAKEINTRESOURCE(32515)
   3392 #define IDC_UPARROW MAKEINTRESOURCE(32516)
   3393 #define IDC_SIZE MAKEINTRESOURCE(32640)
   3394 #define IDC_ICON MAKEINTRESOURCE(32641)
   3395 #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
   3396 #define IDC_SIZENESW MAKEINTRESOURCE(32643)
   3397 #define IDC_SIZEWE MAKEINTRESOURCE(32644)
   3398 #define IDC_SIZENS MAKEINTRESOURCE(32645)
   3399 #define IDC_SIZEALL MAKEINTRESOURCE(32646)
   3400 #define IDC_NO MAKEINTRESOURCE(32648)
   3401 #define IDC_HAND MAKEINTRESOURCE(32649)
   3402 #define IDC_APPSTARTING MAKEINTRESOURCE(32650)
   3403 #define IDC_HELP MAKEINTRESOURCE(32651)
   3404 
   3405   WINUSERAPI WINBOOL WINAPI SetSystemCursor(HCURSOR hcur,DWORD id);
   3406 
   3407   typedef struct _ICONINFO {
   3408     WINBOOL fIcon;
   3409     DWORD xHotspot;
   3410     DWORD yHotspot;
   3411     HBITMAP hbmMask;
   3412     HBITMAP hbmColor;
   3413   } ICONINFO;
   3414   typedef ICONINFO *PICONINFO;
   3415 
   3416 #define LoadIcon __MINGW_NAME_AW(LoadIcon)
   3417 #define PrivateExtractIcons __MINGW_NAME_AW(PrivateExtractIcons)
   3418 
   3419   WINUSERAPI HICON WINAPI LoadIconA(HINSTANCE hInstance,LPCSTR lpIconName);
   3420   WINUSERAPI HICON WINAPI LoadIconW(HINSTANCE hInstance,LPCWSTR lpIconName);
   3421   WINUSERAPI UINT WINAPI PrivateExtractIconsA(LPCSTR szFileName,int nIconIndex,int cxIcon,int cyIcon,HICON *phicon,UINT *piconid,UINT nIcons,UINT flags);
   3422   WINUSERAPI UINT WINAPI PrivateExtractIconsW(LPCWSTR szFileName,int nIconIndex,int cxIcon,int cyIcon,HICON *phicon,UINT *piconid,UINT nIcons,UINT flags);
   3423   WINUSERAPI HICON WINAPI CreateIcon(HINSTANCE hInstance,int nWidth,int nHeight,BYTE cPlanes,BYTE cBitsPixel,CONST BYTE *lpbANDbits,CONST BYTE *lpbXORbits);
   3424   WINUSERAPI WINBOOL WINAPI DestroyIcon(HICON hIcon);
   3425   WINUSERAPI int WINAPI LookupIconIdFromDirectory(PBYTE presbits,WINBOOL fIcon);
   3426   WINUSERAPI int WINAPI LookupIconIdFromDirectoryEx(PBYTE presbits,WINBOOL fIcon,int cxDesired,int cyDesired,UINT Flags);
   3427   WINUSERAPI HICON WINAPI CreateIconFromResource(PBYTE presbits,DWORD dwResSize,WINBOOL fIcon,DWORD dwVer);
   3428   WINUSERAPI HICON WINAPI CreateIconFromResourceEx(PBYTE presbits,DWORD dwResSize,WINBOOL fIcon,DWORD dwVer,int cxDesired,int cyDesired,UINT Flags);
   3429 
   3430   typedef struct tagCURSORSHAPE {
   3431     int xHotSpot;
   3432     int yHotSpot;
   3433     int cx;
   3434     int cy;
   3435     int cbWidth;
   3436     BYTE Planes;
   3437     BYTE BitsPixel;
   3438   } CURSORSHAPE,*LPCURSORSHAPE;
   3439 
   3440 #define IMAGE_BITMAP 0
   3441 #define IMAGE_ICON 1
   3442 #define IMAGE_CURSOR 2
   3443 #define IMAGE_ENHMETAFILE 3
   3444 
   3445 #define LR_DEFAULTCOLOR 0x0000
   3446 #define LR_MONOCHROME 0x0001
   3447 #define LR_COLOR 0x0002
   3448 #define LR_COPYRETURNORG 0x0004
   3449 #define LR_COPYDELETEORG 0x0008
   3450 #define LR_LOADFROMFILE 0x0010
   3451 #define LR_LOADTRANSPARENT 0x0020
   3452 #define LR_DEFAULTSIZE 0x0040
   3453 #define LR_VGACOLOR 0x0080
   3454 #define LR_LOADMAP3DCOLORS 0x1000
   3455 #define LR_CREATEDIBSECTION 0x2000
   3456 #define LR_COPYFROMRESOURCE 0x4000
   3457 #define LR_SHARED 0x8000
   3458 
   3459 #define LoadImage __MINGW_NAME_AW(LoadImage)
   3460 
   3461   WINUSERAPI HANDLE WINAPI LoadImageA(HINSTANCE hInst,LPCSTR name,UINT type,int cx,int cy,UINT fuLoad);
   3462   WINUSERAPI HANDLE WINAPI LoadImageW(HINSTANCE hInst,LPCWSTR name,UINT type,int cx,int cy,UINT fuLoad);
   3463   WINUSERAPI HANDLE WINAPI CopyImage(HANDLE h,UINT type,int cx,int cy,UINT flags);
   3464 
   3465 #define DI_MASK 0x0001
   3466 #define DI_IMAGE 0x0002
   3467 #define DI_NORMAL 0x0003
   3468 #define DI_COMPAT 0x0004
   3469 #define DI_DEFAULTSIZE 0x0008
   3470 #define DI_NOMIRROR 0x0010
   3471 
   3472   WINUSERAPI WINBOOL WINAPI DrawIconEx(HDC hdc,int xLeft,int yTop,HICON hIcon,int cxWidth,int cyWidth,UINT istepIfAniCur,HBRUSH hbrFlickerFreeDraw,UINT diFlags);
   3473   WINUSERAPI HICON WINAPI CreateIconIndirect(PICONINFO piconinfo);
   3474   WINUSERAPI HICON WINAPI CopyIcon(HICON hIcon);
   3475   WINUSERAPI WINBOOL WINAPI GetIconInfo(HICON hIcon,PICONINFO piconinfo);
   3476 
   3477 #define RES_ICON 1
   3478 #define RES_CURSOR 2
   3479 
   3480 #ifdef OEMRESOURCE
   3481 
   3482 #define OBM_CLOSE 32754
   3483 #define OBM_UPARROW 32753
   3484 #define OBM_DNARROW 32752
   3485 #define OBM_RGARROW 32751
   3486 #define OBM_LFARROW 32750
   3487 #define OBM_REDUCE 32749
   3488 #define OBM_ZOOM 32748
   3489 #define OBM_RESTORE 32747
   3490 #define OBM_REDUCED 32746
   3491 #define OBM_ZOOMD 32745
   3492 #define OBM_RESTORED 32744
   3493 #define OBM_UPARROWD 32743
   3494 #define OBM_DNARROWD 32742
   3495 #define OBM_RGARROWD 32741
   3496 #define OBM_LFARROWD 32740
   3497 #define OBM_MNARROW 32739
   3498 #define OBM_COMBO 32738
   3499 #define OBM_UPARROWI 32737
   3500 #define OBM_DNARROWI 32736
   3501 #define OBM_RGARROWI 32735
   3502 #define OBM_LFARROWI 32734
   3503 
   3504 #define OBM_OLD_CLOSE 32767
   3505 #define OBM_SIZE 32766
   3506 #define OBM_OLD_UPARROW 32765
   3507 #define OBM_OLD_DNARROW 32764
   3508 #define OBM_OLD_RGARROW 32763
   3509 #define OBM_OLD_LFARROW 32762
   3510 #define OBM_BTSIZE 32761
   3511 #define OBM_CHECK 32760
   3512 #define OBM_CHECKBOXES 32759
   3513 #define OBM_BTNCORNERS 32758
   3514 #define OBM_OLD_REDUCE 32757
   3515 #define OBM_OLD_ZOOM 32756
   3516 #define OBM_OLD_RESTORE 32755
   3517 
   3518 #define OCR_NORMAL 32512
   3519 #define OCR_IBEAM 32513
   3520 #define OCR_WAIT 32514
   3521 #define OCR_CROSS 32515
   3522 #define OCR_UP 32516
   3523 #define OCR_SIZE 32640
   3524 #define OCR_ICON 32641
   3525 #define OCR_SIZENWSE 32642
   3526 #define OCR_SIZENESW 32643
   3527 #define OCR_SIZEWE 32644
   3528 #define OCR_SIZENS 32645
   3529 #define OCR_SIZEALL 32646
   3530 #define OCR_ICOCUR 32647
   3531 #define OCR_NO 32648
   3532 #define OCR_HAND 32649
   3533 #define OCR_APPSTARTING 32650
   3534 
   3535 #define OIC_SAMPLE 32512
   3536 #define OIC_HAND 32513
   3537 #define OIC_QUES 32514
   3538 #define OIC_BANG 32515
   3539 #define OIC_NOTE 32516
   3540 #define OIC_WINLOGO 32517
   3541 #define OIC_WARNING OIC_BANG
   3542 #define OIC_ERROR OIC_HAND
   3543 #define OIC_INFORMATION OIC_NOTE
   3544 #endif
   3545 
   3546 #define ORD_LANGDRIVER 1
   3547 
   3548 #ifndef NOICONS
   3549 
   3550 #ifdef RC_INVOKED
   3551 #define IDI_APPLICATION 32512
   3552 #define IDI_HAND 32513
   3553 #define IDI_QUESTION 32514
   3554 #define IDI_EXCLAMATION 32515
   3555 #define IDI_ASTERISK 32516
   3556 #define IDI_WINLOGO 32517
   3557 #else
   3558 #define IDI_APPLICATION MAKEINTRESOURCE(32512)
   3559 #define IDI_HAND MAKEINTRESOURCE(32513)
   3560 #define IDI_QUESTION MAKEINTRESOURCE(32514)
   3561 #define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
   3562 #define IDI_ASTERISK MAKEINTRESOURCE(32516)
   3563 #define IDI_WINLOGO MAKEINTRESOURCE(32517)
   3564 #endif
   3565 
   3566 #define IDI_WARNING IDI_EXCLAMATION
   3567 #define IDI_ERROR IDI_HAND
   3568 #define IDI_INFORMATION IDI_ASTERISK
   3569 #endif
   3570 
   3571 #define LoadString __MINGW_NAME_AW(LoadString)
   3572 
   3573   WINUSERAPI int WINAPI LoadStringA(HINSTANCE hInstance,UINT uID,LPSTR lpBuffer,int cchBufferMax);
   3574   WINUSERAPI int WINAPI LoadStringW(HINSTANCE hInstance,UINT uID,LPWSTR lpBuffer,int cchBufferMax);
   3575 
   3576 #define IDOK 1
   3577 #define IDCANCEL 2
   3578 #define IDABORT 3
   3579 #define IDRETRY 4
   3580 #define IDIGNORE 5
   3581 #define IDYES 6
   3582 #define IDNO 7
   3583 #define IDCLOSE 8
   3584 #define IDHELP 9
   3585 #define IDTRYAGAIN 10
   3586 #define IDCONTINUE 11
   3587 
   3588 #ifndef IDTIMEOUT
   3589 #define IDTIMEOUT 32000
   3590 #endif
   3591 
   3592 #ifndef NOCTLMGR
   3593 
   3594 #ifndef NOWINSTYLES
   3595 #define ES_LEFT __MSABI_LONG(0x0000)
   3596 #define ES_CENTER __MSABI_LONG(0x0001)
   3597 #define ES_RIGHT __MSABI_LONG(0x0002)
   3598 #define ES_MULTILINE __MSABI_LONG(0x0004)
   3599 #define ES_UPPERCASE __MSABI_LONG(0x0008)
   3600 #define ES_LOWERCASE __MSABI_LONG(0x0010)
   3601 #define ES_PASSWORD __MSABI_LONG(0x0020)
   3602 #define ES_AUTOVSCROLL __MSABI_LONG(0x0040)
   3603 #define ES_AUTOHSCROLL __MSABI_LONG(0x0080)
   3604 #define ES_NOHIDESEL __MSABI_LONG(0x0100)
   3605 #define ES_OEMCONVERT __MSABI_LONG(0x0400)
   3606 #define ES_READONLY __MSABI_LONG(0x0800)
   3607 #define ES_WANTRETURN __MSABI_LONG(0x1000)
   3608 #define ES_NUMBER __MSABI_LONG(0x2000)
   3609 #endif
   3610 
   3611 #define EN_SETFOCUS 0x0100
   3612 #define EN_KILLFOCUS 0x0200
   3613 #define EN_CHANGE 0x0300
   3614 #define EN_UPDATE 0x0400
   3615 #define EN_ERRSPACE 0x0500
   3616 #define EN_MAXTEXT 0x0501
   3617 #define EN_HSCROLL 0x0601
   3618 #define EN_VSCROLL 0x0602
   3619 #define EN_ALIGN_LTR_EC 0x0700
   3620 #define EN_ALIGN_RTL_EC 0x0701
   3621 
   3622 #define EC_LEFTMARGIN 0x0001
   3623 #define EC_RIGHTMARGIN 0x0002
   3624 #define EC_USEFONTINFO 0xffff
   3625 
   3626 #define EMSIS_COMPOSITIONSTRING 0x0001
   3627 
   3628 #define EIMES_GETCOMPSTRATONCE 0x0001
   3629 #define EIMES_CANCELCOMPSTRINFOCUS 0x0002
   3630 #define EIMES_COMPLETECOMPSTRKILLFOCUS 0x0004
   3631 
   3632 #ifndef NOWINMESSAGES
   3633 
   3634 #define EM_GETSEL 0x00B0
   3635 #define EM_SETSEL 0x00B1
   3636 #define EM_GETRECT 0x00B2
   3637 #define EM_SETRECT 0x00B3
   3638 #define EM_SETRECTNP 0x00B4
   3639 #define EM_SCROLL 0x00B5
   3640 #define EM_LINESCROLL 0x00B6
   3641 #define EM_SCROLLCARET 0x00B7
   3642 #define EM_GETMODIFY 0x00B8
   3643 #define EM_SETMODIFY 0x00B9
   3644 #define EM_GETLINECOUNT 0x00BA
   3645 #define EM_LINEINDEX 0x00BB
   3646 #define EM_SETHANDLE 0x00BC
   3647 #define EM_GETHANDLE 0x00BD
   3648 #define EM_GETTHUMB 0x00BE
   3649 #define EM_LINELENGTH 0x00C1
   3650 #define EM_REPLACESEL 0x00C2
   3651 #define EM_GETLINE 0x00C4
   3652 #define EM_LIMITTEXT 0x00C5
   3653 #define EM_CANUNDO 0x00C6
   3654 #define EM_UNDO 0x00C7
   3655 #define EM_FMTLINES 0x00C8
   3656 #define EM_LINEFROMCHAR 0x00C9
   3657 #define EM_SETTABSTOPS 0x00CB
   3658 #define EM_SETPASSWORDCHAR 0x00CC
   3659 #define EM_EMPTYUNDOBUFFER 0x00CD
   3660 #define EM_GETFIRSTVISIBLELINE 0x00CE
   3661 #define EM_SETREADONLY 0x00CF
   3662 #define EM_SETWORDBREAKPROC 0x00D0
   3663 #define EM_GETWORDBREAKPROC 0x00D1
   3664 #define EM_GETPASSWORDCHAR 0x00D2
   3665 #define EM_SETMARGINS 0x00D3
   3666 #define EM_GETMARGINS 0x00D4
   3667 #define EM_SETLIMITTEXT EM_LIMITTEXT
   3668 #define EM_GETLIMITTEXT 0x00D5
   3669 #define EM_POSFROMCHAR 0x00D6
   3670 #define EM_CHARFROMPOS 0x00D7
   3671 #define EM_SETIMESTATUS 0x00D8
   3672 #define EM_GETIMESTATUS 0x00D9
   3673 #endif
   3674 
   3675 #define WB_LEFT 0
   3676 #define WB_RIGHT 1
   3677 #define WB_ISDELIMITER 2
   3678 
   3679 #define BS_PUSHBUTTON __MSABI_LONG(0x00000000)
   3680 #define BS_DEFPUSHBUTTON __MSABI_LONG(0x00000001)
   3681 #define BS_CHECKBOX __MSABI_LONG(0x00000002)
   3682 #define BS_AUTOCHECKBOX __MSABI_LONG(0x00000003)
   3683 #define BS_RADIOBUTTON __MSABI_LONG(0x00000004)
   3684 #define BS_3STATE __MSABI_LONG(0x00000005)
   3685 #define BS_AUTO3STATE __MSABI_LONG(0x00000006)
   3686 #define BS_GROUPBOX __MSABI_LONG(0x00000007)
   3687 #define BS_USERBUTTON __MSABI_LONG(0x00000008)
   3688 #define BS_AUTORADIOBUTTON __MSABI_LONG(0x00000009)
   3689 #define BS_PUSHBOX __MSABI_LONG(0x0000000A)
   3690 #define BS_OWNERDRAW __MSABI_LONG(0x0000000B)
   3691 #define BS_TYPEMASK __MSABI_LONG(0x0000000F)
   3692 #define BS_LEFTTEXT __MSABI_LONG(0x00000020)
   3693 #define BS_TEXT __MSABI_LONG(0x00000000)
   3694 #define BS_ICON __MSABI_LONG(0x00000040)
   3695 #define BS_BITMAP __MSABI_LONG(0x00000080)
   3696 #define BS_LEFT __MSABI_LONG(0x00000100)
   3697 #define BS_RIGHT __MSABI_LONG(0x00000200)
   3698 #define BS_CENTER __MSABI_LONG(0x00000300)
   3699 #define BS_TOP __MSABI_LONG(0x00000400)
   3700 #define BS_BOTTOM __MSABI_LONG(0x00000800)
   3701 #define BS_VCENTER __MSABI_LONG(0x00000C00)
   3702 #define BS_PUSHLIKE __MSABI_LONG(0x00001000)
   3703 #define BS_MULTILINE __MSABI_LONG(0x00002000)
   3704 #define BS_NOTIFY __MSABI_LONG(0x00004000)
   3705 #define BS_FLAT __MSABI_LONG(0x00008000)
   3706 #define BS_RIGHTBUTTON BS_LEFTTEXT
   3707 
   3708 #define BN_CLICKED 0
   3709 #define BN_PAINT 1
   3710 #define BN_HILITE 2
   3711 #define BN_UNHILITE 3
   3712 #define BN_DISABLE 4
   3713 #define BN_DOUBLECLICKED 5
   3714 #define BN_PUSHED BN_HILITE
   3715 #define BN_UNPUSHED BN_UNHILITE
   3716 #define BN_DBLCLK BN_DOUBLECLICKED
   3717 #define BN_SETFOCUS 6
   3718 #define BN_KILLFOCUS 7
   3719 
   3720 #define BM_GETCHECK 0x00F0
   3721 #define BM_SETCHECK 0x00F1
   3722 #define BM_GETSTATE 0x00F2
   3723 #define BM_SETSTATE 0x00F3
   3724 #define BM_SETSTYLE 0x00F4
   3725 #define BM_CLICK 0x00F5
   3726 #define BM_GETIMAGE 0x00F6
   3727 #define BM_SETIMAGE 0x00F7
   3728 
   3729 #define BST_UNCHECKED 0x0000
   3730 #define BST_CHECKED 0x0001
   3731 #define BST_INDETERMINATE 0x0002
   3732 #define BST_PUSHED 0x0004
   3733 #define BST_FOCUS 0x0008
   3734 
   3735 #define SS_LEFT __MSABI_LONG(0x00000000)
   3736 #define SS_CENTER __MSABI_LONG(0x00000001)
   3737 #define SS_RIGHT __MSABI_LONG(0x00000002)
   3738 #define SS_ICON __MSABI_LONG(0x00000003)
   3739 #define SS_BLACKRECT __MSABI_LONG(0x00000004)
   3740 #define SS_GRAYRECT __MSABI_LONG(0x00000005)
   3741 #define SS_WHITERECT __MSABI_LONG(0x00000006)
   3742 #define SS_BLACKFRAME __MSABI_LONG(0x00000007)
   3743 #define SS_GRAYFRAME __MSABI_LONG(0x00000008)
   3744 #define SS_WHITEFRAME __MSABI_LONG(0x00000009)
   3745 #define SS_USERITEM __MSABI_LONG(0x0000000A)
   3746 #define SS_SIMPLE __MSABI_LONG(0x0000000B)
   3747 #define SS_LEFTNOWORDWRAP __MSABI_LONG(0x0000000C)
   3748 #define SS_OWNERDRAW __MSABI_LONG(0x0000000D)
   3749 #define SS_BITMAP __MSABI_LONG(0x0000000E)
   3750 #define SS_ENHMETAFILE __MSABI_LONG(0x0000000F)
   3751 #define SS_ETCHEDHORZ __MSABI_LONG(0x00000010)
   3752 #define SS_ETCHEDVERT __MSABI_LONG(0x00000011)
   3753 #define SS_ETCHEDFRAME __MSABI_LONG(0x00000012)
   3754 #define SS_TYPEMASK __MSABI_LONG(0x0000001F)
   3755 #define SS_REALSIZECONTROL __MSABI_LONG(0x00000040)
   3756 #define SS_NOPREFIX __MSABI_LONG(0x00000080)
   3757 #define SS_NOTIFY __MSABI_LONG(0x00000100)
   3758 #define SS_CENTERIMAGE __MSABI_LONG(0x00000200)
   3759 #define SS_RIGHTJUST __MSABI_LONG(0x00000400)
   3760 #define SS_REALSIZEIMAGE __MSABI_LONG(0x00000800)
   3761 #define SS_SUNKEN __MSABI_LONG(0x00001000)
   3762 #define SS_EDITCONTROL __MSABI_LONG(0x00002000)
   3763 #define SS_ENDELLIPSIS __MSABI_LONG(0x00004000)
   3764 #define SS_PATHELLIPSIS __MSABI_LONG(0x00008000)
   3765 #define SS_WORDELLIPSIS __MSABI_LONG(0x0000C000)
   3766 #define SS_ELLIPSISMASK __MSABI_LONG(0x0000C000)
   3767 
   3768 #ifndef NOWINMESSAGES
   3769 
   3770 #define STM_SETICON 0x0170
   3771 #define STM_GETICON 0x0171
   3772 #define STM_SETIMAGE 0x0172
   3773 #define STM_GETIMAGE 0x0173
   3774 #define STN_CLICKED 0
   3775 #define STN_DBLCLK 1
   3776 #define STN_ENABLE 2
   3777 #define STN_DISABLE 3
   3778 #define STM_MSGMAX 0x0174
   3779 #endif
   3780 
   3781 #define WC_DIALOG (MAKEINTATOM(0x8002))
   3782 
   3783 #define DWL_MSGRESULT 0
   3784 #define DWL_DLGPROC 4
   3785 #define DWL_USER 8
   3786 
   3787 #ifdef _WIN64
   3788 
   3789 #undef DWL_MSGRESULT
   3790 #undef DWL_DLGPROC
   3791 #undef DWL_USER
   3792 #endif
   3793 
   3794 #define DWLP_MSGRESULT 0
   3795 #define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT)
   3796 #define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC)
   3797 
   3798 #ifndef NOMSG
   3799 
   3800 #define IsDialogMessage __MINGW_NAME_AW(IsDialogMessage)
   3801 
   3802   WINUSERAPI WINBOOL WINAPI IsDialogMessageA(HWND hDlg,LPMSG lpMsg);
   3803   WINUSERAPI WINBOOL WINAPI IsDialogMessageW(HWND hDlg,LPMSG lpMsg);
   3804 #endif
   3805 
   3806 #define DlgDirList __MINGW_NAME_AW(DlgDirList)
   3807 #define DlgDirSelectEx __MINGW_NAME_AW(DlgDirSelectEx)
   3808 #define DlgDirListComboBox __MINGW_NAME_AW(DlgDirListComboBox)
   3809 #define DlgDirSelectComboBoxEx __MINGW_NAME_AW(DlgDirSelectComboBoxEx)
   3810 
   3811   WINUSERAPI WINBOOL WINAPI MapDialogRect(HWND hDlg,LPRECT lpRect);
   3812   WINUSERAPI int WINAPI DlgDirListA(HWND hDlg,LPSTR lpPathSpec,int nIDListBox,int nIDStaticPath,UINT uFileType);
   3813   WINUSERAPI int WINAPI DlgDirListW(HWND hDlg,LPWSTR lpPathSpec,int nIDListBox,int nIDStaticPath,UINT uFileType);
   3814 
   3815 #define DDL_READWRITE 0x0000
   3816 #define DDL_READONLY 0x0001
   3817 #define DDL_HIDDEN 0x0002
   3818 #define DDL_SYSTEM 0x0004
   3819 #define DDL_DIRECTORY 0x0010
   3820 #define DDL_ARCHIVE 0x0020
   3821 
   3822 #define DDL_POSTMSGS 0x2000
   3823 #define DDL_DRIVES 0x4000
   3824 #define DDL_EXCLUSIVE 0x8000
   3825 
   3826   WINUSERAPI WINBOOL WINAPI DlgDirSelectExA(HWND hwndDlg,LPSTR lpString,int chCount,int idListBox);
   3827   WINUSERAPI WINBOOL WINAPI DlgDirSelectExW(HWND hwndDlg,LPWSTR lpString,int chCount,int idListBox);
   3828   WINUSERAPI int WINAPI DlgDirListComboBoxA(HWND hDlg,LPSTR lpPathSpec,int nIDComboBox,int nIDStaticPath,UINT uFiletype);
   3829   WINUSERAPI int WINAPI DlgDirListComboBoxW(HWND hDlg,LPWSTR lpPathSpec,int nIDComboBox,int nIDStaticPath,UINT uFiletype);
   3830   WINUSERAPI WINBOOL WINAPI DlgDirSelectComboBoxExA(HWND hwndDlg,LPSTR lpString,int cchOut,int idComboBox);
   3831   WINUSERAPI WINBOOL WINAPI DlgDirSelectComboBoxExW(HWND hwndDlg,LPWSTR lpString,int cchOut,int idComboBox);
   3832 
   3833 #define DS_ABSALIGN __MSABI_LONG(0x01)
   3834 #define DS_SYSMODAL __MSABI_LONG(0x02)
   3835 #define DS_LOCALEDIT __MSABI_LONG(0x20)
   3836 #define DS_SETFONT __MSABI_LONG(0x40)
   3837 #define DS_MODALFRAME __MSABI_LONG(0x80)
   3838 #define DS_NOIDLEMSG __MSABI_LONG(0x100)
   3839 #define DS_SETFOREGROUND __MSABI_LONG(0x200)
   3840 
   3841 #define DS_3DLOOK __MSABI_LONG(0x0004)
   3842 #define DS_FIXEDSYS __MSABI_LONG(0x0008)
   3843 #define DS_NOFAILCREATE __MSABI_LONG(0x0010)
   3844 #define DS_CONTROL __MSABI_LONG(0x0400)
   3845 #define DS_CENTER __MSABI_LONG(0x0800)
   3846 #define DS_CENTERMOUSE __MSABI_LONG(0x1000)
   3847 #define DS_CONTEXTHELP __MSABI_LONG(0x2000)
   3848 
   3849 #define DS_SHELLFONT (DS_SETFONT | DS_FIXEDSYS)
   3850 
   3851 #if(_WIN32_WCE >= 0x0500)
   3852 #define DS_USEPIXELS __MSABI_LONG(0x8000)
   3853 #endif
   3854 
   3855 #define DM_GETDEFID (WM_USER+0)
   3856 #define DM_SETDEFID (WM_USER+1)
   3857 #define DM_REPOSITION (WM_USER+2)
   3858 
   3859 #define DC_HASDEFID 0x534B
   3860 
   3861 #define DLGC_WANTARROWS 0x0001
   3862 #define DLGC_WANTTAB 0x0002
   3863 #define DLGC_WANTALLKEYS 0x0004
   3864 #define DLGC_WANTMESSAGE 0x0004
   3865 #define DLGC_HASSETSEL 0x0008
   3866 #define DLGC_DEFPUSHBUTTON 0x0010
   3867 #define DLGC_UNDEFPUSHBUTTON 0x0020
   3868 #define DLGC_RADIOBUTTON 0x0040
   3869 #define DLGC_WANTCHARS 0x0080
   3870 #define DLGC_STATIC 0x0100
   3871 #define DLGC_BUTTON 0x2000
   3872 
   3873 #define LB_CTLCODE __MSABI_LONG(0)
   3874 
   3875 #define LB_OKAY 0
   3876 #define LB_ERR (-1)
   3877 #define LB_ERRSPACE (-2)
   3878 
   3879 #define LBN_ERRSPACE (-2)
   3880 #define LBN_SELCHANGE 1
   3881 #define LBN_DBLCLK 2
   3882 #define LBN_SELCANCEL 3
   3883 #define LBN_SETFOCUS 4
   3884 #define LBN_KILLFOCUS 5
   3885 
   3886 #ifndef NOWINMESSAGES
   3887 
   3888 #define LB_ADDSTRING 0x0180
   3889 #define LB_INSERTSTRING 0x0181
   3890 #define LB_DELETESTRING 0x0182
   3891 #define LB_SELITEMRANGEEX 0x0183
   3892 #define LB_RESETCONTENT 0x0184
   3893 #define LB_SETSEL 0x0185
   3894 #define LB_SETCURSEL 0x0186
   3895 #define LB_GETSEL 0x0187
   3896 #define LB_GETCURSEL 0x0188
   3897 #define LB_GETTEXT 0x0189
   3898 #define LB_GETTEXTLEN 0x018A
   3899 #define LB_GETCOUNT 0x018B
   3900 #define LB_SELECTSTRING 0x018C
   3901 #define LB_DIR 0x018D
   3902 #define LB_GETTOPINDEX 0x018E
   3903 #define LB_FINDSTRING 0x018F
   3904 #define LB_GETSELCOUNT 0x0190
   3905 #define LB_GETSELITEMS 0x0191
   3906 #define LB_SETTABSTOPS 0x0192
   3907 #define LB_GETHORIZONTALEXTENT 0x0193
   3908 #define LB_SETHORIZONTALEXTENT 0x0194
   3909 #define LB_SETCOLUMNWIDTH 0x0195
   3910 #define LB_ADDFILE 0x0196
   3911 #define LB_SETTOPINDEX 0x0197
   3912 #define LB_GETITEMRECT 0x0198
   3913 #define LB_GETITEMDATA 0x0199
   3914 #define LB_SETITEMDATA 0x019A
   3915 #define LB_SELITEMRANGE 0x019B
   3916 #define LB_SETANCHORINDEX 0x019C
   3917 #define LB_GETANCHORINDEX 0x019D
   3918 #define LB_SETCARETINDEX 0x019E
   3919 #define LB_GETCARETINDEX 0x019F
   3920 #define LB_SETITEMHEIGHT 0x01A0
   3921 #define LB_GETITEMHEIGHT 0x01A1
   3922 #define LB_FINDSTRINGEXACT 0x01A2
   3923 #define LB_SETLOCALE 0x01A5
   3924 #define LB_GETLOCALE 0x01A6
   3925 #define LB_SETCOUNT 0x01A7
   3926 #define LB_INITSTORAGE 0x01A8
   3927 #define LB_ITEMFROMPOINT 0x01A9
   3928 #if(_WIN32_WCE >= 0x0400)
   3929 #define LB_MULTIPLEADDSTRING 0x01B1
   3930 #endif
   3931 #define LB_GETLISTBOXINFO 0x01B2
   3932 #define LB_MSGMAX 0x01B3
   3933 #endif
   3934 
   3935 #ifndef NOWINSTYLES
   3936 
   3937 #define LBS_NOTIFY __MSABI_LONG(0x0001)
   3938 #define LBS_SORT __MSABI_LONG(0x0002)
   3939 #define LBS_NOREDRAW __MSABI_LONG(0x0004)
   3940 #define LBS_MULTIPLESEL __MSABI_LONG(0x0008)
   3941 #define LBS_OWNERDRAWFIXED __MSABI_LONG(0x0010)
   3942 #define LBS_OWNERDRAWVARIABLE __MSABI_LONG(0x0020)
   3943 #define LBS_HASSTRINGS __MSABI_LONG(0x0040)
   3944 #define LBS_USETABSTOPS __MSABI_LONG(0x0080)
   3945 #define LBS_NOINTEGRALHEIGHT __MSABI_LONG(0x0100)
   3946 #define LBS_MULTICOLUMN __MSABI_LONG(0x0200)
   3947 #define LBS_WANTKEYBOARDINPUT __MSABI_LONG(0x0400)
   3948 #define LBS_EXTENDEDSEL __MSABI_LONG(0x0800)
   3949 #define LBS_DISABLENOSCROLL __MSABI_LONG(0x1000)
   3950 #define LBS_NODATA __MSABI_LONG(0x2000)
   3951 #define LBS_NOSEL __MSABI_LONG(0x4000)
   3952 #define LBS_COMBOBOX __MSABI_LONG(0x8000)
   3953 
   3954 #define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
   3955 #endif
   3956 
   3957 #define CB_OKAY 0
   3958 #define CB_ERR (-1)
   3959 #define CB_ERRSPACE (-2)
   3960 
   3961 #define CBN_ERRSPACE (-1)
   3962 #define CBN_SELCHANGE 1
   3963 #define CBN_DBLCLK 2
   3964 #define CBN_SETFOCUS 3
   3965 #define CBN_KILLFOCUS 4
   3966 #define CBN_EDITCHANGE 5
   3967 #define CBN_EDITUPDATE 6
   3968 #define CBN_DROPDOWN 7
   3969 #define CBN_CLOSEUP 8
   3970 #define CBN_SELENDOK 9
   3971 #define CBN_SELENDCANCEL 10
   3972 
   3973 #ifndef NOWINSTYLES
   3974 
   3975 #define CBS_SIMPLE __MSABI_LONG(0x0001)
   3976 #define CBS_DROPDOWN __MSABI_LONG(0x0002)
   3977 #define CBS_DROPDOWNLIST __MSABI_LONG(0x0003)
   3978 #define CBS_OWNERDRAWFIXED __MSABI_LONG(0x0010)
   3979 #define CBS_OWNERDRAWVARIABLE __MSABI_LONG(0x0020)
   3980 #define CBS_AUTOHSCROLL __MSABI_LONG(0x0040)
   3981 #define CBS_OEMCONVERT __MSABI_LONG(0x0080)
   3982 #define CBS_SORT __MSABI_LONG(0x0100)
   3983 #define CBS_HASSTRINGS __MSABI_LONG(0x0200)
   3984 #define CBS_NOINTEGRALHEIGHT __MSABI_LONG(0x0400)
   3985 #define CBS_DISABLENOSCROLL __MSABI_LONG(0x0800)
   3986 #define CBS_UPPERCASE __MSABI_LONG(0x2000)
   3987 #define CBS_LOWERCASE __MSABI_LONG(0x4000)
   3988 #endif
   3989 
   3990 #ifndef NOWINMESSAGES
   3991 #define CB_GETEDITSEL 0x0140
   3992 #define CB_LIMITTEXT 0x0141
   3993 #define CB_SETEDITSEL 0x0142
   3994 #define CB_ADDSTRING 0x0143
   3995 #define CB_DELETESTRING 0x0144
   3996 #define CB_DIR 0x0145
   3997 #define CB_GETCOUNT 0x0146
   3998 #define CB_GETCURSEL 0x0147
   3999 #define CB_GETLBTEXT 0x0148
   4000 #define CB_GETLBTEXTLEN 0x0149
   4001 #define CB_INSERTSTRING 0x014A
   4002 #define CB_RESETCONTENT 0x014B
   4003 #define CB_FINDSTRING 0x014C
   4004 #define CB_SELECTSTRING 0x014D
   4005 #define CB_SETCURSEL 0x014E
   4006 #define CB_SHOWDROPDOWN 0x014F
   4007 #define CB_GETITEMDATA 0x0150
   4008 #define CB_SETITEMDATA 0x0151
   4009 #define CB_GETDROPPEDCONTROLRECT 0x0152
   4010 #define CB_SETITEMHEIGHT 0x0153
   4011 #define CB_GETITEMHEIGHT 0x0154
   4012 #define CB_SETEXTENDEDUI 0x0155
   4013 #define CB_GETEXTENDEDUI 0x0156
   4014 #define CB_GETDROPPEDSTATE 0x0157
   4015 #define CB_FINDSTRINGEXACT 0x0158
   4016 #define CB_SETLOCALE 0x0159
   4017 #define CB_GETLOCALE 0x015A
   4018 #define CB_GETTOPINDEX 0x015b
   4019 #define CB_SETTOPINDEX 0x015c
   4020 #define CB_GETHORIZONTALEXTENT 0x015d
   4021 #define CB_SETHORIZONTALEXTENT 0x015e
   4022 #define CB_GETDROPPEDWIDTH 0x015f
   4023 #define CB_SETDROPPEDWIDTH 0x0160
   4024 #define CB_INITSTORAGE 0x0161
   4025 #if(_WIN32_WCE >= 0x0400)
   4026 #define CB_MULTIPLEADDSTRING 0x0163
   4027 #endif
   4028 #define CB_GETCOMBOBOXINFO 0x0164
   4029 #define CB_MSGMAX 0x0165
   4030 #endif
   4031 
   4032 #ifndef NOWINSTYLES
   4033 
   4034 #define SBS_HORZ __MSABI_LONG(0x0000)
   4035 #define SBS_VERT __MSABI_LONG(0x0001)
   4036 #define SBS_TOPALIGN __MSABI_LONG(0x0002)
   4037 #define SBS_LEFTALIGN __MSABI_LONG(0x0002)
   4038 #define SBS_BOTTOMALIGN __MSABI_LONG(0x0004)
   4039 #define SBS_RIGHTALIGN __MSABI_LONG(0x0004)
   4040 #define SBS_SIZEBOXTOPLEFTALIGN __MSABI_LONG(0x0002)
   4041 #define SBS_SIZEBOXBOTTOMRIGHTALIGN __MSABI_LONG(0x0004)
   4042 #define SBS_SIZEBOX __MSABI_LONG(0x0008)
   4043 #define SBS_SIZEGRIP __MSABI_LONG(0x0010)
   4044 #endif
   4045 
   4046 #ifndef NOWINMESSAGES
   4047 #define SBM_SETPOS 0x00E0
   4048 #define SBM_GETPOS 0x00E1
   4049 #define SBM_SETRANGE 0x00E2
   4050 #define SBM_SETRANGEREDRAW 0x00E6
   4051 #define SBM_GETRANGE 0x00E3
   4052 #define SBM_ENABLE_ARROWS 0x00E4
   4053 #define SBM_SETSCROLLINFO 0x00E9
   4054 #define SBM_GETSCROLLINFO 0x00EA
   4055 #define SBM_GETSCROLLBARINFO 0x00EB
   4056 
   4057 #define SIF_RANGE 0x0001
   4058 #define SIF_PAGE 0x0002
   4059 #define SIF_POS 0x0004
   4060 #define SIF_DISABLENOSCROLL 0x0008
   4061 #define SIF_TRACKPOS 0x0010
   4062 #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
   4063 
   4064   typedef struct tagSCROLLINFO {
   4065     UINT cbSize;
   4066     UINT fMask;
   4067     int nMin;
   4068     int nMax;
   4069     UINT nPage;
   4070     int nPos;
   4071     int nTrackPos;
   4072   } SCROLLINFO,*LPSCROLLINFO;
   4073   typedef SCROLLINFO CONST *LPCSCROLLINFO;
   4074 
   4075   WINUSERAPI int WINAPI SetScrollInfo(HWND hwnd,int nBar,LPCSCROLLINFO lpsi,WINBOOL redraw);
   4076   WINUSERAPI WINBOOL WINAPI GetScrollInfo(HWND hwnd,int nBar,LPSCROLLINFO lpsi);
   4077 #endif
   4078 #endif
   4079 
   4080 #ifndef NOMDI
   4081 
   4082 #define MDIS_ALLCHILDSTYLES 0x0001
   4083 
   4084 #define MDITILE_VERTICAL 0x0000
   4085 #define MDITILE_HORIZONTAL 0x0001
   4086 #define MDITILE_SKIPDISABLED 0x0002
   4087 #define MDITILE_ZORDER 0x0004
   4088 
   4089   typedef struct tagMDICREATESTRUCTA {
   4090     LPCSTR szClass;
   4091     LPCSTR szTitle;
   4092     HANDLE hOwner;
   4093     int x;
   4094     int y;
   4095     int cx;
   4096     int cy;
   4097     DWORD style;
   4098     LPARAM lParam;
   4099   } MDICREATESTRUCTA,*LPMDICREATESTRUCTA;
   4100 
   4101   typedef struct tagMDICREATESTRUCTW {
   4102     LPCWSTR szClass;
   4103     LPCWSTR szTitle;
   4104     HANDLE hOwner;
   4105     int x;
   4106     int y;
   4107     int cx;
   4108     int cy;
   4109     DWORD style;
   4110     LPARAM lParam;
   4111   } MDICREATESTRUCTW,*LPMDICREATESTRUCTW;
   4112 
   4113   __MINGW_TYPEDEF_AW(MDICREATESTRUCT)
   4114   __MINGW_TYPEDEF_AW(LPMDICREATESTRUCT)
   4115 
   4116   typedef struct tagCLIENTCREATESTRUCT {
   4117     HANDLE hWindowMenu;
   4118     UINT idFirstChild;
   4119   } CLIENTCREATESTRUCT,*LPCLIENTCREATESTRUCT;
   4120 
   4121 #define DefFrameProc __MINGW_NAME_AW(DefFrameProc)
   4122 #define DefMDIChildProc __MINGW_NAME_AW(DefMDIChildProc)
   4123 #define CreateMDIWindow __MINGW_NAME_AW(CreateMDIWindow)
   4124 
   4125   WINUSERAPI LRESULT WINAPI DefFrameProcA(HWND hWnd,HWND hWndMDIClient,UINT uMsg,WPARAM wParam,LPARAM lParam);
   4126   WINUSERAPI LRESULT WINAPI DefFrameProcW(HWND hWnd,HWND hWndMDIClient,UINT uMsg,WPARAM wParam,LPARAM lParam);
   4127   WINUSERAPI LRESULT WINAPI DefMDIChildProcA(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
   4128   WINUSERAPI LRESULT WINAPI DefMDIChildProcW(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
   4129 
   4130 #ifndef NOMSG
   4131   WINUSERAPI WINBOOL WINAPI TranslateMDISysAccel(HWND hWndClient,LPMSG lpMsg);
   4132 #endif
   4133 
   4134   WINUSERAPI UINT WINAPI ArrangeIconicWindows(HWND hWnd);
   4135   WINUSERAPI HWND WINAPI CreateMDIWindowA(LPCSTR lpClassName,LPCSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HINSTANCE hInstance,LPARAM lParam);
   4136   WINUSERAPI HWND WINAPI CreateMDIWindowW(LPCWSTR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HINSTANCE hInstance,LPARAM lParam);
   4137   WINUSERAPI WORD WINAPI TileWindows(HWND hwndParent,UINT wHow,CONST RECT *lpRect,UINT cKids,const HWND *lpKids);
   4138   WINUSERAPI WORD WINAPI CascadeWindows(HWND hwndParent,UINT wHow,CONST RECT *lpRect,UINT cKids,const HWND *lpKids);
   4139 #endif
   4140 #endif
   4141 
   4142 #ifndef NOHELP
   4143 
   4144   typedef DWORD HELPPOLY;
   4145   typedef struct tagMULTIKEYHELPA {
   4146     DWORD mkSize;
   4147     CHAR mkKeylist;
   4148     CHAR szKeyphrase[1];
   4149   } MULTIKEYHELPA,*PMULTIKEYHELPA,*LPMULTIKEYHELPA;
   4150 
   4151   typedef struct tagMULTIKEYHELPW {
   4152     DWORD mkSize;
   4153     WCHAR mkKeylist;
   4154     WCHAR szKeyphrase[1];
   4155   } MULTIKEYHELPW,*PMULTIKEYHELPW,*LPMULTIKEYHELPW;
   4156 
   4157   __MINGW_TYPEDEF_AW(MULTIKEYHELP)
   4158   __MINGW_TYPEDEF_AW(PMULTIKEYHELP)
   4159   __MINGW_TYPEDEF_AW(LPMULTIKEYHELP)
   4160 
   4161   typedef struct tagHELPWININFOA {
   4162     int wStructSize;
   4163     int x;
   4164     int y;
   4165     int dx;
   4166     int dy;
   4167     int wMax;
   4168     CHAR rgchMember[2];
   4169   } HELPWININFOA,*PHELPWININFOA,*LPHELPWININFOA;
   4170 
   4171   typedef struct tagHELPWININFOW {
   4172     int wStructSize;
   4173     int x;
   4174     int y;
   4175     int dx;
   4176     int dy;
   4177     int wMax;
   4178     WCHAR rgchMember[2];
   4179   } HELPWININFOW,*PHELPWININFOW,*LPHELPWININFOW;
   4180 
   4181   __MINGW_TYPEDEF_AW(HELPWININFO)
   4182   __MINGW_TYPEDEF_AW(PHELPWININFO)
   4183   __MINGW_TYPEDEF_AW(LPHELPWININFO)
   4184 
   4185 #define HELP_CONTEXT 0x0001
   4186 #define HELP_QUIT 0x0002
   4187 #define HELP_INDEX 0x0003
   4188 #define HELP_CONTENTS 0x0003
   4189 #define HELP_HELPONHELP 0x0004
   4190 #define HELP_SETINDEX 0x0005
   4191 #define HELP_SETCONTENTS 0x0005
   4192 #define HELP_CONTEXTPOPUP 0x0008
   4193 #define HELP_FORCEFILE 0x0009
   4194 #define HELP_KEY 0x0101
   4195 #define HELP_COMMAND 0x0102
   4196 #define HELP_PARTIALKEY 0x0105
   4197 #define HELP_MULTIKEY 0x0201
   4198 #define HELP_SETWINPOS 0x0203
   4199 #define HELP_CONTEXTMENU 0x000a
   4200 #define HELP_FINDER 0x000b
   4201 #define HELP_WM_HELP 0x000c
   4202 #define HELP_SETPOPUP_POS 0x000d
   4203 
   4204 #define HELP_TCARD 0x8000
   4205 #define HELP_TCARD_DATA 0x0010
   4206 #define HELP_TCARD_OTHER_CALLER 0x0011
   4207 
   4208 #define IDH_NO_HELP 28440
   4209 #define IDH_MISSING_CONTEXT 28441
   4210 #define IDH_GENERIC_HELP_BUTTON 28442
   4211 #define IDH_OK 28443
   4212 #define IDH_CANCEL 28444
   4213 #define IDH_HELP 28445
   4214 
   4215 #define WinHelp __MINGW_NAME_AW(WinHelp)
   4216 
   4217   WINUSERAPI WINBOOL WINAPI WinHelpA(HWND hWndMain,LPCSTR lpszHelp,UINT uCommand,ULONG_PTR dwData);
   4218   WINUSERAPI WINBOOL WINAPI WinHelpW(HWND hWndMain,LPCWSTR lpszHelp,UINT uCommand,ULONG_PTR dwData);
   4219 #endif
   4220 
   4221 #define GR_GDIOBJECTS 0
   4222 #define GR_USEROBJECTS 1
   4223 
   4224   WINUSERAPI DWORD WINAPI GetGuiResources(HANDLE hProcess,DWORD uiFlags);
   4225 
   4226 #ifndef NOSYSPARAMSINFO
   4227 
   4228 #define SPI_GETBEEP 0x0001
   4229 #define SPI_SETBEEP 0x0002
   4230 #define SPI_GETMOUSE 0x0003
   4231 #define SPI_SETMOUSE 0x0004
   4232 #define SPI_GETBORDER 0x0005
   4233 #define SPI_SETBORDER 0x0006
   4234 #define SPI_GETKEYBOARDSPEED 0x000A
   4235 #define SPI_SETKEYBOARDSPEED 0x000B
   4236 #define SPI_LANGDRIVER 0x000C
   4237 #define SPI_ICONHORIZONTALSPACING 0x000D
   4238 #define SPI_GETSCREENSAVETIMEOUT 0x000E
   4239 #define SPI_SETSCREENSAVETIMEOUT 0x000F
   4240 #define SPI_GETSCREENSAVEACTIVE 0x0010
   4241 #define SPI_SETSCREENSAVEACTIVE 0x0011
   4242 #define SPI_GETGRIDGRANULARITY 0x0012
   4243 #define SPI_SETGRIDGRANULARITY 0x0013
   4244 #define SPI_SETDESKWALLPAPER 0x0014
   4245 #define SPI_SETDESKPATTERN 0x0015
   4246 #define SPI_GETKEYBOARDDELAY 0x0016
   4247 #define SPI_SETKEYBOARDDELAY 0x0017
   4248 #define SPI_ICONVERTICALSPACING 0x0018
   4249 #define SPI_GETICONTITLEWRAP 0x0019
   4250 #define SPI_SETICONTITLEWRAP 0x001A
   4251 #define SPI_GETMENUDROPALIGNMENT 0x001B
   4252 #define SPI_SETMENUDROPALIGNMENT 0x001C
   4253 #define SPI_SETDOUBLECLKWIDTH 0x001D
   4254 #define SPI_SETDOUBLECLKHEIGHT 0x001E
   4255 #define SPI_GETICONTITLELOGFONT 0x001F
   4256 #define SPI_SETDOUBLECLICKTIME 0x0020
   4257 #define SPI_SETMOUSEBUTTONSWAP 0x0021
   4258 #define SPI_SETICONTITLELOGFONT 0x0022
   4259 #define SPI_GETFASTTASKSWITCH 0x0023
   4260 #define SPI_SETFASTTASKSWITCH 0x0024
   4261 #define SPI_SETDRAGFULLWINDOWS 0x0025
   4262 #define SPI_GETDRAGFULLWINDOWS 0x0026
   4263 #define SPI_GETNONCLIENTMETRICS 0x0029
   4264 #define SPI_SETNONCLIENTMETRICS 0x002A
   4265 #define SPI_GETMINIMIZEDMETRICS 0x002B
   4266 #define SPI_SETMINIMIZEDMETRICS 0x002C
   4267 #define SPI_GETICONMETRICS 0x002D
   4268 #define SPI_SETICONMETRICS 0x002E
   4269 #define SPI_SETWORKAREA 0x002F
   4270 #define SPI_GETWORKAREA 0x0030
   4271 #define SPI_SETPENWINDOWS 0x0031
   4272 
   4273 #define SPI_GETHIGHCONTRAST 0x0042
   4274 #define SPI_SETHIGHCONTRAST 0x0043
   4275 #define SPI_GETKEYBOARDPREF 0x0044
   4276 #define SPI_SETKEYBOARDPREF 0x0045
   4277 #define SPI_GETSCREENREADER 0x0046
   4278 #define SPI_SETSCREENREADER 0x0047
   4279 #define SPI_GETANIMATION 0x0048
   4280 #define SPI_SETANIMATION 0x0049
   4281 #define SPI_GETFONTSMOOTHING 0x004A
   4282 #define SPI_SETFONTSMOOTHING 0x004B
   4283 #define SPI_SETDRAGWIDTH 0x004C
   4284 #define SPI_SETDRAGHEIGHT 0x004D
   4285 #define SPI_SETHANDHELD 0x004E
   4286 #define SPI_GETLOWPOWERTIMEOUT 0x004F
   4287 #define SPI_GETPOWEROFFTIMEOUT 0x0050
   4288 #define SPI_SETLOWPOWERTIMEOUT 0x0051
   4289 #define SPI_SETPOWEROFFTIMEOUT 0x0052
   4290 #define SPI_GETLOWPOWERACTIVE 0x0053
   4291 #define SPI_GETPOWEROFFACTIVE 0x0054
   4292 #define SPI_SETLOWPOWERACTIVE 0x0055
   4293 #define SPI_SETPOWEROFFACTIVE 0x0056
   4294 #define SPI_SETCURSORS 0x0057
   4295 #define SPI_SETICONS 0x0058
   4296 #define SPI_GETDEFAULTINPUTLANG 0x0059
   4297 #define SPI_SETDEFAULTINPUTLANG 0x005A
   4298 #define SPI_SETLANGTOGGLE 0x005B
   4299 #define SPI_GETWINDOWSEXTENSION 0x005C
   4300 #define SPI_SETMOUSETRAILS 0x005D
   4301 #define SPI_GETMOUSETRAILS 0x005E
   4302 #define SPI_SETSCREENSAVERRUNNING 0x0061
   4303 #define SPI_SCREENSAVERRUNNING SPI_SETSCREENSAVERRUNNING
   4304 #define SPI_GETFILTERKEYS 0x0032
   4305 #define SPI_SETFILTERKEYS 0x0033
   4306 #define SPI_GETTOGGLEKEYS 0x0034
   4307 #define SPI_SETTOGGLEKEYS 0x0035
   4308 #define SPI_GETMOUSEKEYS 0x0036
   4309 #define SPI_SETMOUSEKEYS 0x0037
   4310 #define SPI_GETSHOWSOUNDS 0x0038
   4311 #define SPI_SETSHOWSOUNDS 0x0039
   4312 #define SPI_GETSTICKYKEYS 0x003A
   4313 #define SPI_SETSTICKYKEYS 0x003B
   4314 #define SPI_GETACCESSTIMEOUT 0x003C
   4315 #define SPI_SETACCESSTIMEOUT 0x003D
   4316 #define SPI_GETSERIALKEYS 0x003E
   4317 #define SPI_SETSERIALKEYS 0x003F
   4318 #define SPI_GETSOUNDSENTRY 0x0040
   4319 #define SPI_SETSOUNDSENTRY 0x0041
   4320 #define SPI_GETSNAPTODEFBUTTON 0x005F
   4321 #define SPI_SETSNAPTODEFBUTTON 0x0060
   4322 #define SPI_GETMOUSEHOVERWIDTH 0x0062
   4323 #define SPI_SETMOUSEHOVERWIDTH 0x0063
   4324 #define SPI_GETMOUSEHOVERHEIGHT 0x0064
   4325 #define SPI_SETMOUSEHOVERHEIGHT 0x0065
   4326 #define SPI_GETMOUSEHOVERTIME 0x0066
   4327 #define SPI_SETMOUSEHOVERTIME 0x0067
   4328 #define SPI_GETWHEELSCROLLLINES 0x0068
   4329 #define SPI_SETWHEELSCROLLLINES 0x0069
   4330 #define SPI_GETMENUSHOWDELAY 0x006A
   4331 #define SPI_SETMENUSHOWDELAY 0x006B
   4332 #define SPI_GETWHEELSCROLLCHARS 0x006C
   4333 #define SPI_SETWHEELSCROLLCHARS 0x006D
   4334 #define SPI_GETSHOWIMEUI 0x006E
   4335 #define SPI_SETSHOWIMEUI 0x006F
   4336 #define SPI_GETMOUSESPEED 0x0070
   4337 #define SPI_SETMOUSESPEED 0x0071
   4338 #define SPI_GETSCREENSAVERRUNNING 0x0072
   4339 #define SPI_GETDESKWALLPAPER 0x0073
   4340 #define SPI_GETAUDIODESCRIPTION 0x0074
   4341 #define SPI_SETAUDIODESCRIPTION 0x0075
   4342 #define SPI_GETSCREENSAVESECURE 0x0076
   4343 #define SPI_SETSCREENSAVESECURE 0x0077
   4344 #define SPI_GETHUNGAPPTIMEOUT 0x0078
   4345 #define SPI_SETHUNGAPPTIMEOUT 0x0079
   4346 #define SPI_GETWAITTOKILLTIMEOUT 0x007A
   4347 #define SPI_SETWAITTOKILLTIMEOUT 0x007B
   4348 #define SPI_GETWAITTOKILLSERVICETIMEOUT 0x007C
   4349 #define SPI_SETWAITTOKILLSERVICETIMEOUT 0x007D
   4350 #define SPI_GETMOUSEDOCKTHRESHOLD 0x007E
   4351 #define SPI_SETMOUSEDOCKTHRESHOLD 0x007F
   4352 #define SPI_GETPENDOCKTHRESHOLD 0x0080
   4353 #define SPI_SETPENDOCKTHRESHOLD 0x0081
   4354 #define SPI_GETWINARRANGING 0x0082
   4355 #define SPI_SETWINARRANGING 0x0083
   4356 #define SPI_GETMOUSEDRAGOUTTHRESHOLD 0x0084
   4357 #define SPI_SETMOUSEDRAGOUTTHRESHOLD 0x0085
   4358 #define SPI_GETPENDRAGOUTTHRESHOLD 0x0086
   4359 #define SPI_SETPENDRAGOUTTHRESHOLD 0x0087
   4360 #define SPI_GETMOUSESIDEMOVETHRESHOLD 0x0088
   4361 #define SPI_SETMOUSESIDEMOVETHRESHOLD 0x0089
   4362 #define SPI_GETPENSIDEMOVETHRESHOLD 0x008A
   4363 #define SPI_SETPENSIDEMOVETHRESHOLD 0x008B
   4364 #define SPI_GETDRAGFROMMAXIMIZE 0x008C
   4365 #define SPI_SETDRAGFROMMAXIMIZE 0x008D
   4366 #define SPI_GETSNAPSIZING 0x008E
   4367 #define SPI_GETDOCKMOVING 0x0090
   4368 #define SPI_SETDOCKMOVING 0x0091
   4369 
   4370 #if (_WIN32_WINNT >= 0x0600)
   4371 #define SPI_GETAUDIODESCRIPTION 0x0074
   4372 #define SPI_SETAUDIODESCRIPTION 0x0075
   4373 #endif
   4374 
   4375 #define SPI_GETACTIVEWINDOWTRACKING 0x1000
   4376 #define SPI_SETACTIVEWINDOWTRACKING 0x1001
   4377 #define SPI_GETMENUANIMATION 0x1002
   4378 #define SPI_SETMENUANIMATION 0x1003
   4379 #define SPI_GETCOMBOBOXANIMATION 0x1004
   4380 #define SPI_SETCOMBOBOXANIMATION 0x1005
   4381 #define SPI_GETLISTBOXSMOOTHSCROLLING 0x1006
   4382 #define SPI_SETLISTBOXSMOOTHSCROLLING 0x1007
   4383 #define SPI_GETGRADIENTCAPTIONS 0x1008
   4384 #define SPI_SETGRADIENTCAPTIONS 0x1009
   4385 #define SPI_GETKEYBOARDCUES 0x100A
   4386 #define SPI_SETKEYBOARDCUES 0x100B
   4387 #define SPI_GETMENUUNDERLINES SPI_GETKEYBOARDCUES
   4388 #define SPI_SETMENUUNDERLINES SPI_SETKEYBOARDCUES
   4389 #define SPI_GETACTIVEWNDTRKZORDER 0x100C
   4390 #define SPI_SETACTIVEWNDTRKZORDER 0x100D
   4391 #define SPI_GETHOTTRACKING 0x100E
   4392 #define SPI_SETHOTTRACKING 0x100F
   4393 #define SPI_GETMENUFADE 0x1012
   4394 #define SPI_SETMENUFADE 0x1013
   4395 #define SPI_GETSELECTIONFADE 0x1014
   4396 #define SPI_SETSELECTIONFADE 0x1015
   4397 #define SPI_GETTOOLTIPANIMATION 0x1016
   4398 #define SPI_SETTOOLTIPANIMATION 0x1017
   4399 #define SPI_GETTOOLTIPFADE 0x1018
   4400 #define SPI_SETTOOLTIPFADE 0x1019
   4401 #define SPI_GETCURSORSHADOW 0x101A
   4402 #define SPI_SETCURSORSHADOW 0x101B
   4403 #define SPI_GETMOUSESONAR 0x101C
   4404 #define SPI_SETMOUSESONAR 0x101D
   4405 #define SPI_GETMOUSECLICKLOCK 0x101E
   4406 #define SPI_SETMOUSECLICKLOCK 0x101F
   4407 #define SPI_GETMOUSEVANISH 0x1020
   4408 #define SPI_SETMOUSEVANISH 0x1021
   4409 #define SPI_GETFLATMENU 0x1022
   4410 #define SPI_SETFLATMENU 0x1023
   4411 #define SPI_GETDROPSHADOW 0x1024
   4412 #define SPI_SETDROPSHADOW 0x1025
   4413 #define SPI_GETBLOCKSENDINPUTRESETS 0x1026
   4414 #define SPI_SETBLOCKSENDINPUTRESETS 0x1027
   4415 #define SPI_GETUIEFFECTS 0x103E
   4416 #define SPI_SETUIEFFECTS 0x103F
   4417 #define SPI_GETDISABLEOVERLAPPEDCONTENT 0x1040
   4418 #define SPI_SETDISABLEOVERLAPPEDCONTENT 0x1041
   4419 #define SPI_GETCLIENTAREAANIMATION 0x1042
   4420 #define SPI_SETCLIENTAREAANIMATION 0x1043
   4421 #define SPI_GETCLEARTYPE 0x1048
   4422 #define SPI_SETCLEARTYPE 0x1049
   4423 #define SPI_GETFOREGROUNDLOCKTIMEOUT 0x2000
   4424 #define SPI_SETFOREGROUNDLOCKTIMEOUT 0x2001
   4425 #define SPI_GETACTIVEWNDTRKTIMEOUT 0x2002
   4426 #define SPI_SETACTIVEWNDTRKTIMEOUT 0x2003
   4427 #define SPI_GETFOREGROUNDFLASHCOUNT 0x2004
   4428 #define SPI_SETFOREGROUNDFLASHCOUNT 0x2005
   4429 #define SPI_GETCARETWIDTH 0x2006
   4430 #define SPI_SETCARETWIDTH 0x2007
   4431 #define SPI_GETMOUSECLICKLOCKTIME 0x2008
   4432 #define SPI_SETMOUSECLICKLOCKTIME 0x2009
   4433 #define SPI_GETFONTSMOOTHINGTYPE 0x200A
   4434 #define SPI_SETFONTSMOOTHINGTYPE 0x200B
   4435 
   4436 #define FE_FONTSMOOTHINGSTANDARD 0x0001
   4437 #define FE_FONTSMOOTHINGCLEARTYPE 0x0002
   4438 #define FE_FONTSMOOTHINGDOCKING 0x8000
   4439 
   4440 #define SPI_GETFONTSMOOTHINGCONTRAST 0x200C
   4441 #define SPI_SETFONTSMOOTHINGCONTRAST 0x200D
   4442 #define SPI_GETFOCUSBORDERWIDTH 0x200E
   4443 #define SPI_SETFOCUSBORDERWIDTH 0x200F
   4444 #define SPI_GETFOCUSBORDERHEIGHT 0x2010
   4445 #define SPI_SETFOCUSBORDERHEIGHT 0x2011
   4446 #define SPI_GETFONTSMOOTHINGORIENTATION 0x2012
   4447 #define SPI_SETFONTSMOOTHINGORIENTATION 0x2013
   4448 #define SPI_GETMESSAGEDURATION 0x2016
   4449 #define SPI_SETMESSAGEDURATION 0x2017
   4450 
   4451 #define FE_FONTSMOOTHINGORIENTATIONBGR 0x0000
   4452 #define FE_FONTSMOOTHINGORIENTATIONRGB 0x0001
   4453 
   4454 #define SPIF_UPDATEINIFILE 0x0001
   4455 #define SPIF_SENDWININICHANGE 0x0002
   4456 #define SPIF_SENDCHANGE SPIF_SENDWININICHANGE
   4457 
   4458 #define METRICS_USEDEFAULT -1
   4459 #ifdef _WINGDI_
   4460 #ifndef NOGDI
   4461   typedef struct tagNONCLIENTMETRICSA {
   4462     UINT cbSize;
   4463     int iBorderWidth;
   4464     int iScrollWidth;
   4465     int iScrollHeight;
   4466     int iCaptionWidth;
   4467     int iCaptionHeight;
   4468     LOGFONTA lfCaptionFont;
   4469     int iSmCaptionWidth;
   4470     int iSmCaptionHeight;
   4471     LOGFONTA lfSmCaptionFont;
   4472     int iMenuWidth;
   4473     int iMenuHeight;
   4474     LOGFONTA lfMenuFont;
   4475     LOGFONTA lfStatusFont;
   4476     LOGFONTA lfMessageFont;
   4477   } NONCLIENTMETRICSA,*PNONCLIENTMETRICSA,*LPNONCLIENTMETRICSA;
   4478 
   4479   typedef struct tagNONCLIENTMETRICSW {
   4480     UINT cbSize;
   4481     int iBorderWidth;
   4482     int iScrollWidth;
   4483     int iScrollHeight;
   4484     int iCaptionWidth;
   4485     int iCaptionHeight;
   4486     LOGFONTW lfCaptionFont;
   4487     int iSmCaptionWidth;
   4488     int iSmCaptionHeight;
   4489     LOGFONTW lfSmCaptionFont;
   4490     int iMenuWidth;
   4491     int iMenuHeight;
   4492     LOGFONTW lfMenuFont;
   4493     LOGFONTW lfStatusFont;
   4494     LOGFONTW lfMessageFont;
   4495   } NONCLIENTMETRICSW,*PNONCLIENTMETRICSW,*LPNONCLIENTMETRICSW;
   4496 
   4497   __MINGW_TYPEDEF_AW(NONCLIENTMETRICS)
   4498   __MINGW_TYPEDEF_AW(PNONCLIENTMETRICS)
   4499   __MINGW_TYPEDEF_AW(LPNONCLIENTMETRICS)
   4500 #endif
   4501 #endif
   4502 
   4503 #define ARW_BOTTOMLEFT __MSABI_LONG(0x0000)
   4504 #define ARW_BOTTOMRIGHT __MSABI_LONG(0x0001)
   4505 #define ARW_TOPLEFT __MSABI_LONG(0x0002)
   4506 #define ARW_TOPRIGHT __MSABI_LONG(0x0003)
   4507 #define ARW_STARTMASK __MSABI_LONG(0x0003)
   4508 #define ARW_STARTRIGHT __MSABI_LONG(0x0001)
   4509 #define ARW_STARTTOP __MSABI_LONG(0x0002)
   4510 
   4511 #define ARW_LEFT __MSABI_LONG(0x0000)
   4512 #define ARW_RIGHT __MSABI_LONG(0x0000)
   4513 #define ARW_UP __MSABI_LONG(0x0004)
   4514 #define ARW_DOWN __MSABI_LONG(0x0004)
   4515 #define ARW_HIDE __MSABI_LONG(0x0008)
   4516 
   4517   typedef struct tagMINIMIZEDMETRICS {
   4518     UINT cbSize;
   4519     int iWidth;
   4520     int iHorzGap;
   4521     int iVertGap;
   4522     int iArrange;
   4523   } MINIMIZEDMETRICS,*PMINIMIZEDMETRICS,*LPMINIMIZEDMETRICS;
   4524 
   4525 #ifdef _WINGDI_
   4526 #ifndef NOGDI
   4527   typedef struct tagICONMETRICSA {
   4528     UINT cbSize;
   4529     int iHorzSpacing;
   4530     int iVertSpacing;
   4531     int iTitleWrap;
   4532     LOGFONTA lfFont;
   4533   } ICONMETRICSA,*PICONMETRICSA,*LPICONMETRICSA;
   4534 
   4535   typedef struct tagICONMETRICSW {
   4536     UINT cbSize;
   4537     int iHorzSpacing;
   4538     int iVertSpacing;
   4539     int iTitleWrap;
   4540     LOGFONTW lfFont;
   4541   } ICONMETRICSW,*PICONMETRICSW,*LPICONMETRICSW;
   4542 
   4543   __MINGW_TYPEDEF_AW(ICONMETRICS)
   4544   __MINGW_TYPEDEF_AW(PICONMETRICS)
   4545   __MINGW_TYPEDEF_AW(LPICONMETRICS)
   4546 #endif
   4547 #endif
   4548 
   4549   typedef struct tagANIMATIONINFO {
   4550     UINT cbSize;
   4551     int iMinAnimate;
   4552   } ANIMATIONINFO,*LPANIMATIONINFO;
   4553 
   4554   typedef struct tagSERIALKEYSA {
   4555     UINT cbSize;
   4556     DWORD dwFlags;
   4557     LPSTR lpszActivePort;
   4558     LPSTR lpszPort;
   4559     UINT iBaudRate;
   4560     UINT iPortState;
   4561     UINT iActive;
   4562   } SERIALKEYSA,*LPSERIALKEYSA;
   4563 
   4564   typedef struct tagSERIALKEYSW {
   4565     UINT cbSize;
   4566     DWORD dwFlags;
   4567     LPWSTR lpszActivePort;
   4568     LPWSTR lpszPort;
   4569     UINT iBaudRate;
   4570     UINT iPortState;
   4571     UINT iActive;
   4572   } SERIALKEYSW,*LPSERIALKEYSW;
   4573 
   4574   __MINGW_TYPEDEF_AW(SERIALKEYS)
   4575   __MINGW_TYPEDEF_AW(LPSERIALKEYS)
   4576 
   4577 #define SERKF_SERIALKEYSON 0x00000001
   4578 #define SERKF_AVAILABLE 0x00000002
   4579 #define SERKF_INDICATOR 0x00000004
   4580 
   4581   typedef struct tagHIGHCONTRASTA {
   4582     UINT cbSize;
   4583     DWORD dwFlags;
   4584     LPSTR lpszDefaultScheme;
   4585   } HIGHCONTRASTA,*LPHIGHCONTRASTA;
   4586 
   4587   typedef struct tagHIGHCONTRASTW {
   4588     UINT cbSize;
   4589     DWORD dwFlags;
   4590     LPWSTR lpszDefaultScheme;
   4591   } HIGHCONTRASTW,*LPHIGHCONTRASTW;
   4592 
   4593   __MINGW_TYPEDEF_AW(HIGHCONTRAST)
   4594   __MINGW_TYPEDEF_AW(LPHIGHCONTRAST)
   4595 
   4596 #define HCF_HIGHCONTRASTON 0x00000001
   4597 #define HCF_AVAILABLE 0x00000002
   4598 #define HCF_HOTKEYACTIVE 0x00000004
   4599 #define HCF_CONFIRMHOTKEY 0x00000008
   4600 #define HCF_HOTKEYSOUND 0x00000010
   4601 #define HCF_INDICATOR 0x00000020
   4602 #define HCF_HOTKEYAVAILABLE 0x00000040
   4603 #define HCF_LOGONDESKTOP 0x00000100
   4604 #define HCF_DEFAULTDESKTOP 0x00000200
   4605 
   4606 #define CDS_UPDATEREGISTRY 0x00000001
   4607 #define CDS_TEST 0x00000002
   4608 #define CDS_FULLSCREEN 0x00000004
   4609 #define CDS_GLOBAL 0x00000008
   4610 #define CDS_SET_PRIMARY 0x00000010
   4611 #define CDS_VIDEOPARAMETERS 0x00000020
   4612 #define CDS_RESET 0x40000000
   4613 #define CDS_NORESET 0x10000000
   4614 
   4615 #include <tvout.h>
   4616 
   4617 #define DISP_CHANGE_SUCCESSFUL 0
   4618 #define DISP_CHANGE_RESTART 1
   4619 #define DISP_CHANGE_FAILED -1
   4620 #define DISP_CHANGE_BADMODE -2
   4621 #define DISP_CHANGE_NOTUPDATED -3
   4622 #define DISP_CHANGE_BADFLAGS -4
   4623 #define DISP_CHANGE_BADPARAM -5
   4624 #define DISP_CHANGE_BADDUALVIEW -6
   4625 
   4626 #ifdef _WINGDI_
   4627 #ifndef NOGDI
   4628 
   4629 #define ChangeDisplaySettings __MINGW_NAME_AW(ChangeDisplaySettings)
   4630 #define ChangeDisplaySettingsEx __MINGW_NAME_AW(ChangeDisplaySettingsEx)
   4631 #define EnumDisplaySettings __MINGW_NAME_AW(EnumDisplaySettings)
   4632 #define EnumDisplaySettingsEx __MINGW_NAME_AW(EnumDisplaySettingsEx)
   4633 #define EnumDisplayDevices __MINGW_NAME_AW(EnumDisplayDevices)
   4634 
   4635   WINUSERAPI LONG WINAPI ChangeDisplaySettingsA(LPDEVMODEA lpDevMode,DWORD dwFlags);
   4636   WINUSERAPI LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode,DWORD dwFlags);
   4637   WINUSERAPI LONG WINAPI ChangeDisplaySettingsExA(LPCSTR lpszDeviceName,LPDEVMODEA lpDevMode,HWND hwnd,DWORD dwflags,LPVOID lParam);
   4638   WINUSERAPI LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR lpszDeviceName,LPDEVMODEW lpDevMode,HWND hwnd,DWORD dwflags,LPVOID lParam);
   4639 
   4640 #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
   4641 #define ENUM_REGISTRY_SETTINGS ((DWORD)-2)
   4642 
   4643   WINUSERAPI WINBOOL WINAPI EnumDisplaySettingsA(LPCSTR lpszDeviceName,DWORD iModeNum,LPDEVMODEA lpDevMode);
   4644   WINUSERAPI WINBOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName,DWORD iModeNum,LPDEVMODEW lpDevMode);
   4645   WINUSERAPI WINBOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName,DWORD iModeNum,LPDEVMODEA lpDevMode,DWORD dwFlags);
   4646   WINUSERAPI WINBOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName,DWORD iModeNum,LPDEVMODEW lpDevMode,DWORD dwFlags);
   4647 
   4648 #define EDS_RAWMODE 0x00000002
   4649 
   4650   WINUSERAPI WINBOOL WINAPI EnumDisplayDevicesA(LPCSTR lpDevice,DWORD iDevNum,PDISPLAY_DEVICEA lpDisplayDevice,DWORD dwFlags);
   4651   WINUSERAPI WINBOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice,DWORD iDevNum,PDISPLAY_DEVICEW lpDisplayDevice,DWORD dwFlags);
   4652 #endif
   4653 #endif
   4654 
   4655 #define SystemParametersInfo __MINGW_NAME_AW(SystemParametersInfo)
   4656 
   4657   WINUSERAPI WINBOOL WINAPI SystemParametersInfoA(UINT uiAction,UINT uiParam,PVOID pvParam,UINT fWinIni);
   4658   WINUSERAPI WINBOOL WINAPI SystemParametersInfoW(UINT uiAction,UINT uiParam,PVOID pvParam,UINT fWinIni);
   4659 #endif
   4660 
   4661   typedef struct tagFILTERKEYS {
   4662     UINT cbSize;
   4663     DWORD dwFlags;
   4664     DWORD iWaitMSec;
   4665     DWORD iDelayMSec;
   4666     DWORD iRepeatMSec;
   4667     DWORD iBounceMSec;
   4668   } FILTERKEYS,*LPFILTERKEYS;
   4669 
   4670 #define FKF_FILTERKEYSON 0x00000001
   4671 #define FKF_AVAILABLE 0x00000002
   4672 #define FKF_HOTKEYACTIVE 0x00000004
   4673 #define FKF_CONFIRMHOTKEY 0x00000008
   4674 #define FKF_HOTKEYSOUND 0x00000010
   4675 #define FKF_INDICATOR 0x00000020
   4676 #define FKF_CLICKON 0x00000040
   4677 
   4678   typedef struct tagSTICKYKEYS {
   4679     UINT cbSize;
   4680     DWORD dwFlags;
   4681   } STICKYKEYS,*LPSTICKYKEYS;
   4682 
   4683 #define SKF_STICKYKEYSON 0x00000001
   4684 #define SKF_AVAILABLE 0x00000002
   4685 #define SKF_HOTKEYACTIVE 0x00000004
   4686 #define SKF_CONFIRMHOTKEY 0x00000008
   4687 #define SKF_HOTKEYSOUND 0x00000010
   4688 #define SKF_INDICATOR 0x00000020
   4689 #define SKF_AUDIBLEFEEDBACK 0x00000040
   4690 #define SKF_TRISTATE 0x00000080
   4691 #define SKF_TWOKEYSOFF 0x00000100
   4692 #define SKF_LALTLATCHED 0x10000000
   4693 #define SKF_LCTLLATCHED 0x04000000
   4694 #define SKF_LSHIFTLATCHED 0x01000000
   4695 #define SKF_RALTLATCHED 0x20000000
   4696 #define SKF_RCTLLATCHED 0x08000000
   4697 #define SKF_RSHIFTLATCHED 0x02000000
   4698 #define SKF_LWINLATCHED 0x40000000
   4699 #define SKF_RWINLATCHED 0x80000000
   4700 #define SKF_LALTLOCKED 0x00100000
   4701 #define SKF_LCTLLOCKED 0x00040000
   4702 #define SKF_LSHIFTLOCKED 0x00010000
   4703 #define SKF_RALTLOCKED 0x00200000
   4704 #define SKF_RCTLLOCKED 0x00080000
   4705 #define SKF_RSHIFTLOCKED 0x00020000
   4706 #define SKF_LWINLOCKED 0x00400000
   4707 #define SKF_RWINLOCKED 0x00800000
   4708 
   4709   typedef struct tagMOUSEKEYS {
   4710     UINT cbSize;
   4711     DWORD dwFlags;
   4712     DWORD iMaxSpeed;
   4713     DWORD iTimeToMaxSpeed;
   4714     DWORD iCtrlSpeed;
   4715     DWORD dwReserved1;
   4716     DWORD dwReserved2;
   4717   } MOUSEKEYS,*LPMOUSEKEYS;
   4718 
   4719 #define MKF_MOUSEKEYSON 0x00000001
   4720 #define MKF_AVAILABLE 0x00000002
   4721 #define MKF_HOTKEYACTIVE 0x00000004
   4722 #define MKF_CONFIRMHOTKEY 0x00000008
   4723 #define MKF_HOTKEYSOUND 0x00000010
   4724 #define MKF_INDICATOR 0x00000020
   4725 #define MKF_MODIFIERS 0x00000040
   4726 #define MKF_REPLACENUMBERS 0x00000080
   4727 #define MKF_LEFTBUTTONSEL 0x10000000
   4728 #define MKF_RIGHTBUTTONSEL 0x20000000
   4729 #define MKF_LEFTBUTTONDOWN 0x01000000
   4730 #define MKF_RIGHTBUTTONDOWN 0x02000000
   4731 #define MKF_MOUSEMODE 0x80000000
   4732 
   4733   typedef struct tagACCESSTIMEOUT {
   4734     UINT cbSize;
   4735     DWORD dwFlags;
   4736     DWORD iTimeOutMSec;
   4737   } ACCESSTIMEOUT,*LPACCESSTIMEOUT;
   4738 
   4739 #define ATF_TIMEOUTON 0x00000001
   4740 #define ATF_ONOFFFEEDBACK 0x00000002
   4741 
   4742 #define SSGF_NONE 0
   4743 #define SSGF_DISPLAY 3
   4744 
   4745 #define SSTF_NONE 0
   4746 #define SSTF_CHARS 1
   4747 #define SSTF_BORDER 2
   4748 #define SSTF_DISPLAY 3
   4749 
   4750 #define SSWF_NONE 0
   4751 #define SSWF_TITLE 1
   4752 #define SSWF_WINDOW 2
   4753 #define SSWF_DISPLAY 3
   4754 #define SSWF_CUSTOM 4
   4755 
   4756   typedef struct tagSOUNDSENTRYA {
   4757     UINT cbSize;
   4758     DWORD dwFlags;
   4759     DWORD iFSTextEffect;
   4760     DWORD iFSTextEffectMSec;
   4761     DWORD iFSTextEffectColorBits;
   4762     DWORD iFSGrafEffect;
   4763     DWORD iFSGrafEffectMSec;
   4764     DWORD iFSGrafEffectColor;
   4765     DWORD iWindowsEffect;
   4766     DWORD iWindowsEffectMSec;
   4767     LPSTR lpszWindowsEffectDLL;
   4768     DWORD iWindowsEffectOrdinal;
   4769   } SOUNDSENTRYA,*LPSOUNDSENTRYA;
   4770 
   4771   typedef struct tagSOUNDSENTRYW {
   4772     UINT cbSize;
   4773     DWORD dwFlags;
   4774     DWORD iFSTextEffect;
   4775     DWORD iFSTextEffectMSec;
   4776     DWORD iFSTextEffectColorBits;
   4777     DWORD iFSGrafEffect;
   4778     DWORD iFSGrafEffectMSec;
   4779     DWORD iFSGrafEffectColor;
   4780     DWORD iWindowsEffect;
   4781     DWORD iWindowsEffectMSec;
   4782     LPWSTR lpszWindowsEffectDLL;
   4783     DWORD iWindowsEffectOrdinal;
   4784   } SOUNDSENTRYW,*LPSOUNDSENTRYW;
   4785 
   4786   __MINGW_TYPEDEF_AW(SOUNDSENTRY)
   4787   __MINGW_TYPEDEF_AW(LPSOUNDSENTRY)
   4788 
   4789 #define SSF_SOUNDSENTRYON 0x00000001
   4790 #define SSF_AVAILABLE 0x00000002
   4791 #define SSF_INDICATOR 0x00000004
   4792 
   4793   typedef struct tagTOGGLEKEYS {
   4794     UINT cbSize;
   4795     DWORD dwFlags;
   4796   } TOGGLEKEYS,*LPTOGGLEKEYS;
   4797 
   4798 #define TKF_TOGGLEKEYSON 0x00000001
   4799 #define TKF_AVAILABLE 0x00000002
   4800 #define TKF_HOTKEYACTIVE 0x00000004
   4801 #define TKF_CONFIRMHOTKEY 0x00000008
   4802 #define TKF_HOTKEYSOUND 0x00000010
   4803 #define TKF_INDICATOR 0x00000020
   4804 
   4805   WINUSERAPI VOID WINAPI SetDebugErrorLevel(DWORD dwLevel);
   4806 
   4807 #define SLE_ERROR 0x00000001
   4808 #define SLE_MINORERROR 0x00000002
   4809 #define SLE_WARNING 0x00000003
   4810 
   4811   WINUSERAPI VOID WINAPI SetLastErrorEx(DWORD dwErrCode,DWORD dwType);
   4812   WINUSERAPI int WINAPI InternalGetWindowText(HWND hWnd,LPWSTR pString,int cchMaxCount);
   4813 
   4814 #ifdef WINNT
   4815   WINUSERAPI WINBOOL WINAPI EndTask(HWND hWnd,WINBOOL fShutDown,WINBOOL fForce);
   4816 #endif
   4817 
   4818 #define MONITOR_DEFAULTTONULL 0x00000000
   4819 #define MONITOR_DEFAULTTOPRIMARY 0x00000001
   4820 #define MONITOR_DEFAULTTONEAREST 0x00000002
   4821 
   4822   WINUSERAPI HMONITOR WINAPI MonitorFromPoint(POINT pt,DWORD dwFlags);
   4823   WINUSERAPI HMONITOR WINAPI MonitorFromRect(LPCRECT lprc,DWORD dwFlags);
   4824   WINUSERAPI HMONITOR WINAPI MonitorFromWindow(HWND hwnd,DWORD dwFlags);
   4825 
   4826 #define MONITORINFOF_PRIMARY 0x00000001
   4827 
   4828 #ifndef CCHDEVICENAME
   4829 #define CCHDEVICENAME 32
   4830 #endif
   4831 
   4832   typedef struct tagMONITORINFO {
   4833     DWORD cbSize;
   4834     RECT rcMonitor;
   4835     RECT rcWork;
   4836     DWORD dwFlags;
   4837   } MONITORINFO,*LPMONITORINFO;
   4838 
   4839 #ifdef __cplusplus
   4840   typedef struct tagMONITORINFOEXA : public tagMONITORINFO {
   4841     CHAR szDevice[CCHDEVICENAME];
   4842   } MONITORINFOEXA,*LPMONITORINFOEXA;
   4843 
   4844   typedef struct tagMONITORINFOEXW : public tagMONITORINFO {
   4845     WCHAR szDevice[CCHDEVICENAME];
   4846   } MONITORINFOEXW,*LPMONITORINFOEXW;
   4847 
   4848   __MINGW_TYPEDEF_AW(MONITORINFOEX)
   4849   __MINGW_TYPEDEF_AW(LPMONITORINFOEX)
   4850 #else
   4851   typedef struct tagMONITORINFOEXA {
   4852     __C89_NAMELESS struct {
   4853       DWORD cbSize;
   4854       RECT rcMonitor;
   4855       RECT rcWork;
   4856       DWORD dwFlags;
   4857     };
   4858     CHAR szDevice[CCHDEVICENAME];
   4859   } MONITORINFOEXA,*LPMONITORINFOEXA;
   4860 
   4861   typedef struct tagMONITORINFOEXW {
   4862     __C89_NAMELESS struct {
   4863       DWORD cbSize;
   4864       RECT rcMonitor;
   4865       RECT rcWork;
   4866       DWORD dwFlags;
   4867     };
   4868     WCHAR szDevice[CCHDEVICENAME];
   4869   } MONITORINFOEXW,*LPMONITORINFOEXW;
   4870 
   4871   __MINGW_TYPEDEF_AW(MONITORINFOEX)
   4872   __MINGW_TYPEDEF_AW(LPMONITORINFOEX)
   4873 #endif
   4874 
   4875 #define GetMonitorInfo __MINGW_NAME_AW(GetMonitorInfo)
   4876 
   4877   WINUSERAPI WINBOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor,LPMONITORINFO lpmi);
   4878   WINUSERAPI WINBOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor,LPMONITORINFO lpmi);
   4879 
   4880   typedef WINBOOL (CALLBACK *MONITORENUMPROC)(HMONITOR,HDC,LPRECT,LPARAM);
   4881 
   4882   WINUSERAPI WINBOOL WINAPI EnumDisplayMonitors(HDC hdc,LPCRECT lprcClip,MONITORENUMPROC lpfnEnum,LPARAM dwData);
   4883 
   4884 #ifndef NOWINABLE
   4885   WINUSERAPI VOID WINAPI NotifyWinEvent(DWORD event,HWND hwnd,LONG idObject,LONG idChild);
   4886 
   4887   typedef VOID (CALLBACK *WINEVENTPROC)(HWINEVENTHOOK hWinEventHook,DWORD event,HWND hwnd,LONG idObject,LONG idChild,DWORD idEventThread,DWORD dwmsEventTime);
   4888 
   4889   WINUSERAPI HWINEVENTHOOK WINAPI SetWinEventHook(DWORD eventMin,DWORD eventMax,HMODULE hmodWinEventProc,WINEVENTPROC pfnWinEventProc,DWORD idProcess,DWORD idThread,DWORD dwFlags);
   4890   WINUSERAPI WINBOOL WINAPI IsWinEventHookInstalled(DWORD event);
   4891 
   4892 #define WINEVENT_OUTOFCONTEXT 0x0000
   4893 #define WINEVENT_SKIPOWNTHREAD 0x0001
   4894 #define WINEVENT_SKIPOWNPROCESS 0x0002
   4895 #define WINEVENT_INCONTEXT 0x0004
   4896 
   4897   WINUSERAPI WINBOOL WINAPI UnhookWinEvent(HWINEVENTHOOK hWinEventHook);
   4898 
   4899 #define CHILDID_SELF 0
   4900 #define INDEXID_OBJECT 0
   4901 #define INDEXID_CONTAINER 0
   4902 
   4903 #define OBJID_WINDOW ((LONG)0x00000000)
   4904 #define OBJID_SYSMENU ((LONG)0xFFFFFFFF)
   4905 #define OBJID_TITLEBAR ((LONG)0xFFFFFFFE)
   4906 #define OBJID_MENU ((LONG)0xFFFFFFFD)
   4907 #define OBJID_CLIENT ((LONG)0xFFFFFFFC)
   4908 #define OBJID_VSCROLL ((LONG)0xFFFFFFFB)
   4909 #define OBJID_HSCROLL ((LONG)0xFFFFFFFA)
   4910 #define OBJID_SIZEGRIP ((LONG)0xFFFFFFF9)
   4911 #define OBJID_CARET ((LONG)0xFFFFFFF8)
   4912 #define OBJID_CURSOR ((LONG)0xFFFFFFF7)
   4913 #define OBJID_ALERT ((LONG)0xFFFFFFF6)
   4914 #define OBJID_SOUND ((LONG)0xFFFFFFF5)
   4915 #define OBJID_QUERYCLASSNAMEIDX ((LONG)0xFFFFFFF4)
   4916 #define OBJID_NATIVEOM ((LONG)0xFFFFFFF0)
   4917 
   4918 #define EVENT_MIN 0x00000001
   4919 #define EVENT_MAX 0x7FFFFFFF
   4920 
   4921 #define EVENT_SYSTEM_SOUND 0x0001
   4922 #define EVENT_SYSTEM_ALERT 0x0002
   4923 #define EVENT_SYSTEM_FOREGROUND 0x0003
   4924 #define EVENT_SYSTEM_MENUSTART 0x0004
   4925 #define EVENT_SYSTEM_MENUEND 0x0005
   4926 #define EVENT_SYSTEM_MENUPOPUPSTART 0x0006
   4927 #define EVENT_SYSTEM_MENUPOPUPEND 0x0007
   4928 #define EVENT_SYSTEM_CAPTURESTART 0x0008
   4929 #define EVENT_SYSTEM_CAPTUREEND 0x0009
   4930 #define EVENT_SYSTEM_MOVESIZESTART 0x000A
   4931 #define EVENT_SYSTEM_MOVESIZEEND 0x000B
   4932 #define EVENT_SYSTEM_CONTEXTHELPSTART 0x000C
   4933 #define EVENT_SYSTEM_CONTEXTHELPEND 0x000D
   4934 #define EVENT_SYSTEM_DRAGDROPSTART 0x000E
   4935 #define EVENT_SYSTEM_DRAGDROPEND 0x000F
   4936 #define EVENT_SYSTEM_DIALOGSTART 0x0010
   4937 #define EVENT_SYSTEM_DIALOGEND 0x0011
   4938 #define EVENT_SYSTEM_SCROLLINGSTART 0x0012
   4939 #define EVENT_SYSTEM_SCROLLINGEND 0x0013
   4940 #define EVENT_SYSTEM_SWITCHSTART 0x0014
   4941 #define EVENT_SYSTEM_SWITCHEND 0x0015
   4942 #define EVENT_SYSTEM_MINIMIZESTART 0x0016
   4943 #define EVENT_SYSTEM_MINIMIZEEND 0x0017
   4944 
   4945 #define EVENT_CONSOLE_CARET 0x4001
   4946 #define EVENT_CONSOLE_UPDATE_REGION 0x4002
   4947 #define EVENT_CONSOLE_UPDATE_SIMPLE 0x4003
   4948 #define EVENT_CONSOLE_UPDATE_SCROLL 0x4004
   4949 #define EVENT_CONSOLE_LAYOUT 0x4005
   4950 #define EVENT_CONSOLE_START_APPLICATION 0x4006
   4951 #define EVENT_CONSOLE_END_APPLICATION 0x4007
   4952 
   4953 #define CONSOLE_APPLICATION_16BIT 0x0001
   4954 
   4955 #define CONSOLE_CARET_SELECTION 0x0001
   4956 #define CONSOLE_CARET_VISIBLE 0x0002
   4957 
   4958 #define EVENT_OBJECT_CREATE 0x8000
   4959 #define EVENT_OBJECT_DESTROY 0x8001
   4960 #define EVENT_OBJECT_SHOW 0x8002
   4961 #define EVENT_OBJECT_HIDE 0x8003
   4962 #define EVENT_OBJECT_REORDER 0x8004
   4963 
   4964 #define EVENT_OBJECT_FOCUS 0x8005
   4965 #define EVENT_OBJECT_SELECTION 0x8006
   4966 #define EVENT_OBJECT_SELECTIONADD 0x8007
   4967 #define EVENT_OBJECT_SELECTIONREMOVE 0x8008
   4968 #define EVENT_OBJECT_SELECTIONWITHIN 0x8009
   4969 
   4970 #define EVENT_OBJECT_STATECHANGE 0x800A
   4971 
   4972 #define EVENT_OBJECT_LOCATIONCHANGE 0x800B
   4973 
   4974 #define EVENT_OBJECT_NAMECHANGE 0x800C
   4975 #define EVENT_OBJECT_DESCRIPTIONCHANGE 0x800D
   4976 #define EVENT_OBJECT_VALUECHANGE 0x800E
   4977 #define EVENT_OBJECT_PARENTCHANGE 0x800F
   4978 #define EVENT_OBJECT_HELPCHANGE 0x8010
   4979 #define EVENT_OBJECT_DEFACTIONCHANGE 0x8011
   4980 #define EVENT_OBJECT_ACCELERATORCHANGE 0x8012
   4981 
   4982 #define SOUND_SYSTEM_STARTUP 1
   4983 #define SOUND_SYSTEM_SHUTDOWN 2
   4984 #define SOUND_SYSTEM_BEEP 3
   4985 #define SOUND_SYSTEM_ERROR 4
   4986 #define SOUND_SYSTEM_QUESTION 5
   4987 #define SOUND_SYSTEM_WARNING 6
   4988 #define SOUND_SYSTEM_INFORMATION 7
   4989 #define SOUND_SYSTEM_MAXIMIZE 8
   4990 #define SOUND_SYSTEM_MINIMIZE 9
   4991 #define SOUND_SYSTEM_RESTOREUP 10
   4992 #define SOUND_SYSTEM_RESTOREDOWN 11
   4993 #define SOUND_SYSTEM_APPSTART 12
   4994 #define SOUND_SYSTEM_FAULT 13
   4995 #define SOUND_SYSTEM_APPEND 14
   4996 #define SOUND_SYSTEM_MENUCOMMAND 15
   4997 #define SOUND_SYSTEM_MENUPOPUP 16
   4998 #define CSOUND_SYSTEM 16
   4999 
   5000 #define ALERT_SYSTEM_INFORMATIONAL 1
   5001 #define ALERT_SYSTEM_WARNING 2
   5002 #define ALERT_SYSTEM_ERROR 3
   5003 #define ALERT_SYSTEM_QUERY 4
   5004 #define ALERT_SYSTEM_CRITICAL 5
   5005 #define CALERT_SYSTEM 6
   5006 
   5007   typedef struct tagGUITHREADINFO {
   5008     DWORD cbSize;
   5009     DWORD flags;
   5010     HWND hwndActive;
   5011     HWND hwndFocus;
   5012     HWND hwndCapture;
   5013     HWND hwndMenuOwner;
   5014     HWND hwndMoveSize;
   5015     HWND hwndCaret;
   5016     RECT rcCaret;
   5017   } GUITHREADINFO,*PGUITHREADINFO,*LPGUITHREADINFO;
   5018 
   5019 #define GUI_CARETBLINKING 0x00000001
   5020 #define GUI_INMOVESIZE 0x00000002
   5021 #define GUI_INMENUMODE 0x00000004
   5022 #define GUI_SYSTEMMENUMODE 0x00000008
   5023 #define GUI_POPUPMENUMODE 0x00000010
   5024 #define GUI_16BITTASK 0x00000020
   5025 
   5026 #define GetWindowModuleFileName __MINGW_NAME_AW(GetWindowModuleFileName)
   5027 
   5028   WINUSERAPI WINBOOL WINAPI GetGUIThreadInfo(DWORD idThread,PGUITHREADINFO pgui);
   5029   WINUSERAPI UINT WINAPI GetWindowModuleFileNameA(HWND hwnd,LPSTR pszFileName,UINT cchFileNameMax);
   5030   WINUSERAPI UINT WINAPI GetWindowModuleFileNameW(HWND hwnd,LPWSTR pszFileName,UINT cchFileNameMax);
   5031 
   5032 #ifndef NO_STATE_FLAGS
   5033 #define STATE_SYSTEM_UNAVAILABLE 0x00000001
   5034 #define STATE_SYSTEM_SELECTED 0x00000002
   5035 #define STATE_SYSTEM_FOCUSED 0x00000004
   5036 #define STATE_SYSTEM_PRESSED 0x00000008
   5037 #define STATE_SYSTEM_CHECKED 0x00000010
   5038 #define STATE_SYSTEM_MIXED 0x00000020
   5039 #define STATE_SYSTEM_INDETERMINATE STATE_SYSTEM_MIXED
   5040 #define STATE_SYSTEM_READONLY 0x00000040
   5041 #define STATE_SYSTEM_HOTTRACKED 0x00000080
   5042 #define STATE_SYSTEM_DEFAULT 0x00000100
   5043 #define STATE_SYSTEM_EXPANDED 0x00000200
   5044 #define STATE_SYSTEM_COLLAPSED 0x00000400
   5045 #define STATE_SYSTEM_BUSY 0x00000800
   5046 #define STATE_SYSTEM_FLOATING 0x00001000
   5047 #define STATE_SYSTEM_MARQUEED 0x00002000
   5048 #define STATE_SYSTEM_ANIMATED 0x00004000
   5049 #define STATE_SYSTEM_INVISIBLE 0x00008000
   5050 #define STATE_SYSTEM_OFFSCREEN 0x00010000
   5051 #define STATE_SYSTEM_SIZEABLE 0x00020000
   5052 #define STATE_SYSTEM_MOVEABLE 0x00040000
   5053 #define STATE_SYSTEM_SELFVOICING 0x00080000
   5054 #define STATE_SYSTEM_FOCUSABLE 0x00100000
   5055 #define STATE_SYSTEM_SELECTABLE 0x00200000
   5056 #define STATE_SYSTEM_LINKED 0x00400000
   5057 #define STATE_SYSTEM_TRAVERSED 0x00800000
   5058 #define STATE_SYSTEM_MULTISELECTABLE 0x01000000
   5059 #define STATE_SYSTEM_EXTSELECTABLE 0x02000000
   5060 #define STATE_SYSTEM_ALERT_LOW 0x04000000
   5061 #define STATE_SYSTEM_ALERT_MEDIUM 0x08000000
   5062 #define STATE_SYSTEM_ALERT_HIGH 0x10000000
   5063 #define STATE_SYSTEM_PROTECTED 0x20000000
   5064 #define STATE_SYSTEM_VALID 0x3FFFFFFF
   5065 #endif
   5066 
   5067 #define CCHILDREN_TITLEBAR 5
   5068 #define CCHILDREN_SCROLLBAR 5
   5069 
   5070   typedef struct tagCURSORINFO {
   5071     DWORD cbSize;
   5072     DWORD flags;
   5073     HCURSOR hCursor;
   5074     POINT ptScreenPos;
   5075   } CURSORINFO,*PCURSORINFO,*LPCURSORINFO;
   5076 
   5077 #define CURSOR_SHOWING 0x00000001
   5078 
   5079   WINUSERAPI WINBOOL WINAPI GetCursorInfo(PCURSORINFO pci);
   5080 
   5081   typedef struct tagWINDOWINFO {
   5082     DWORD cbSize;
   5083     RECT rcWindow;
   5084     RECT rcClient;
   5085     DWORD dwStyle;
   5086     DWORD dwExStyle;
   5087     DWORD dwWindowStatus;
   5088     UINT cxWindowBorders;
   5089     UINT cyWindowBorders;
   5090     ATOM atomWindowType;
   5091     WORD wCreatorVersion;
   5092   } WINDOWINFO,*PWINDOWINFO,*LPWINDOWINFO;
   5093 
   5094 #define WS_ACTIVECAPTION 0x0001
   5095 
   5096   WINUSERAPI WINBOOL WINAPI GetWindowInfo(HWND hwnd,PWINDOWINFO pwi);
   5097 
   5098   typedef struct tagTITLEBARINFO {
   5099     DWORD cbSize;
   5100     RECT rcTitleBar;
   5101     DWORD rgstate[CCHILDREN_TITLEBAR + 1];
   5102   } TITLEBARINFO,*PTITLEBARINFO,*LPTITLEBARINFO;
   5103 
   5104   WINUSERAPI WINBOOL WINAPI GetTitleBarInfo(HWND hwnd,PTITLEBARINFO pti);
   5105 
   5106   typedef struct tagMENUBARINFO {
   5107     DWORD cbSize;
   5108     RECT rcBar;
   5109     HMENU hMenu;
   5110     HWND hwndMenu;
   5111     WINBOOL fBarFocused:1;
   5112     WINBOOL fFocused:1;
   5113   } MENUBARINFO,*PMENUBARINFO,*LPMENUBARINFO;
   5114 
   5115   WINUSERAPI WINBOOL WINAPI GetMenuBarInfo(HWND hwnd,LONG idObject,LONG idItem,PMENUBARINFO pmbi);
   5116 
   5117   typedef struct tagSCROLLBARINFO {
   5118     DWORD cbSize;
   5119     RECT rcScrollBar;
   5120     int dxyLineButton;
   5121     int xyThumbTop;
   5122     int xyThumbBottom;
   5123     int reserved;
   5124     DWORD rgstate[CCHILDREN_SCROLLBAR + 1];
   5125   } SCROLLBARINFO,*PSCROLLBARINFO,*LPSCROLLBARINFO;
   5126 
   5127   WINUSERAPI WINBOOL WINAPI GetScrollBarInfo(HWND hwnd,LONG idObject,PSCROLLBARINFO psbi);
   5128 
   5129   typedef struct tagCOMBOBOXINFO {
   5130     DWORD cbSize;
   5131     RECT rcItem;
   5132     RECT rcButton;
   5133     DWORD stateButton;
   5134     HWND hwndCombo;
   5135     HWND hwndItem;
   5136     HWND hwndList;
   5137   } COMBOBOXINFO,*PCOMBOBOXINFO,*LPCOMBOBOXINFO;
   5138 
   5139   WINUSERAPI WINBOOL WINAPI GetComboBoxInfo(HWND hwndCombo,PCOMBOBOXINFO pcbi);
   5140 
   5141 #define GA_PARENT 1
   5142 #define GA_ROOT 2
   5143 #define GA_ROOTOWNER 3
   5144 
   5145   WINUSERAPI HWND WINAPI GetAncestor(HWND hwnd,UINT gaFlags);
   5146   WINUSERAPI HWND WINAPI RealChildWindowFromPoint(HWND hwndParent,POINT ptParentClientCoords);
   5147   WINUSERAPI UINT WINAPI RealGetWindowClassA(HWND hwnd,LPSTR ptszClassName,UINT cchClassNameMax);
   5148   WINUSERAPI UINT WINAPI RealGetWindowClassW(HWND hwnd,LPWSTR ptszClassName,UINT cchClassNameMax);
   5149 
   5150 #define RealGetWindowClass __MINGW_NAME_AW(RealGetWindowClass)
   5151 
   5152   typedef struct tagALTTABINFO {
   5153     DWORD cbSize;
   5154     int cItems;
   5155     int cColumns;
   5156     int cRows;
   5157     int iColFocus;
   5158     int iRowFocus;
   5159     int cxItem;
   5160     int cyItem;
   5161     POINT ptStart;
   5162   } ALTTABINFO,*PALTTABINFO,*LPALTTABINFO;
   5163 
   5164 #define GetAltTabInfo __MINGW_NAME_AW(GetAltTabInfo)
   5165 
   5166   WINUSERAPI WINBOOL WINAPI GetAltTabInfoA(HWND hwnd,int iItem,PALTTABINFO pati,LPSTR pszItemText,UINT cchItemText);
   5167   WINUSERAPI WINBOOL WINAPI GetAltTabInfoW(HWND hwnd,int iItem,PALTTABINFO pati,LPWSTR pszItemText,UINT cchItemText);
   5168   WINUSERAPI DWORD WINAPI GetListBoxInfo(HWND hwnd);
   5169 #endif
   5170 
   5171   WINUSERAPI WINBOOL WINAPI LockWorkStation(VOID);
   5172   WINUSERAPI WINBOOL WINAPI UserHandleGrantAccess(HANDLE hUserHandle,HANDLE hJob,WINBOOL bGrant);
   5173 
   5174   DECLARE_HANDLE(HRAWINPUT);
   5175 
   5176 #define GET_RAWINPUT_CODE_WPARAM(wParam) ((wParam) & 0xff)
   5177 
   5178 #define RIM_INPUT 0
   5179 #define RIM_INPUTSINK 1
   5180 
   5181   typedef struct tagRAWINPUTHEADER {
   5182     DWORD dwType;
   5183     DWORD dwSize;
   5184     HANDLE hDevice;
   5185     WPARAM wParam;
   5186   } RAWINPUTHEADER,*PRAWINPUTHEADER,*LPRAWINPUTHEADER;
   5187 
   5188 #define RIM_TYPEMOUSE 0
   5189 #define RIM_TYPEKEYBOARD 1
   5190 #define RIM_TYPEHID 2
   5191 
   5192   typedef struct tagRAWMOUSE {
   5193     USHORT usFlags;
   5194     __C89_NAMELESS union {
   5195       ULONG ulButtons;
   5196       __C89_NAMELESS struct {
   5197 	USHORT usButtonFlags;
   5198 	USHORT usButtonData;
   5199       };
   5200     };
   5201     ULONG ulRawButtons;
   5202     LONG lLastX;
   5203     LONG lLastY;
   5204     ULONG ulExtraInformation;
   5205   } RAWMOUSE,*PRAWMOUSE,*LPRAWMOUSE;
   5206 
   5207 #define RI_MOUSE_LEFT_BUTTON_DOWN 0x0001
   5208 #define RI_MOUSE_LEFT_BUTTON_UP 0x0002
   5209 #define RI_MOUSE_RIGHT_BUTTON_DOWN 0x0004
   5210 #define RI_MOUSE_RIGHT_BUTTON_UP 0x0008
   5211 #define RI_MOUSE_MIDDLE_BUTTON_DOWN 0x0010
   5212 #define RI_MOUSE_MIDDLE_BUTTON_UP 0x0020
   5213 
   5214 #define RI_MOUSE_BUTTON_1_DOWN RI_MOUSE_LEFT_BUTTON_DOWN
   5215 #define RI_MOUSE_BUTTON_1_UP RI_MOUSE_LEFT_BUTTON_UP
   5216 #define RI_MOUSE_BUTTON_2_DOWN RI_MOUSE_RIGHT_BUTTON_DOWN
   5217 #define RI_MOUSE_BUTTON_2_UP RI_MOUSE_RIGHT_BUTTON_UP
   5218 #define RI_MOUSE_BUTTON_3_DOWN RI_MOUSE_MIDDLE_BUTTON_DOWN
   5219 #define RI_MOUSE_BUTTON_3_UP RI_MOUSE_MIDDLE_BUTTON_UP
   5220 
   5221 #define RI_MOUSE_BUTTON_4_DOWN 0x0040
   5222 #define RI_MOUSE_BUTTON_4_UP 0x0080
   5223 #define RI_MOUSE_BUTTON_5_DOWN 0x0100
   5224 #define RI_MOUSE_BUTTON_5_UP 0x0200
   5225 
   5226 #define RI_MOUSE_WHEEL 0x0400
   5227 
   5228 #define MOUSE_MOVE_RELATIVE 0
   5229 #define MOUSE_MOVE_ABSOLUTE 1
   5230 #define MOUSE_VIRTUAL_DESKTOP 0x02
   5231 #define MOUSE_ATTRIBUTES_CHANGED 0x04
   5232 
   5233   typedef struct tagRAWKEYBOARD {
   5234     USHORT MakeCode;
   5235     USHORT Flags;
   5236     USHORT Reserved;
   5237     USHORT VKey;
   5238     UINT Message;
   5239     ULONG ExtraInformation;
   5240   } RAWKEYBOARD,*PRAWKEYBOARD,*LPRAWKEYBOARD;
   5241 
   5242 #define KEYBOARD_OVERRUN_MAKE_CODE 0xFF
   5243 
   5244 #define RI_KEY_MAKE 0
   5245 #define RI_KEY_BREAK 1
   5246 #define RI_KEY_E0 2
   5247 #define RI_KEY_E1 4
   5248 #define RI_KEY_TERMSRV_SET_LED 8
   5249 #define RI_KEY_TERMSRV_SHADOW 0x10
   5250 
   5251   typedef struct tagRAWHID {
   5252     DWORD dwSizeHid;
   5253     DWORD dwCount;
   5254     BYTE bRawData[1];
   5255   } RAWHID,*PRAWHID,*LPRAWHID;
   5256 
   5257   typedef struct tagRAWINPUT {
   5258     RAWINPUTHEADER header;
   5259     union {
   5260       RAWMOUSE mouse;
   5261       RAWKEYBOARD keyboard;
   5262       RAWHID hid;
   5263     } data;
   5264   } RAWINPUT,*PRAWINPUT,*LPRAWINPUT;
   5265 
   5266 #ifdef _WIN64
   5267 #define RAWINPUT_ALIGN(x) (((x) + sizeof(QWORD) - 1) & ~(sizeof(QWORD) - 1))
   5268 #else
   5269 #define RAWINPUT_ALIGN(x) (((x) + sizeof(DWORD) - 1) & ~(sizeof(DWORD) - 1))
   5270 #endif
   5271 
   5272 #define NEXTRAWINPUTBLOCK(ptr) ((PRAWINPUT)RAWINPUT_ALIGN((ULONG_PTR)((PBYTE)(ptr) + (ptr)->header.dwSize)))
   5273 
   5274 #define RID_INPUT 0x10000003
   5275 #define RID_HEADER 0x10000005
   5276 
   5277   WINUSERAPI UINT WINAPI GetRawInputData(HRAWINPUT hRawInput,UINT uiCommand,LPVOID pData,PUINT pcbSize,UINT cbSizeHeader);
   5278 
   5279 #define RIDI_PREPARSEDDATA 0x20000005
   5280 #define RIDI_DEVICENAME 0x20000007
   5281 #define RIDI_DEVICEINFO 0x2000000b
   5282 
   5283   typedef struct tagRID_DEVICE_INFO_MOUSE {
   5284     DWORD dwId;
   5285     DWORD dwNumberOfButtons;
   5286     DWORD dwSampleRate;
   5287   } RID_DEVICE_INFO_MOUSE,*PRID_DEVICE_INFO_MOUSE;
   5288 
   5289   typedef struct tagRID_DEVICE_INFO_KEYBOARD {
   5290     DWORD dwType;
   5291     DWORD dwSubType;
   5292     DWORD dwKeyboardMode;
   5293     DWORD dwNumberOfFunctionKeys;
   5294     DWORD dwNumberOfIndicators;
   5295     DWORD dwNumberOfKeysTotal;
   5296   } RID_DEVICE_INFO_KEYBOARD,*PRID_DEVICE_INFO_KEYBOARD;
   5297 
   5298   typedef struct tagRID_DEVICE_INFO_HID {
   5299     DWORD dwVendorId;
   5300     DWORD dwProductId;
   5301     DWORD dwVersionNumber;
   5302     USHORT usUsagePage;
   5303     USHORT usUsage;
   5304   } RID_DEVICE_INFO_HID,*PRID_DEVICE_INFO_HID;
   5305 
   5306   typedef struct tagRID_DEVICE_INFO {
   5307     DWORD cbSize;
   5308     DWORD dwType;
   5309     __C89_NAMELESS union {
   5310       RID_DEVICE_INFO_MOUSE mouse;
   5311       RID_DEVICE_INFO_KEYBOARD keyboard;
   5312       RID_DEVICE_INFO_HID hid;
   5313     } DUMMYUNIONNAME;
   5314   } RID_DEVICE_INFO,*PRID_DEVICE_INFO,*LPRID_DEVICE_INFO;
   5315 
   5316 #define GetRawInputDeviceInfo __MINGW_NAME_AW(GetRawInputDeviceInfo)
   5317 
   5318   WINUSERAPI UINT WINAPI GetRawInputDeviceInfoA(HANDLE hDevice,UINT uiCommand,LPVOID pData,PUINT pcbSize);
   5319   WINUSERAPI UINT WINAPI GetRawInputDeviceInfoW(HANDLE hDevice,UINT uiCommand,LPVOID pData,PUINT pcbSize);
   5320   WINUSERAPI UINT WINAPI GetRawInputBuffer(PRAWINPUT pData,PUINT pcbSize,UINT cbSizeHeader);
   5321 
   5322   typedef struct tagRAWINPUTDEVICE {
   5323     USHORT usUsagePage;
   5324     USHORT usUsage;
   5325     DWORD dwFlags;
   5326     HWND hwndTarget;
   5327   } RAWINPUTDEVICE,*PRAWINPUTDEVICE,*LPRAWINPUTDEVICE;
   5328 
   5329   typedef CONST RAWINPUTDEVICE *PCRAWINPUTDEVICE;
   5330 
   5331 #define RIDEV_REMOVE 0x00000001
   5332 #define RIDEV_EXCLUDE 0x00000010
   5333 #define RIDEV_PAGEONLY 0x00000020
   5334 #define RIDEV_NOLEGACY 0x00000030
   5335 #define RIDEV_INPUTSINK 0x00000100
   5336 #define RIDEV_CAPTUREMOUSE 0x00000200
   5337 #define RIDEV_NOHOTKEYS 0x00000200
   5338 #define RIDEV_APPKEYS 0x00000400
   5339 #define RIDEV_EXMODEMASK 0x000000F0
   5340 #define RIDEV_EXMODE(mode) ((mode) & RIDEV_EXMODEMASK)
   5341 
   5342 #define MAPVK_VK_TO_VSC    0
   5343 #define MAPVK_VSC_TO_VK    1
   5344 #define MAPVK_VK_TO_CHAR   2
   5345 #define MAPVK_VSC_TO_VK_EX 3
   5346 #if (_WIN32_WINNT >= 0x0600)
   5347 #define MAPVK_VK_TO_VSC_EX 4
   5348 #endif
   5349 
   5350 #if (_WIN32_WINNT >= 0x0601)
   5351 #define WM_TOUCHMOVE 576
   5352 #define WM_TOUCHDOWN 577
   5353 #define WM_TOUCHUP 578
   5354 
   5355 #define TOUCHEVENTF_MOVE        0x0001
   5356 #define TOUCHEVENTF_DOWN        0x0002
   5357 #define TOUCHEVENTF_UP          0x0004
   5358 #define TOUCHEVENTF_INRANGE     0x0008
   5359 #define TOUCHEVENTF_PRIMARY     0x0010
   5360 #define TOUCHEVENTF_NOCOALESCE  0x0020
   5361 #define TOUCHEVENTF_PEN         0x0040
   5362 #define TOUCHEVENTF_PALM        0x0080
   5363 
   5364 #define TOUCHINPUTMASKF_TIMEFROMSYSTEM  0x0001
   5365 #define TOUCHINPUTMASKF_EXTRAINFO       0x0002
   5366 #define TOUCHINPUTMASKF_CONTACTAREA     0x0004
   5367 
   5368 DECLARE_HANDLE(HTOUCHINPUT);
   5369 
   5370   typedef struct _TOUCHINPUT {
   5371     LONG x;
   5372     LONG y;
   5373     HANDLE hSource;
   5374     DWORD dwID;
   5375     DWORD dwFlags;
   5376     DWORD dwMask;
   5377     DWORD dwTime;
   5378     ULONG_PTR dwExtraInfo;
   5379     DWORD cxContact;
   5380     DWORD cyContact;
   5381   } TOUCHINPUT,*PTOUCHINPUT;
   5382 
   5383   WINUSERAPI WINBOOL WINAPI CloseTouchInputHandle(HANDLE hTouchInput);
   5384   WINUSERAPI WINBOOL WINAPI GetTouchInputInfo(HANDLE hTouchInput, UINT cInputs, PTOUCHINPUT pInputs, int cbSize);
   5385   WINUSERAPI WINBOOL WINAPI IsTouchWindow(HWND hWnd,PULONG pulFlags);
   5386   WINUSERAPI WINBOOL WINAPI RegisterTouchWindow(HWND hWnd,ULONG ulFlags);
   5387   WINUSERAPI WINBOOL WINAPI UnregisterTouchWindow(HWND hWnd);
   5388 
   5389 #endif /* (_WIN32_WINNT >= 0x0601) */
   5390 
   5391   WINUSERAPI WINBOOL WINAPI RegisterRawInputDevices(PCRAWINPUTDEVICE pRawInputDevices,UINT uiNumDevices,UINT cbSize);
   5392   WINUSERAPI UINT WINAPI GetRegisteredRawInputDevices(PRAWINPUTDEVICE pRawInputDevices,PUINT puiNumDevices,UINT cbSize);
   5393 
   5394   typedef struct tagRAWINPUTDEVICELIST {
   5395     HANDLE hDevice;
   5396     DWORD dwType;
   5397   } RAWINPUTDEVICELIST,*PRAWINPUTDEVICELIST;
   5398 
   5399   WINUSERAPI UINT WINAPI GetRawInputDeviceList(PRAWINPUTDEVICELIST pRawInputDeviceList,PUINT puiNumDevices,UINT cbSize);
   5400   WINUSERAPI LRESULT WINAPI DefRawInputProc(PRAWINPUT *paRawInput,INT nInput,UINT cbSizeHeader);
   5401 
   5402 #if (_WIN32_WINNT >= 0x0600)
   5403 typedef struct _AUDIODESCRIPTION {
   5404   UINT cbSize;
   5405   BOOL Enabled;
   5406   LCID Locale;
   5407 } AUDIODESCRIPTION, *PAUDIODESCRIPTION;
   5408 
   5409 #ifndef NOGDI
   5410 #define CreateDesktopEx __MINGW_NAME_AW(CreateDesktopEx)
   5411 
   5412 WINUSERAPI HDESK WINAPI CreateDesktopExA(
   5413   LPCSTR lpszDesktop,
   5414   LPCSTR lpszDevice,
   5415   DEVMODE *pDevmode,
   5416   DWORD dwFlags,
   5417   ACCESS_MASK dwDesiredAccess,
   5418   LPSECURITY_ATTRIBUTES lpsa,
   5419   ULONG ulHeapSize,
   5420   PVOID pvoid
   5421 );
   5422 
   5423 WINUSERAPI HDESK WINAPI CreateDesktopExW(
   5424   LPCWSTR lpszDesktop,
   5425   LPCWSTR lpszDevice,
   5426   DEVMODE *pDevmode,
   5427   DWORD dwFlags,
   5428   ACCESS_MASK dwDesiredAccess,
   5429   LPSECURITY_ATTRIBUTES lpsa,
   5430   ULONG ulHeapSize,
   5431   PVOID pvoid
   5432 );
   5433 #endif	/* NOGDI */
   5434 
   5435 WINUSERAPI WINBOOL WINAPI ShutdownBlockReasonCreate(
   5436   HWND hWnd,
   5437   LPCWSTR pwszReason
   5438 );
   5439 
   5440 WINUSERAPI WINBOOL WINAPI ShutdownBlockReasonDestroy(
   5441   HWND hWnd
   5442 );
   5443 
   5444 WINUSERAPI WINBOOL WINAPI ShutdownBlockReasonQuery(
   5445   HWND hWnd,
   5446   LPWSTR pwszBuff,
   5447   DWORD *pcchBuff
   5448 );
   5449 
   5450 #endif /*(_WIN32_WINNT >= 0x0600)*/
   5451 
   5452 #if (_WIN32_WINNT >= 0x0601)
   5453 
   5454 #define GF_BEGIN 0x00000001
   5455 #define GF_INERTIA 0x00000002
   5456 #define GF_END 0x00000004
   5457 
   5458 #define GID_BEGIN 1
   5459 #define GID_END 2
   5460 #define GID_ZOOM 3
   5461 #define GID_PAN 4
   5462 #define GID_ROTATE 5
   5463 #define GID_TWOFINGERTAP 6
   5464 #define GID_PRESSANDTAP 7
   5465 #define GID_ROLLOVER GID_PRESSANDTAP
   5466 
   5467 #define GC_ALLGESTURES 0x00000001
   5468 #define GC_ZOOM 0x00000001
   5469 
   5470 #define GC_PAN 0x00000001
   5471 #define GC_PAN_WITH_SINGLE_FINGER_VERTICALLY 0x00000002
   5472 #define GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY 0x00000004
   5473 #define GC_PAN_WITH_GUTTER 0x00000008
   5474 #define GC_PAN_WITH_INERTIA 0x00000010
   5475 
   5476 #define GC_ROTATE 0x00000001
   5477 #define GC_TWOFINGERTAP 0x00000001
   5478 #define GC_PRESSANDTAP 0x00000001
   5479 #define GC_ROLLOVER GC_PRESSANDTAP
   5480 
   5481 #define GCF_INCLUDE_ANCESTORS 0x00000001
   5482 
   5483 #define GESTURECONFIGMAXCOUNT 256
   5484 
   5485 DECLARE_HANDLE(HGESTUREINFO);
   5486 
   5487 #define GID_ROTATE_ANGLE_TO_ARGUMENT(_arg_) ((USHORT)((((_arg_) + 2.0 * 3.14159265) / (4.0 * 3.14159265)) * 65535.0))
   5488 #define GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_) ((((double)(_arg_) /65535.0) * 4.0 * 3.14159265) - 2.0 * 3.14159265)
   5489 
   5490 typedef struct _GESTUREINFO {
   5491   UINT      cbSize;
   5492   DWORD     dwFlags;
   5493   DWORD     dwID;
   5494   HWND      hwndTarget;
   5495   POINTS    ptsLocation;
   5496   DWORD     dwInstanceID;
   5497   DWORD     dwSequenceID;
   5498   ULONGLONG ullArguments;
   5499   UINT      cbExtraArgs;
   5500 } GESTUREINFO, *PGESTUREINFO;
   5501 
   5502 typedef GESTUREINFO const * PCGESTUREINFO;
   5503 
   5504 typedef struct tagGESTURENOTIFYSTRUCT {
   5505   UINT   cbSize;
   5506   DWORD  dwFlags;
   5507   HWND   hwndTarget;
   5508   POINTS ptsLocation;
   5509   DWORD  dwInstanceID;
   5510 } GESTURENOTIFYSTRUCT, *PGESTURENOTIFYSTRUCT;
   5511 
   5512 typedef struct _GESTURECONFIG {
   5513   DWORD dwID;
   5514   DWORD dwWant;
   5515   DWORD dwBlock;
   5516 } GESTURECONFIG, *PGESTURECONFIG;
   5517 
   5518 WINUSERAPI WINBOOL WINAPI SetGestureConfig(
   5519   HWND hwnd,
   5520   DWORD dwReserved,
   5521   UINT cIDs,
   5522   PGESTURECONFIG pGestureConfig,
   5523   UINT cbSize
   5524 );
   5525 
   5526 WINUSERAPI WINBOOL WINAPI GetGestureConfig(
   5527   HWND hwnd,
   5528   DWORD dwReserved,
   5529   DWORD dwFlags,
   5530   PUINT pcIDs,
   5531   PGESTURECONFIG pGestureConfig,
   5532   UINT cbSize
   5533 );
   5534 
   5535 WINUSERAPI WINBOOL WINAPI GetGestureInfo(
   5536   HGESTUREINFO hGestureInfo,
   5537   PGESTUREINFO pGestureInfo
   5538 );
   5539 
   5540 WINUSERAPI WINBOOL WINAPI GetGestureExtraArgs(
   5541   HGESTUREINFO hGestureInfo,
   5542   UINT cbExtraArgs,
   5543   PBYTE pExtraArgs
   5544 );
   5545 
   5546 WINUSERAPI WINBOOL WINAPI CloseGestureInfoHandle(
   5547     HGESTUREINFO hGestureInfo
   5548 );
   5549 
   5550 #endif /*(_WIN32_WINNT >= 0x0601)*/
   5551 
   5552 #endif /* NOUSER */
   5553 
   5554 #ifdef __cplusplus
   5555 }
   5556 #endif
   5557 #endif
   5558