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