home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / WINUSER.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  231.6 KB  |  10,153 lines

  1. /****************************************************************************
  2. *                                                                           *
  3. * winuser.h -- USER procedure declarations, constant definitions and macros *
  4. *                                                                           *
  5. * Copyright (c) 1985-1997, Microsoft Corp. All rights reserved.             *
  6. *                                                                           *
  7. ****************************************************************************/
  8.  
  9.  
  10. #ifndef _WINUSER_
  11. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  12. #define _WINUSER_
  13.  
  14. //
  15. // Define API decoration for direct importing of DLL references.
  16. //
  17.  
  18. #if !defined(_USER32_)
  19. #define WINUSERAPI DECLSPEC_IMPORT
  20. #else
  21. #define WINUSERAPI
  22. #endif
  23.  
  24. #ifdef _MAC
  25. #include <macwin32.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif /* __cplusplus */
  31.  
  32. #ifndef WINVER
  33. #define WINVER  0x0500      /* version 5.0 */
  34. #endif /* !WINVER */
  35.  
  36. #include <stdarg.h>
  37.  
  38. #ifndef NOUSER
  39.  
  40. typedef HANDLE HDWP;
  41. typedef VOID MENUTEMPLATEA;
  42. typedef VOID MENUTEMPLATEW;
  43. #ifdef UNICODE
  44. typedef MENUTEMPLATEW MENUTEMPLATE;
  45. #else
  46. typedef MENUTEMPLATEA MENUTEMPLATE;
  47. #endif // UNICODE
  48. typedef PVOID LPMENUTEMPLATEA;
  49. typedef PVOID LPMENUTEMPLATEW;
  50. #ifdef UNICODE
  51. typedef LPMENUTEMPLATEW LPMENUTEMPLATE;
  52. #else
  53. typedef LPMENUTEMPLATEA LPMENUTEMPLATE;
  54. #endif // UNICODE
  55.  
  56. typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
  57.  
  58. #ifdef STRICT
  59.  
  60. typedef BOOL (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);
  61. typedef VOID (CALLBACK* TIMERPROC)(HWND, UINT, UINT, DWORD);
  62. typedef BOOL (CALLBACK* GRAYSTRINGPROC)(HDC, LPARAM, int);
  63. typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
  64. typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
  65. typedef VOID (CALLBACK* SENDASYNCPROC)(HWND, UINT, DWORD, LRESULT);
  66.  
  67. typedef BOOL (CALLBACK* PROPENUMPROCA)(HWND, LPCSTR, HANDLE);
  68. typedef BOOL (CALLBACK* PROPENUMPROCW)(HWND, LPCWSTR, HANDLE);
  69.  
  70. typedef BOOL (CALLBACK* PROPENUMPROCEXA)(HWND, LPSTR, HANDLE, DWORD);
  71. typedef BOOL (CALLBACK* PROPENUMPROCEXW)(HWND, LPWSTR, HANDLE, DWORD);
  72.  
  73. typedef int (CALLBACK* EDITWORDBREAKPROCA)(LPSTR lpch, int ichCurrent, int cch, int code);
  74. typedef int (CALLBACK* EDITWORDBREAKPROCW)(LPWSTR lpch, int ichCurrent, int cch, int code);
  75.  
  76. #if(WINVER >= 0x0400)
  77. typedef BOOL (CALLBACK* DRAWSTATEPROC)(HDC hdc, LPARAM lData, WPARAM wData, int cx, int cy);
  78. #endif /* WINVER >= 0x0400 */
  79. #else /* !STRICT */
  80.  
  81. typedef FARPROC DLGPROC;
  82. typedef FARPROC TIMERPROC;
  83. typedef FARPROC GRAYSTRINGPROC;
  84. typedef FARPROC WNDENUMPROC;
  85. typedef FARPROC HOOKPROC;
  86. typedef FARPROC SENDASYNCPROC;
  87.  
  88. typedef FARPROC EDITWORDBREAKPROCA;
  89. typedef FARPROC EDITWORDBREAKPROCW;
  90.  
  91. typedef FARPROC PROPENUMPROCA;
  92. typedef FARPROC PROPENUMPROCW;
  93.  
  94. typedef FARPROC PROPENUMPROCEXA;
  95. typedef FARPROC PROPENUMPROCEXW;
  96.  
  97. #if(WINVER >= 0x0400)
  98. typedef FARPROC DRAWSTATEPROC;
  99. #endif /* WINVER >= 0x0400 */
  100. #endif /* !STRICT */
  101.  
  102. #ifdef UNICODE
  103. typedef PROPENUMPROCW        PROPENUMPROC;
  104. typedef PROPENUMPROCEXW      PROPENUMPROCEX;
  105. typedef EDITWORDBREAKPROCW   EDITWORDBREAKPROC;
  106. #else  /* !UNICODE */
  107. typedef PROPENUMPROCA        PROPENUMPROC;
  108. typedef PROPENUMPROCEXA      PROPENUMPROCEX;
  109. typedef EDITWORDBREAKPROCA   EDITWORDBREAKPROC;
  110. #endif /* UNICODE */
  111.  
  112. #ifdef STRICT
  113.  
  114. typedef BOOL (CALLBACK* NAMEENUMPROCA)(LPSTR, LPARAM);
  115. typedef BOOL (CALLBACK* NAMEENUMPROCW)(LPWSTR, LPARAM);
  116.  
  117. typedef NAMEENUMPROCA   WINSTAENUMPROCA;
  118. typedef NAMEENUMPROCA   DESKTOPENUMPROCA;
  119. typedef NAMEENUMPROCW   WINSTAENUMPROCW;
  120. typedef NAMEENUMPROCW   DESKTOPENUMPROCW;
  121.  
  122.  
  123. #else /* !STRICT */
  124.  
  125. typedef FARPROC NAMEENUMPROCA;
  126. typedef FARPROC NAMEENUMPROCW;
  127. typedef FARPROC WINSTAENUMPROCA;
  128. typedef FARPROC DESKTOPENUMPROCA;
  129. typedef FARPROC WINSTAENUMPROCW;
  130. typedef FARPROC DESKTOPENUMPROCW;
  131.  
  132.  
  133. #endif /* !STRICT */
  134.  
  135. #ifdef UNICODE
  136. typedef WINSTAENUMPROCW     WINSTAENUMPROC;
  137. typedef DESKTOPENUMPROCW    DESKTOPENUMPROC;
  138.  
  139.  
  140. #else  /* !UNICODE */
  141. typedef WINSTAENUMPROCA     WINSTAENUMPROC;
  142. typedef DESKTOPENUMPROCA    DESKTOPENUMPROC;
  143.  
  144. #endif /* UNICODE */
  145.  
  146. #define MAKEINTRESOURCEA(i) (LPSTR)((DWORD)((WORD)(i)))
  147. #define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
  148. #ifdef UNICODE
  149. #define MAKEINTRESOURCE  MAKEINTRESOURCEW
  150. #else
  151. #define MAKEINTRESOURCE  MAKEINTRESOURCEA
  152. #endif // !UNICODE
  153.  
  154. #ifndef NORESOURCE
  155.  
  156. /*
  157.  * Predefined Resource Types
  158.  */
  159. #define RT_CURSOR           MAKEINTRESOURCE(1)
  160. #define RT_BITMAP           MAKEINTRESOURCE(2)
  161. #define RT_ICON             MAKEINTRESOURCE(3)
  162. #define RT_MENU             MAKEINTRESOURCE(4)
  163. #define RT_DIALOG           MAKEINTRESOURCE(5)
  164. #define RT_STRING           MAKEINTRESOURCE(6)
  165. #define RT_FONTDIR          MAKEINTRESOURCE(7)
  166. #define RT_FONT             MAKEINTRESOURCE(8)
  167. #define RT_ACCELERATOR      MAKEINTRESOURCE(9)
  168. #define RT_RCDATA           MAKEINTRESOURCE(10)
  169. #define RT_MESSAGETABLE     MAKEINTRESOURCE(11)
  170.  
  171. #define DIFFERENCE          11
  172. #define RT_GROUP_CURSOR MAKEINTRESOURCE((DWORD)RT_CURSOR + DIFFERENCE)
  173. #define RT_GROUP_ICON   MAKEINTRESOURCE((DWORD)RT_ICON + DIFFERENCE)
  174. #define RT_VERSION      MAKEINTRESOURCE(16)
  175. #define RT_DLGINCLUDE   MAKEINTRESOURCE(17)
  176. #if(WINVER >= 0x0400)
  177. #define RT_PLUGPLAY     MAKEINTRESOURCE(19)
  178. #define RT_VXD          MAKEINTRESOURCE(20)
  179. #define RT_ANICURSOR    MAKEINTRESOURCE(21)
  180. #define RT_ANIICON      MAKEINTRESOURCE(22)
  181. #endif /* WINVER >= 0x0400 */
  182. #define RT_HTML         MAKEINTRESOURCE(23)
  183.  
  184. #endif /* !NORESOURCE */
  185.  
  186. WINUSERAPI
  187. int
  188. WINAPI
  189. wvsprintfA(
  190.     LPSTR,
  191.     LPCSTR,
  192.     va_list arglist);
  193. WINUSERAPI
  194. int
  195. WINAPI
  196. wvsprintfW(
  197.     LPWSTR,
  198.     LPCWSTR,
  199.     va_list arglist);
  200. #ifdef UNICODE
  201. #define wvsprintf  wvsprintfW
  202. #else
  203. #define wvsprintf  wvsprintfA
  204. #endif // !UNICODE
  205.  
  206. WINUSERAPI int WINAPIV wsprintfA(LPSTR, LPCSTR, ...);
  207. WINUSERAPI int WINAPIV wsprintfW(LPWSTR, LPCWSTR, ...);
  208. #ifdef UNICODE
  209. #define wsprintf  wsprintfW
  210. #else
  211. #define wsprintf  wsprintfA
  212. #endif // !UNICODE
  213.  
  214. #ifndef NOSCROLL
  215.  
  216. /*
  217.  * Scroll Bar Constants
  218.  */
  219. #define SB_HORZ             0
  220. #define SB_VERT             1
  221. #define SB_CTL              2
  222. #define SB_BOTH             3
  223.  
  224. /*
  225.  * Scroll Bar Commands
  226.  */
  227. #define SB_LINEUP           0
  228. #define SB_LINELEFT         0
  229. #define SB_LINEDOWN         1
  230. #define SB_LINERIGHT        1
  231. #define SB_PAGEUP           2
  232. #define SB_PAGELEFT         2
  233. #define SB_PAGEDOWN         3
  234. #define SB_PAGERIGHT        3
  235. #define SB_THUMBPOSITION    4
  236. #define SB_THUMBTRACK       5
  237. #define SB_TOP              6
  238. #define SB_LEFT             6
  239. #define SB_BOTTOM           7
  240. #define SB_RIGHT            7
  241. #define SB_ENDSCROLL        8
  242.  
  243. #endif /* !NOSCROLL */
  244.  
  245. #ifndef NOSHOWWINDOW
  246.  
  247. // begin_r_winuser
  248.  
  249. /*
  250.  * ShowWindow() Commands
  251.  */
  252. #define SW_HIDE             0
  253. #define SW_SHOWNORMAL       1
  254. #define SW_NORMAL           1
  255. #define SW_SHOWMINIMIZED    2
  256. #define SW_SHOWMAXIMIZED    3
  257. #define SW_MAXIMIZE         3
  258. #define SW_SHOWNOACTIVATE   4
  259. #define SW_SHOW             5
  260. #define SW_MINIMIZE         6
  261. #define SW_SHOWMINNOACTIVE  7
  262. #define SW_SHOWNA           8
  263. #define SW_RESTORE          9
  264. #define SW_SHOWDEFAULT      10
  265. #define SW_FORCEMINIMIZE    11
  266. #define SW_MAX              11
  267.  
  268. /*
  269.  * Old ShowWindow() Commands
  270.  */
  271. #define HIDE_WINDOW         0
  272. #define SHOW_OPENWINDOW     1
  273. #define SHOW_ICONWINDOW     2
  274. #define SHOW_FULLSCREEN     3
  275. #define SHOW_OPENNOACTIVATE 4
  276.  
  277. /*
  278.  * Identifiers for the WM_SHOWWINDOW message
  279.  */
  280. #define SW_PARENTCLOSING    1
  281. #define SW_OTHERZOOM        2
  282. #define SW_PARENTOPENING    3
  283. #define SW_OTHERUNZOOM      4
  284.  
  285. // end_r_winuser
  286.  
  287. #endif /* !NOSHOWWINDOW */
  288.  
  289. #if(WINVER >= 0x0500)
  290. /*
  291.  * AnimateWindow() Commands
  292.  */
  293. #define AW_HOR_POSITIVE             0x00000001
  294. #define AW_HOR_NEGATIVE             0x00000002
  295. #define AW_VER_POSITIVE             0x00000004
  296. #define AW_VER_NEGATIVE             0x00000008
  297. #define AW_CENTER                   0x00000010
  298. #define AW_HIDE                     0x00010000
  299. #define AW_ACTIVATE                 0x00020000
  300. #define AW_SLIDE                    0x00040000
  301. #define AW_BLEND                    0x00080000
  302.  
  303. #endif /* WINVER >= 0x0500 */
  304.  
  305. /*
  306.  * WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags
  307.  */
  308. #define KF_EXTENDED         0x0100
  309. #define KF_DLGMODE          0x0800
  310. #define KF_MENUMODE         0x1000
  311. #define KF_ALTDOWN          0x2000
  312. #define KF_REPEAT           0x4000
  313. #define KF_UP               0x8000
  314.  
  315. #ifndef NOVIRTUALKEYCODES
  316.  
  317. // begin_r_winuser
  318.  
  319. /*
  320.  * Virtual Keys, Standard Set
  321.  */
  322. #define VK_LBUTTON        0x01
  323. #define VK_RBUTTON        0x02
  324. #define VK_CANCEL         0x03
  325. #define VK_MBUTTON        0x04    /* NOT contiguous with L & RBUTTON */
  326.  
  327. #define VK_BACK           0x08
  328. #define VK_TAB            0x09
  329.  
  330. #define VK_CLEAR          0x0C
  331. #define VK_RETURN         0x0D
  332.  
  333. #define VK_SHIFT          0x10
  334. #define VK_CONTROL        0x11
  335. #define VK_MENU           0x12
  336. #define VK_PAUSE          0x13
  337. #define VK_CAPITAL        0x14
  338.  
  339. #define VK_KANA           0x15
  340. #define VK_HANGEUL        0x15  /* old name - should be here for compatibility */
  341. #define VK_HANGUL         0x15
  342. #define VK_JUNJA          0x17
  343. #define VK_FINAL          0x18
  344. #define VK_HANJA          0x19
  345. #define VK_KANJI          0x19
  346.  
  347. #define VK_ESCAPE         0x1B
  348.  
  349. #define VK_CONVERT        0x1C
  350. #define VK_NONCONVERT     0x1D
  351. #define VK_ACCEPT         0x1E
  352. #define VK_MODECHANGE     0x1F
  353.  
  354. #define VK_SPACE          0x20
  355. #define VK_PRIOR          0x21
  356. #define VK_NEXT           0x22
  357. #define VK_END            0x23
  358. #define VK_HOME           0x24
  359. #define VK_LEFT           0x25
  360. #define VK_UP             0x26
  361. #define VK_RIGHT          0x27
  362. #define VK_DOWN           0x28
  363. #define VK_SELECT         0x29
  364. #define VK_PRINT          0x2A
  365. #define VK_EXECUTE        0x2B
  366. #define VK_SNAPSHOT       0x2C
  367. #define VK_INSERT         0x2D
  368. #define VK_DELETE         0x2E
  369. #define VK_HELP           0x2F
  370.  
  371. /* VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */
  372. /* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */
  373.  
  374. #define VK_LWIN           0x5B
  375. #define VK_RWIN           0x5C
  376. #define VK_APPS           0x5D
  377.  
  378. #define VK_NUMPAD0        0x60
  379. #define VK_NUMPAD1        0x61
  380. #define VK_NUMPAD2        0x62
  381. #define VK_NUMPAD3        0x63
  382. #define VK_NUMPAD4        0x64
  383. #define VK_NUMPAD5        0x65
  384. #define VK_NUMPAD6        0x66
  385. #define VK_NUMPAD7        0x67
  386. #define VK_NUMPAD8        0x68
  387. #define VK_NUMPAD9        0x69
  388. #define VK_MULTIPLY       0x6A
  389. #define VK_ADD            0x6B
  390. #define VK_SEPARATOR      0x6C
  391. #define VK_SUBTRACT       0x6D
  392. #define VK_DECIMAL        0x6E
  393. #define VK_DIVIDE         0x6F
  394. #define VK_F1             0x70
  395. #define VK_F2             0x71
  396. #define VK_F3             0x72
  397. #define VK_F4             0x73
  398. #define VK_F5             0x74
  399. #define VK_F6             0x75
  400. #define VK_F7             0x76
  401. #define VK_F8             0x77
  402. #define VK_F9             0x78
  403. #define VK_F10            0x79
  404. #define VK_F11            0x7A
  405. #define VK_F12            0x7B
  406. #define VK_F13            0x7C
  407. #define VK_F14            0x7D
  408. #define VK_F15            0x7E
  409. #define VK_F16            0x7F
  410. #define VK_F17            0x80
  411. #define VK_F18            0x81
  412. #define VK_F19            0x82
  413. #define VK_F20            0x83
  414. #define VK_F21            0x84
  415. #define VK_F22            0x85
  416. #define VK_F23            0x86
  417. #define VK_F24            0x87
  418.  
  419. #define VK_NUMLOCK        0x90
  420. #define VK_SCROLL         0x91
  421.  
  422. /*
  423.  * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
  424.  * Used only as parameters to GetAsyncKeyState() and GetKeyState().
  425.  * No other API or message will distinguish left and right keys in this way.
  426.  */
  427. #define VK_LSHIFT         0xA0
  428. #define VK_RSHIFT         0xA1
  429. #define VK_LCONTROL       0xA2
  430. #define VK_RCONTROL       0xA3
  431. #define VK_LMENU          0xA4
  432. #define VK_RMENU          0xA5
  433.  
  434. #if(WINVER >= 0x0400)
  435. #define VK_PROCESSKEY     0xE5
  436. #endif /* WINVER >= 0x0400 */
  437.  
  438. #define VK_ATTN           0xF6
  439. #define VK_CRSEL          0xF7
  440. #define VK_EXSEL          0xF8
  441. #define VK_EREOF          0xF9
  442. #define VK_PLAY           0xFA
  443. #define VK_ZOOM           0xFB
  444. #define VK_NONAME         0xFC
  445. #define VK_PA1            0xFD
  446. #define VK_OEM_CLEAR      0xFE
  447.  
  448. // end_r_winuser
  449.  
  450. #endif /* !NOVIRTUALKEYCODES */
  451.  
  452. #ifndef NOWH
  453.  
  454. /*
  455.  * SetWindowsHook() codes
  456.  */
  457. #define WH_MIN              (-1)
  458. #define WH_MSGFILTER        (-1)
  459. #define WH_JOURNALRECORD    0
  460. #define WH_JOURNALPLAYBACK  1
  461. #define WH_KEYBOARD         2
  462. #define WH_GETMESSAGE       3
  463. #define WH_CALLWNDPROC      4
  464. #define WH_CBT              5
  465. #define WH_SYSMSGFILTER     6
  466. #define WH_MOUSE            7
  467. #define WH_HARDWARE         8
  468. #define WH_DEBUG            9
  469. #define WH_SHELL           10
  470. #define WH_FOREGROUNDIDLE  11
  471. #if(WINVER >= 0x0400)
  472. #define WH_CALLWNDPROCRET  12
  473. #endif /* WINVER >= 0x0400 */
  474.  
  475. #if (_WIN32_WINNT >= 0x0400)
  476. #define WH_KEYBOARD_LL     13
  477. #define WH_MOUSE_LL        14
  478. #endif // (_WIN32_WINNT >= 0x0400)
  479.  
  480. #if(WINVER >= 0x0400)
  481. #if (_WIN32_WINNT >= 0x0400)
  482. #define WH_MAX             14
  483. #else
  484. #define WH_MAX             12
  485. #endif // (_WIN32_WINNT >= 0x0400)
  486. #else
  487. #define WH_MAX             11
  488. #endif
  489.  
  490. #define WH_MINHOOK         WH_MIN
  491. #define WH_MAXHOOK         WH_MAX
  492.  
  493. /*
  494.  * Hook Codes
  495.  */
  496. #define HC_ACTION           0
  497. #define HC_GETNEXT          1
  498. #define HC_SKIP             2
  499. #define HC_NOREMOVE         3
  500. #define HC_NOREM            HC_NOREMOVE
  501. #define HC_SYSMODALON       4
  502. #define HC_SYSMODALOFF      5
  503.  
  504. /*
  505.  * CBT Hook Codes
  506.  */
  507. #define HCBT_MOVESIZE       0
  508. #define HCBT_MINMAX         1
  509. #define HCBT_QS             2
  510. #define HCBT_CREATEWND      3
  511. #define HCBT_DESTROYWND     4
  512. #define HCBT_ACTIVATE       5
  513. #define HCBT_CLICKSKIPPED   6
  514. #define HCBT_KEYSKIPPED     7
  515. #define HCBT_SYSCOMMAND     8
  516. #define HCBT_SETFOCUS       9
  517.  
  518. /*
  519.  * HCBT_CREATEWND parameters pointed to by lParam
  520.  */
  521. typedef struct tagCBT_CREATEWNDA
  522. {
  523.     struct tagCREATESTRUCTA *lpcs;
  524.     HWND           hwndInsertAfter;
  525. } CBT_CREATEWNDA, *LPCBT_CREATEWNDA;
  526. /*
  527.  * HCBT_CREATEWND parameters pointed to by lParam
  528.  */
  529. typedef struct tagCBT_CREATEWNDW
  530. {
  531.     struct tagCREATESTRUCTW *lpcs;
  532.     HWND           hwndInsertAfter;
  533. } CBT_CREATEWNDW, *LPCBT_CREATEWNDW;
  534. #ifdef UNICODE
  535. typedef CBT_CREATEWNDW CBT_CREATEWND;
  536. typedef LPCBT_CREATEWNDW LPCBT_CREATEWND;
  537. #else
  538. typedef CBT_CREATEWNDA CBT_CREATEWND;
  539. typedef LPCBT_CREATEWNDA LPCBT_CREATEWND;
  540. #endif // UNICODE
  541.  
  542. /*
  543.  * HCBT_ACTIVATE structure pointed to by lParam
  544.  */
  545. typedef struct tagCBTACTIVATESTRUCT
  546. {
  547.     BOOL    fMouse;
  548.     HWND    hWndActive;
  549. } CBTACTIVATESTRUCT, *LPCBTACTIVATESTRUCT;
  550.  
  551. /*
  552.  * WH_MSGFILTER Filter Proc Codes
  553.  */
  554. #define MSGF_DIALOGBOX      0
  555. #define MSGF_MESSAGEBOX     1
  556. #define MSGF_MENU           2
  557. #define MSGF_SCROLLBAR      5
  558. #define MSGF_NEXTWINDOW     6
  559. #define MSGF_MAX            8                       // unused
  560. #define MSGF_USER           4096
  561.  
  562. /*
  563.  * Shell support
  564.  */
  565. #define HSHELL_WINDOWCREATED        1
  566. #define HSHELL_WINDOWDESTROYED      2
  567. #define HSHELL_ACTIVATESHELLWINDOW  3
  568.  
  569. #if(WINVER >= 0x0400)
  570. #define HSHELL_WINDOWACTIVATED      4
  571. #define HSHELL_GETMINRECT           5
  572. #define HSHELL_REDRAW               6
  573. #define HSHELL_TASKMAN              7
  574. #define HSHELL_LANGUAGE             8
  575. #if(_WIN32_WINNT >= 0x0500)
  576. #define HSHELL_ACCESSIBILITYSTATE   11
  577. #define    ACCESS_STICKYKEYS            0x0001
  578. #define    ACCESS_FILTERKEYS            0x0002
  579. #define    ACCESS_MOUSEKEYS             0x0003
  580. #endif /* _WIN32_WINNT >= 0x0500 */
  581. #endif /* WINVER >= 0x0400 */
  582.  
  583.  
  584. /*
  585.  * Message Structure used in Journaling
  586.  */
  587. typedef struct tagEVENTMSG {
  588.     UINT    message;
  589.     UINT    paramL;
  590.     UINT    paramH;
  591.     DWORD    time;
  592.     HWND     hwnd;
  593. } EVENTMSG, *PEVENTMSGMSG, NEAR *NPEVENTMSGMSG, FAR *LPEVENTMSGMSG;
  594.  
  595. typedef struct tagEVENTMSG *PEVENTMSG, NEAR *NPEVENTMSG, FAR *LPEVENTMSG;
  596.  
  597. /*
  598.  * Message structure used by WH_CALLWNDPROC
  599.  */
  600. typedef struct tagCWPSTRUCT {
  601.     LPARAM  lParam;
  602.     WPARAM  wParam;
  603.     UINT    message;
  604.     HWND    hwnd;
  605. } CWPSTRUCT, *PCWPSTRUCT, NEAR *NPCWPSTRUCT, FAR *LPCWPSTRUCT;
  606.  
  607. #if(WINVER >= 0x0400)
  608. /*
  609.  * Message structure used by WH_CALLWNDPROCRET
  610.  */
  611. typedef struct tagCWPRETSTRUCT {
  612.     LRESULT lResult;
  613.     LPARAM  lParam;
  614.     WPARAM  wParam;
  615.     UINT    message;
  616.     HWND    hwnd;
  617. } CWPRETSTRUCT, *PCWPRETSTRUCT, NEAR *NPCWPRETSTRUCT, FAR *LPCWPRETSTRUCT;
  618.  
  619. #endif /* WINVER >= 0x0400 */
  620.  
  621. #if (_WIN32_WINNT >= 0x0400)
  622. /*
  623.  * Low level hook flags
  624.  */
  625. #define LLKHF_EXTENDED       0x00000001
  626. #define LLKHF_INJECTED       0x00000010
  627. #define LLKHF_ALTDOWN        0x00000020
  628. #define LLKHF_UP             0x00000080
  629.  
  630. #define LLMHF_INJECTED       0x00000001
  631.  
  632. /*
  633.  * Structure used by WH_KEYBOARD_LL
  634.  */
  635. typedef struct tagKBDLLHOOKSTRUCT {
  636.     DWORD   vkCode;
  637.     DWORD   scanCode;
  638.     DWORD   flags;
  639.     DWORD   time;
  640.     DWORD   dwExtraInfo;
  641. } KBDLLHOOKSTRUCT, FAR *LPKBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;
  642.  
  643. /*
  644.  * Structure used by WH_MOUSE_LL
  645.  */
  646. typedef struct tagMSLLHOOKSTRUCT {
  647.     POINT   pt;
  648.     DWORD   mouseData;
  649.     DWORD   flags;
  650.     DWORD   time;
  651.     DWORD   dwExtraInfo;
  652. } MSLLHOOKSTRUCT, FAR *LPMSLLHOOKSTRUCT, *PMSLLHOOKSTRUCT;
  653.  
  654. #endif // (_WIN32_WINNT >= 0x0400)
  655.  
  656. /*
  657.  * Structure used by WH_DEBUG
  658.  */
  659. typedef struct tagDEBUGHOOKINFO
  660. {
  661.     DWORD   idThread;
  662.     DWORD   idThreadInstaller;
  663.     LPARAM  lParam;
  664.     WPARAM  wParam;
  665.     int     code;
  666. } DEBUGHOOKINFO, *PDEBUGHOOKINFO, NEAR *NPDEBUGHOOKINFO, FAR* LPDEBUGHOOKINFO;
  667.  
  668. /*
  669.  * Structure used by WH_MOUSE
  670.  */
  671. typedef struct tagMOUSEHOOKSTRUCT {
  672.     POINT   pt;
  673.     HWND    hwnd;
  674.     UINT    wHitTestCode;
  675.     DWORD   dwExtraInfo;
  676. } MOUSEHOOKSTRUCT, FAR *LPMOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT;
  677. #if(WINVER >= 0x0400)
  678. /*
  679.  * Structure used by WH_HARDWARE
  680.  */
  681. typedef struct tagHARDWAREHOOKSTRUCT {
  682.     HWND    hwnd;
  683.     UINT    message;
  684.     WPARAM  wParam;
  685.     LPARAM  lParam;
  686. } HARDWAREHOOKSTRUCT, FAR *LPHARDWAREHOOKSTRUCT, *PHARDWAREHOOKSTRUCT;
  687. #endif /* WINVER >= 0x0400 */
  688. #endif /* !NOWH */
  689.  
  690. /*
  691.  * Keyboard Layout API
  692.  */
  693. #define HKL_PREV            0
  694. #define HKL_NEXT            1
  695.  
  696.  
  697. #define KLF_ACTIVATE        0x00000001
  698. #define KLF_SUBSTITUTE_OK   0x00000002
  699. #define KLF_UNLOADPREVIOUS  0x00000004
  700. #define KLF_REORDER         0x00000008
  701. #if(WINVER >= 0x0400)
  702. #define KLF_REPLACELANG     0x00000010
  703. #define KLF_NOTELLSHELL     0x00000080
  704. #endif /* WINVER >= 0x0400 */
  705. #define KLF_SETFORPROCESS   0x00000100
  706.  
  707.  
  708. /*
  709.  * Size of KeyboardLayoutName (number of characters), including nul terminator
  710.  */
  711. #define KL_NAMELENGTH       9
  712.  
  713. WINUSERAPI
  714. HKL
  715. WINAPI
  716. LoadKeyboardLayoutA(
  717.     LPCSTR pwszKLID,
  718.     UINT Flags);
  719. WINUSERAPI
  720. HKL
  721. WINAPI
  722. LoadKeyboardLayoutW(
  723.     LPCWSTR pwszKLID,
  724.     UINT Flags);
  725. #ifdef UNICODE
  726. #define LoadKeyboardLayout  LoadKeyboardLayoutW
  727. #else
  728. #define LoadKeyboardLayout  LoadKeyboardLayoutA
  729. #endif // !UNICODE
  730.  
  731.  
  732. #if(WINVER >= 0x0400)
  733. WINUSERAPI
  734. HKL
  735. WINAPI
  736. ActivateKeyboardLayout(
  737.     HKL hkl,
  738.     UINT Flags);
  739. #else
  740. WINUSERAPI
  741. BOOL
  742. WINAPI
  743. ActivateKeyboardLayout(
  744.     HKL hkl,
  745.     UINT Flags);
  746. #endif /* WINVER >= 0x0400 */
  747.  
  748. #if(WINVER >= 0x0400)
  749. WINUSERAPI
  750. int
  751. WINAPI
  752. ToUnicodeEx(
  753.     UINT wVirtKey,
  754.     UINT wScanCode,
  755.     PBYTE lpKeyState,
  756.     LPWSTR pwszBuff,
  757.     int cchBuff,
  758.     UINT wFlags,
  759.     HKL dwhkl);
  760. #endif /* WINVER >= 0x0400 */
  761.  
  762. WINUSERAPI
  763. BOOL
  764. WINAPI
  765. UnloadKeyboardLayout(
  766.     HKL hkl);
  767.  
  768. WINUSERAPI
  769. BOOL
  770. WINAPI
  771. GetKeyboardLayoutNameA(
  772.     LPSTR pwszKLID);
  773. WINUSERAPI
  774. BOOL
  775. WINAPI
  776. GetKeyboardLayoutNameW(
  777.     LPWSTR pwszKLID);
  778. #ifdef UNICODE
  779. #define GetKeyboardLayoutName  GetKeyboardLayoutNameW
  780. #else
  781. #define GetKeyboardLayoutName  GetKeyboardLayoutNameA
  782. #endif // !UNICODE
  783.  
  784. #if(WINVER >= 0x0400)
  785. WINUSERAPI
  786. int
  787. WINAPI
  788. GetKeyboardLayoutList(
  789.         int nBuff,
  790.         HKL FAR *lpList);
  791.  
  792. WINUSERAPI
  793. HKL
  794. WINAPI
  795. GetKeyboardLayout(
  796.     DWORD dwLayout
  797. );
  798. #endif /* WINVER >= 0x0400 */
  799.  
  800. #if(WINVER >= 0x0500)
  801. typedef struct tagMOUSEMOVEPOINT {
  802.     int   x;
  803.     int   y;
  804.     DWORD time;
  805.     DWORD dwExtraInfo;
  806. } MOUSEMOVEPOINT, *PMOUSEMOVEPOINT, FAR* LPMOUSEMOVEPOINT;
  807.  
  808. /*
  809.  * Values for resolution parameter of GetMouseMovePoints
  810.  */
  811. #define GMMP_USE_DISPLAY_POINTS   1
  812. #define GMMP_USE_DRIVER_POINTS    2
  813.  
  814. WINUSERAPI
  815. int
  816. WINAPI
  817. GetMouseMovePoints(
  818.     UINT             cbSize,
  819.     LPMOUSEMOVEPOINT lppt,
  820.     LPMOUSEMOVEPOINT lpptBuf,
  821.     int              nBufPoints,
  822.     DWORD            resolution
  823. );
  824. #endif /* WINVER >= 0x0500 */
  825.  
  826. #ifndef NODESKTOP
  827. /*
  828.  * Desktop-specific access flags
  829.  */
  830. #define DESKTOP_READOBJECTS         0x0001L
  831. #define DESKTOP_CREATEWINDOW        0x0002L
  832. #define DESKTOP_CREATEMENU          0x0004L
  833. #define DESKTOP_HOOKCONTROL         0x0008L
  834. #define DESKTOP_JOURNALRECORD       0x0010L
  835. #define DESKTOP_JOURNALPLAYBACK     0x0020L
  836. #define DESKTOP_ENUMERATE           0x0040L
  837. #define DESKTOP_WRITEOBJECTS        0x0080L
  838. #define DESKTOP_SWITCHDESKTOP       0x0100L
  839.  
  840. /*
  841.  * Desktop-specific control flags
  842.  */
  843. #define DF_ALLOWOTHERACCOUNTHOOK    0x0001L
  844.  
  845. #ifdef _WINGDI_
  846. #ifndef NOGDI
  847.  
  848. WINUSERAPI
  849. HDESK
  850. WINAPI
  851. CreateDesktopA(
  852.     LPSTR lpszDesktop,
  853.     LPSTR lpszDevice,
  854.     LPDEVMODEA pDevmode,
  855.     DWORD dwFlags,
  856.     ACCESS_MASK dwDesiredAccess,
  857.     LPSECURITY_ATTRIBUTES lpsa);
  858. WINUSERAPI
  859. HDESK
  860. WINAPI
  861. CreateDesktopW(
  862.     LPWSTR lpszDesktop,
  863.     LPWSTR lpszDevice,
  864.     LPDEVMODEW pDevmode,
  865.     DWORD dwFlags,
  866.     ACCESS_MASK dwDesiredAccess,
  867.     LPSECURITY_ATTRIBUTES lpsa);
  868. #ifdef UNICODE
  869. #define CreateDesktop  CreateDesktopW
  870. #else
  871. #define CreateDesktop  CreateDesktopA
  872. #endif // !UNICODE
  873.  
  874. #endif /* NOGDI */
  875. #endif /* _WINGDI_ */
  876.  
  877. WINUSERAPI
  878. HDESK
  879. WINAPI
  880. OpenDesktopA(
  881.     LPSTR lpszDesktop,
  882.     DWORD dwFlags,
  883.     BOOL fInherit,
  884.     ACCESS_MASK dwDesiredAccess);
  885. WINUSERAPI
  886. HDESK
  887. WINAPI
  888. OpenDesktopW(
  889.     LPWSTR lpszDesktop,
  890.     DWORD dwFlags,
  891.     BOOL fInherit,
  892.     ACCESS_MASK dwDesiredAccess);
  893. #ifdef UNICODE
  894. #define OpenDesktop  OpenDesktopW
  895. #else
  896. #define OpenDesktop  OpenDesktopA
  897. #endif // !UNICODE
  898.  
  899. WINUSERAPI
  900. HDESK
  901. WINAPI
  902. OpenInputDesktop(
  903.     DWORD dwFlags,
  904.     BOOL fInherit,
  905.     ACCESS_MASK dwDesiredAccess);
  906.  
  907. WINUSERAPI
  908. BOOL
  909. WINAPI
  910. EnumDesktopsA(
  911.     HWINSTA hwinsta,
  912.     DESKTOPENUMPROCA lpEnumFunc,
  913.     LPARAM lParam);
  914. WINUSERAPI
  915. BOOL
  916. WINAPI
  917. EnumDesktopsW(
  918.     HWINSTA hwinsta,
  919.     DESKTOPENUMPROCW lpEnumFunc,
  920.     LPARAM lParam);
  921. #ifdef UNICODE
  922. #define EnumDesktops  EnumDesktopsW
  923. #else
  924. #define EnumDesktops  EnumDesktopsA
  925. #endif // !UNICODE
  926.  
  927. WINUSERAPI
  928. BOOL
  929. WINAPI
  930. EnumDesktopWindows(
  931.     HDESK hDesktop,
  932.     WNDENUMPROC lpfn,
  933.     LPARAM lParam);
  934.  
  935. WINUSERAPI
  936. BOOL
  937. WINAPI
  938. SwitchDesktop(
  939.     HDESK hDesktop);
  940.  
  941. WINUSERAPI
  942. BOOL
  943. WINAPI
  944. SetThreadDesktop(
  945.     HDESK hDesktop);
  946.  
  947. WINUSERAPI
  948. BOOL
  949. WINAPI
  950. CloseDesktop(
  951.     HDESK hDesktop);
  952.  
  953. WINUSERAPI
  954. HDESK
  955. WINAPI
  956. GetThreadDesktop(
  957.     DWORD dwThreadId);
  958. #endif  /* !NODESKTOP */
  959.  
  960.  
  961. #ifndef NOWINDOWSTATION
  962. /*
  963.  * Windowstation-specific access flags
  964.  */
  965. #define WINSTA_ENUMDESKTOPS         0x0001L
  966. #define WINSTA_READATTRIBUTES       0x0002L
  967. #define WINSTA_ACCESSCLIPBOARD      0x0004L
  968. #define WINSTA_CREATEDESKTOP        0x0008L
  969. #define WINSTA_WRITEATTRIBUTES      0x0010L
  970. #define WINSTA_ACCESSGLOBALATOMS    0x0020L
  971. #define WINSTA_EXITWINDOWS          0x0040L
  972. #define WINSTA_ENUMERATE            0x0100L
  973. #define WINSTA_READSCREEN           0x0200L
  974.  
  975. /*
  976.  * Windowstation-specific attribute flags
  977.  */
  978. #define WSF_VISIBLE                 0x0001L
  979.  
  980. WINUSERAPI
  981. HWINSTA
  982. WINAPI
  983. CreateWindowStationA(
  984.     LPSTR               lpwinsta,
  985.     DWORD                 dwReserved,
  986.     ACCESS_MASK           dwDesiredAccess,
  987.     LPSECURITY_ATTRIBUTES lpsa);
  988. WINUSERAPI
  989. HWINSTA
  990. WINAPI
  991. CreateWindowStationW(
  992.     LPWSTR               lpwinsta,
  993.     DWORD                 dwReserved,
  994.     ACCESS_MASK           dwDesiredAccess,
  995.     LPSECURITY_ATTRIBUTES lpsa);
  996. #ifdef UNICODE
  997. #define CreateWindowStation  CreateWindowStationW
  998. #else
  999. #define CreateWindowStation  CreateWindowStationA
  1000. #endif // !UNICODE
  1001.  
  1002. WINUSERAPI
  1003. HWINSTA
  1004. WINAPI
  1005. OpenWindowStationA(
  1006.     LPSTR lpszWinSta,
  1007.     BOOL fInherit,
  1008.     ACCESS_MASK dwDesiredAccess);
  1009. WINUSERAPI
  1010. HWINSTA
  1011. WINAPI
  1012. OpenWindowStationW(
  1013.     LPWSTR lpszWinSta,
  1014.     BOOL fInherit,
  1015.     ACCESS_MASK dwDesiredAccess);
  1016. #ifdef UNICODE
  1017. #define OpenWindowStation  OpenWindowStationW
  1018. #else
  1019. #define OpenWindowStation  OpenWindowStationA
  1020. #endif // !UNICODE
  1021.  
  1022. WINUSERAPI
  1023. BOOL
  1024. WINAPI
  1025. EnumWindowStationsA(
  1026.     WINSTAENUMPROCA lpEnumFunc,
  1027.     LPARAM lParam);
  1028. WINUSERAPI
  1029. BOOL
  1030. WINAPI
  1031. EnumWindowStationsW(
  1032.     WINSTAENUMPROCW lpEnumFunc,
  1033.     LPARAM lParam);
  1034. #ifdef UNICODE
  1035. #define EnumWindowStations  EnumWindowStationsW
  1036. #else
  1037. #define EnumWindowStations  EnumWindowStationsA
  1038. #endif // !UNICODE
  1039.  
  1040.  
  1041. WINUSERAPI
  1042. BOOL
  1043. WINAPI
  1044. CloseWindowStation(
  1045.     HWINSTA hWinSta);
  1046.  
  1047. WINUSERAPI
  1048. BOOL
  1049. WINAPI
  1050. SetProcessWindowStation(
  1051.     HWINSTA hWinSta);
  1052.  
  1053. WINUSERAPI
  1054. HWINSTA
  1055. WINAPI
  1056. GetProcessWindowStation(
  1057.     VOID);
  1058. #endif  /* !NOWINDOWSTATION */
  1059.  
  1060. #ifndef NOSECURITY
  1061.  
  1062. WINUSERAPI
  1063. BOOL
  1064. WINAPI
  1065. SetUserObjectSecurity(
  1066.     HANDLE hObj,
  1067.     PSECURITY_INFORMATION pSIRequested,
  1068.     PSECURITY_DESCRIPTOR pSID);
  1069.  
  1070. WINUSERAPI
  1071. BOOL
  1072. WINAPI
  1073. GetUserObjectSecurity(
  1074.     HANDLE hObj,
  1075.     PSECURITY_INFORMATION pSIRequested,
  1076.     PSECURITY_DESCRIPTOR pSID,
  1077.     DWORD nLength,
  1078.     LPDWORD lpnLengthNeeded);
  1079.  
  1080. #define UOI_FLAGS       1
  1081. #define UOI_NAME        2
  1082. #define UOI_TYPE        3
  1083. #define UOI_USER_SID    4
  1084.  
  1085. typedef struct tagUSEROBJECTFLAGS {
  1086.     BOOL fInherit;
  1087.     BOOL fReserved;
  1088.     DWORD dwFlags;
  1089. } USEROBJECTFLAGS, *PUSEROBJECTFLAGS;
  1090.  
  1091. WINUSERAPI
  1092. BOOL
  1093. WINAPI
  1094. GetUserObjectInformationA(
  1095.     HANDLE hObj,
  1096.     int nIndex,
  1097.     PVOID pvInfo,
  1098.     DWORD nLength,
  1099.     LPDWORD lpnLengthNeeded);
  1100. WINUSERAPI
  1101. BOOL
  1102. WINAPI
  1103. GetUserObjectInformationW(
  1104.     HANDLE hObj,
  1105.     int nIndex,
  1106.     PVOID pvInfo,
  1107.     DWORD nLength,
  1108.     LPDWORD lpnLengthNeeded);
  1109. #ifdef UNICODE
  1110. #define GetUserObjectInformation  GetUserObjectInformationW
  1111. #else
  1112. #define GetUserObjectInformation  GetUserObjectInformationA
  1113. #endif // !UNICODE
  1114.  
  1115. WINUSERAPI
  1116. BOOL
  1117. WINAPI
  1118. SetUserObjectInformationA(
  1119.     HANDLE hObj,
  1120.     int nIndex,
  1121.     PVOID pvInfo,
  1122.     DWORD nLength);
  1123. WINUSERAPI
  1124. BOOL
  1125. WINAPI
  1126. SetUserObjectInformationW(
  1127.     HANDLE hObj,
  1128.     int nIndex,
  1129.     PVOID pvInfo,
  1130.     DWORD nLength);
  1131. #ifdef UNICODE
  1132. #define SetUserObjectInformation  SetUserObjectInformationW
  1133. #else
  1134. #define SetUserObjectInformation  SetUserObjectInformationA
  1135. #endif // !UNICODE
  1136.  
  1137. #endif  /* !NOSECURITY */
  1138.  
  1139. #if(WINVER >= 0x0400)
  1140. typedef struct tagWNDCLASSEXA {
  1141.     UINT        cbSize;
  1142.     /* Win 3.x */
  1143.     UINT        style;
  1144.     WNDPROC     lpfnWndProc;
  1145.     int         cbClsExtra;
  1146.     int         cbWndExtra;
  1147.     HINSTANCE   hInstance;
  1148.     HICON       hIcon;
  1149.     HCURSOR     hCursor;
  1150.     HBRUSH      hbrBackground;
  1151.     LPCSTR      lpszMenuName;
  1152.     LPCSTR      lpszClassName;
  1153.     /* Win 4.0 */
  1154.     HICON       hIconSm;
  1155. } WNDCLASSEXA, *PWNDCLASSEXA, NEAR *NPWNDCLASSEXA, FAR *LPWNDCLASSEXA;
  1156. typedef struct tagWNDCLASSEXW {
  1157.     UINT        cbSize;
  1158.     /* Win 3.x */
  1159.     UINT        style;
  1160.     WNDPROC     lpfnWndProc;
  1161.     int         cbClsExtra;
  1162.     int         cbWndExtra;
  1163.     HINSTANCE   hInstance;
  1164.     HICON       hIcon;
  1165.     HCURSOR     hCursor;
  1166.     HBRUSH      hbrBackground;
  1167.     LPCWSTR     lpszMenuName;
  1168.     LPCWSTR     lpszClassName;
  1169.     /* Win 4.0 */
  1170.     HICON       hIconSm;
  1171. } WNDCLASSEXW, *PWNDCLASSEXW, NEAR *NPWNDCLASSEXW, FAR *LPWNDCLASSEXW;
  1172. #ifdef UNICODE
  1173. typedef WNDCLASSEXW WNDCLASSEX;
  1174. typedef PWNDCLASSEXW PWNDCLASSEX;
  1175. typedef NPWNDCLASSEXW NPWNDCLASSEX;
  1176. typedef LPWNDCLASSEXW LPWNDCLASSEX;
  1177. #else
  1178. typedef WNDCLASSEXA WNDCLASSEX;
  1179. typedef PWNDCLASSEXA PWNDCLASSEX;
  1180. typedef NPWNDCLASSEXA NPWNDCLASSEX;
  1181. typedef LPWNDCLASSEXA LPWNDCLASSEX;
  1182. #endif // UNICODE
  1183. #endif /* WINVER >= 0x0400 */
  1184.  
  1185. typedef struct tagWNDCLASSA {
  1186.     UINT        style;
  1187.     WNDPROC     lpfnWndProc;
  1188.     int         cbClsExtra;
  1189.     int         cbWndExtra;
  1190.     HINSTANCE   hInstance;
  1191.     HICON       hIcon;
  1192.     HCURSOR     hCursor;
  1193.     HBRUSH      hbrBackground;
  1194.     LPCSTR      lpszMenuName;
  1195.     LPCSTR      lpszClassName;
  1196. } WNDCLASSA, *PWNDCLASSA, NEAR *NPWNDCLASSA, FAR *LPWNDCLASSA;
  1197. typedef struct tagWNDCLASSW {
  1198.     UINT        style;
  1199.     WNDPROC     lpfnWndProc;
  1200.     int         cbClsExtra;
  1201.     int         cbWndExtra;
  1202.     HINSTANCE   hInstance;
  1203.     HICON       hIcon;
  1204.     HCURSOR     hCursor;
  1205.     HBRUSH      hbrBackground;
  1206.     LPCWSTR     lpszMenuName;
  1207.     LPCWSTR     lpszClassName;
  1208. } WNDCLASSW, *PWNDCLASSW, NEAR *NPWNDCLASSW, FAR *LPWNDCLASSW;
  1209. #ifdef UNICODE
  1210. typedef WNDCLASSW WNDCLASS;
  1211. typedef PWNDCLASSW PWNDCLASS;
  1212. typedef NPWNDCLASSW NPWNDCLASS;
  1213. typedef LPWNDCLASSW LPWNDCLASS;
  1214. #else
  1215. typedef WNDCLASSA WNDCLASS;
  1216. typedef PWNDCLASSA PWNDCLASS;
  1217. typedef NPWNDCLASSA NPWNDCLASS;
  1218. typedef LPWNDCLASSA LPWNDCLASS;
  1219. #endif // UNICODE
  1220.  
  1221.  
  1222. #ifndef NOMSG
  1223.  
  1224. /*
  1225.  * Message structure
  1226.  */
  1227. typedef struct tagMSG {
  1228.     HWND        hwnd;
  1229.     UINT        message;
  1230.     WPARAM      wParam;
  1231.     LPARAM      lParam;
  1232.     DWORD       time;
  1233.     POINT       pt;
  1234. #ifdef _MAC
  1235.     DWORD       lPrivate;
  1236. #endif
  1237. } MSG, *PMSG, NEAR *NPMSG, FAR *LPMSG;
  1238.  
  1239. #define POINTSTOPOINT(pt, pts)                          \
  1240.         { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts);   \
  1241.           (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); }
  1242.  
  1243. #define POINTTOPOINTS(pt)      (MAKELONG((short)((pt).x), (short)((pt).y)))
  1244. #define MAKEWPARAM(l, h)      (WPARAM)MAKELONG(l, h)
  1245. #define MAKELPARAM(l, h)      (LPARAM)MAKELONG(l, h)
  1246. #define MAKELRESULT(l, h)     (LRESULT)MAKELONG(l, h)
  1247.  
  1248.  
  1249. #endif /* !NOMSG */
  1250.  
  1251. #ifndef NOWINOFFSETS
  1252.  
  1253. /*
  1254.  * Window field offsets for GetWindowLong()
  1255.  */
  1256. #define GWL_WNDPROC         (-4)
  1257. #define GWL_HINSTANCE       (-6)
  1258. #define GWL_HWNDPARENT      (-8)
  1259. #define GWL_STYLE           (-16)
  1260. #define GWL_EXSTYLE         (-20)
  1261. #define GWL_USERDATA        (-21)
  1262. #define GWL_ID              (-12)
  1263.  
  1264. /*
  1265.  * Class field offsets for GetClassLong()
  1266.  */
  1267. #define GCL_MENUNAME        (-8)
  1268. #define GCL_HBRBACKGROUND   (-10)
  1269. #define GCL_HCURSOR         (-12)
  1270. #define GCL_HICON           (-14)
  1271. #define GCL_HMODULE         (-16)
  1272. #define GCL_CBWNDEXTRA      (-18)
  1273. #define GCL_CBCLSEXTRA      (-20)
  1274. #define GCL_WNDPROC         (-24)
  1275. #define GCL_STYLE           (-26)
  1276. #define GCW_ATOM            (-32)
  1277.  
  1278. #if(WINVER >= 0x0400)
  1279. #define GCL_HICONSM         (-34)
  1280. #endif /* WINVER >= 0x0400 */
  1281.  
  1282. #endif /* !NOWINOFFSETS */
  1283.  
  1284. #ifndef NOWINMESSAGES
  1285.  
  1286. // begin_r_winuser
  1287.  
  1288. /*
  1289.  * Window Messages
  1290.  */
  1291.  
  1292. #define WM_NULL                         0x0000
  1293. #define WM_CREATE                       0x0001
  1294. #define WM_DESTROY                      0x0002
  1295. #define WM_MOVE                         0x0003
  1296. #define WM_SIZE                         0x0005
  1297.  
  1298. #define WM_ACTIVATE                     0x0006
  1299. /*
  1300.  * WM_ACTIVATE state values
  1301.  */
  1302. #define     WA_INACTIVE     0
  1303. #define     WA_ACTIVE       1
  1304. #define     WA_CLICKACTIVE  2
  1305.  
  1306. #define WM_SETFOCUS                     0x0007
  1307. #define WM_KILLFOCUS                    0x0008
  1308. #define WM_ENABLE                       0x000A
  1309. #define WM_SETREDRAW                    0x000B
  1310. #define WM_SETTEXT                      0x000C
  1311. #define WM_GETTEXT                      0x000D
  1312. #define WM_GETTEXTLENGTH                0x000E
  1313. #define WM_PAINT                        0x000F
  1314. #define WM_CLOSE                        0x0010
  1315. #define WM_QUERYENDSESSION              0x0011
  1316. #define WM_QUIT                         0x0012
  1317. #define WM_QUERYOPEN                    0x0013
  1318. #define WM_ERASEBKGND                   0x0014
  1319. #define WM_SYSCOLORCHANGE               0x0015
  1320. #define WM_ENDSESSION                   0x0016
  1321. #define WM_SHOWWINDOW                   0x0018
  1322. #define WM_WININICHANGE                 0x001A
  1323. #if(WINVER >= 0x0400)
  1324. #define WM_SETTINGCHANGE                WM_WININICHANGE
  1325. #endif /* WINVER >= 0x0400 */
  1326.  
  1327.  
  1328. #define WM_DEVMODECHANGE                0x001B
  1329. #define WM_ACTIVATEAPP                  0x001C
  1330. #define WM_FONTCHANGE                   0x001D
  1331. #define WM_TIMECHANGE                   0x001E
  1332. #define WM_CANCELMODE                   0x001F
  1333. #define WM_SETCURSOR                    0x0020
  1334. #define WM_MOUSEACTIVATE                0x0021
  1335. #define WM_CHILDACTIVATE                0x0022
  1336. #define WM_QUEUESYNC                    0x0023
  1337.  
  1338. #define WM_GETMINMAXINFO                0x0024
  1339. // end_r_winuser
  1340. /*
  1341.  * Struct pointed to by WM_GETMINMAXINFO lParam
  1342.  */
  1343. typedef struct tagMINMAXINFO {
  1344.     POINT ptReserved;
  1345.     POINT ptMaxSize;
  1346.     POINT ptMaxPosition;
  1347.     POINT ptMinTrackSize;
  1348.     POINT ptMaxTrackSize;
  1349. } MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
  1350.  
  1351. // begin_r_winuser
  1352. #define WM_PAINTICON                    0x0026
  1353. #define WM_ICONERASEBKGND               0x0027
  1354. #define WM_NEXTDLGCTL                   0x0028
  1355. #define WM_SPOOLERSTATUS                0x002A
  1356. #define WM_DRAWITEM                     0x002B
  1357. #define WM_MEASUREITEM                  0x002C
  1358. #define WM_DELETEITEM                   0x002D
  1359. #define WM_VKEYTOITEM                   0x002E
  1360. #define WM_CHARTOITEM                   0x002F
  1361. #define WM_SETFONT                      0x0030
  1362. #define WM_GETFONT                      0x0031
  1363. #define WM_SETHOTKEY                    0x0032
  1364. #define WM_GETHOTKEY                    0x0033
  1365. #define WM_QUERYDRAGICON                0x0037
  1366. #define WM_COMPAREITEM                  0x0039
  1367. #if(WINVER >= 0x0500)
  1368. #define WM_GETOBJECT                    0x003D
  1369. #endif /* WINVER >= 0x0500 */
  1370. #define WM_COMPACTING                   0x0041
  1371. #define WM_COMMNOTIFY                   0x0044  /* no longer suported */
  1372. #define WM_WINDOWPOSCHANGING            0x0046
  1373. #define WM_WINDOWPOSCHANGED             0x0047
  1374.  
  1375. #define WM_POWER                        0x0048
  1376. /*
  1377.  * wParam for WM_POWER window message and DRV_POWER driver notification
  1378.  */
  1379. #define PWR_OK              1
  1380. #define PWR_FAIL            (-1)
  1381. #define PWR_SUSPENDREQUEST  1
  1382. #define PWR_SUSPENDRESUME   2
  1383. #define PWR_CRITICALRESUME  3
  1384.  
  1385. #define WM_COPYDATA                     0x004A
  1386. #define WM_CANCELJOURNAL                0x004B
  1387.  
  1388. // end_r_winuser
  1389.  
  1390. /*
  1391.  * lParam of WM_COPYDATA message points to...
  1392.  */
  1393. typedef struct tagCOPYDATASTRUCT {
  1394.     DWORD dwData;
  1395.     DWORD cbData;
  1396.     PVOID lpData;
  1397. } COPYDATASTRUCT, *PCOPYDATASTRUCT;
  1398.  
  1399. // begin_r_winuser
  1400.  
  1401. #if(WINVER >= 0x0400)
  1402. #define WM_NOTIFY                       0x004E
  1403. #define WM_INPUTLANGCHANGEREQUEST       0x0050
  1404. #define WM_INPUTLANGCHANGE              0x0051
  1405. #define WM_TCARD                        0x0052
  1406. #define WM_HELP                         0x0053
  1407. #define WM_USERCHANGED                  0x0054
  1408. #define WM_NOTIFYFORMAT                 0x0055
  1409.  
  1410. #define NFR_ANSI                             1
  1411. #define NFR_UNICODE                          2
  1412. #define NF_QUERY                             3
  1413. #define NF_REQUERY                           4
  1414.  
  1415. #define WM_CONTEXTMENU                  0x007B
  1416. #define WM_STYLECHANGING                0x007C
  1417. #define WM_STYLECHANGED                 0x007D
  1418. #define WM_DISPLAYCHANGE                0x007E
  1419. #define WM_GETICON                      0x007F
  1420. #define WM_SETICON                      0x0080
  1421. #endif /* WINVER >= 0x0400 */
  1422.  
  1423. #define WM_NCCREATE                     0x0081
  1424. #define WM_NCDESTROY                    0x0082
  1425. #define WM_NCCALCSIZE                   0x0083
  1426. #define WM_NCHITTEST                    0x0084
  1427. #define WM_NCPAINT                      0x0085
  1428. #define WM_NCACTIVATE                   0x0086
  1429. #define WM_GETDLGCODE                   0x0087
  1430. #define WM_SYNCPAINT                    0x0088
  1431. #define WM_NCMOUSEMOVE                  0x00A0
  1432. #define WM_NCLBUTTONDOWN                0x00A1
  1433. #define WM_NCLBUTTONUP                  0x00A2
  1434. #define WM_NCLBUTTONDBLCLK              0x00A3
  1435. #define WM_NCRBUTTONDOWN                0x00A4
  1436. #define WM_NCRBUTTONUP                  0x00A5
  1437. #define WM_NCRBUTTONDBLCLK              0x00A6
  1438. #define WM_NCMBUTTONDOWN                0x00A7
  1439. #define WM_NCMBUTTONUP                  0x00A8
  1440. #define WM_NCMBUTTONDBLCLK              0x00A9
  1441.  
  1442. #define WM_KEYFIRST                     0x0100
  1443. #define WM_KEYDOWN                      0x0100
  1444. #define WM_KEYUP                        0x0101
  1445. #define WM_CHAR                         0x0102
  1446. #define WM_DEADCHAR                     0x0103
  1447. #define WM_SYSKEYDOWN                   0x0104
  1448. #define WM_SYSKEYUP                     0x0105
  1449. #define WM_SYSCHAR                      0x0106
  1450. #define WM_SYSDEADCHAR                  0x0107
  1451. #define WM_KEYLAST                      0x0108
  1452.  
  1453. #if(WINVER >= 0x0400)
  1454. #define WM_IME_STARTCOMPOSITION         0x010D
  1455. #define WM_IME_ENDCOMPOSITION           0x010E
  1456. #define WM_IME_COMPOSITION              0x010F
  1457. #define WM_IME_KEYLAST                  0x010F
  1458. #endif /* WINVER >= 0x0400 */
  1459.  
  1460. #define WM_INITDIALOG                   0x0110
  1461. #define WM_COMMAND                      0x0111
  1462. #define WM_SYSCOMMAND                   0x0112
  1463. #define WM_TIMER                        0x0113
  1464. #define WM_HSCROLL                      0x0114
  1465. #define WM_VSCROLL                      0x0115
  1466. #define WM_INITMENU                     0x0116
  1467. #define WM_INITMENUPOPUP                0x0117
  1468. #define WM_MENUSELECT                   0x011F
  1469. #define WM_MENUCHAR                     0x0120
  1470. #define WM_ENTERIDLE                    0x0121
  1471. #if(WINVER >= 0x0500)
  1472. #define WM_MENURBUTTONUP                0x0122
  1473. #define WM_MENUDRAG                     0x0123
  1474. #define WM_MENUGETOBJECT                0x0124
  1475. #define WM_UNINITMENUPOPUP              0x0125
  1476. #define WM_MENUCOMMAND                  0x0126
  1477. #endif /* WINVER >= 0x0500 */
  1478.  
  1479.  
  1480. #define WM_CTLCOLORMSGBOX               0x0132
  1481. #define WM_CTLCOLOREDIT                 0x0133
  1482. #define WM_CTLCOLORLISTBOX              0x0134
  1483. #define WM_CTLCOLORBTN                  0x0135
  1484. #define WM_CTLCOLORDLG                  0x0136
  1485. #define WM_CTLCOLORSCROLLBAR            0x0137
  1486. #define WM_CTLCOLORSTATIC               0x0138
  1487.  
  1488.  
  1489. #define WM_MOUSEFIRST                   0x0200
  1490. #define WM_MOUSEMOVE                    0x0200
  1491. #define WM_LBUTTONDOWN                  0x0201
  1492. #define WM_LBUTTONUP                    0x0202
  1493. #define WM_LBUTTONDBLCLK                0x0203
  1494. #define WM_RBUTTONDOWN                  0x0204
  1495. #define WM_RBUTTONUP                    0x0205
  1496. #define WM_RBUTTONDBLCLK                0x0206
  1497. #define WM_MBUTTONDOWN                  0x0207
  1498. #define WM_MBUTTONUP                    0x0208
  1499. #define WM_MBUTTONDBLCLK                0x0209
  1500.  
  1501. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  1502. #define WM_MOUSEWHEEL                   0x020A
  1503. #define WM_MOUSELAST                    0x020A
  1504. #else
  1505. #define WM_MOUSELAST                    0x0209
  1506. #endif /* if (_WIN32_WINNT < 0x0400) */
  1507.  
  1508. #if(_WIN32_WINNT >= 0x0400)
  1509. #define WHEEL_DELTA                     120     /* Value for rolling one detent */
  1510. #endif /* _WIN32_WINNT >= 0x0400 */
  1511. #if(_WIN32_WINNT >= 0x0400)
  1512. #define WHEEL_PAGESCROLL                (UINT_MAX) /* Scroll one page */
  1513. #endif /* _WIN32_WINNT >= 0x0400 */
  1514.  
  1515. #define WM_PARENTNOTIFY                 0x0210
  1516. #define WM_ENTERMENULOOP                0x0211
  1517. #define WM_EXITMENULOOP                 0x0212
  1518.  
  1519. #if(WINVER >= 0x0400)
  1520. #define WM_NEXTMENU                     0x0213
  1521. // end_r_winuser
  1522.  
  1523. typedef struct tagMDINEXTMENU
  1524. {
  1525.     HMENU   hmenuIn;
  1526.     HMENU   hmenuNext;
  1527.     HWND    hwndNext;
  1528. } MDINEXTMENU, * PMDINEXTMENU, FAR * LPMDINEXTMENU;
  1529.  
  1530. // begin_r_winuser
  1531. #define WM_SIZING                       0x0214
  1532. #define WM_CAPTURECHANGED               0x0215
  1533. #define WM_MOVING                       0x0216
  1534. // end_r_winuser
  1535. #define WM_POWERBROADCAST               0x0218      // r_winuser pbt
  1536. // begin_pbt
  1537.  
  1538. #define PBT_APMQUERYSUSPEND             0x0000
  1539. #define PBT_APMQUERYSTANDBY             0x0001
  1540.  
  1541. #define PBT_APMQUERYSUSPENDFAILED       0x0002
  1542. #define PBT_APMQUERYSTANDBYFAILED       0x0003
  1543.  
  1544. #define PBT_APMSUSPEND                  0x0004
  1545. #define PBT_APMSTANDBY                  0x0005
  1546.  
  1547. #define PBT_APMRESUMECRITICAL           0x0006
  1548. #define PBT_APMRESUMESUSPEND            0x0007
  1549. #define PBT_APMRESUMESTANDBY            0x0008
  1550.  
  1551. #define PBTF_APMRESUMEFROMFAILURE       0x00000001
  1552.  
  1553. #define PBT_APMBATTERYLOW               0x0009
  1554. #define PBT_APMPOWERSTATUSCHANGE        0x000A
  1555.  
  1556. #define PBT_APMOEMEVENT                 0x000B
  1557. #define PBT_APMRESUMEAUTOMATIC          0x0012
  1558. // end_pbt
  1559.  
  1560. // begin_r_winuser
  1561. #define WM_DEVICECHANGE                 0x0219
  1562.  
  1563. #endif /* WINVER >= 0x0400 */
  1564.  
  1565. #define WM_MDICREATE                    0x0220
  1566. #define WM_MDIDESTROY                   0x0221
  1567. #define WM_MDIACTIVATE                  0x0222
  1568. #define WM_MDIRESTORE                   0x0223
  1569. #define WM_MDINEXT                      0x0224
  1570. #define WM_MDIMAXIMIZE                  0x0225
  1571. #define WM_MDITILE                      0x0226
  1572. #define WM_MDICASCADE                   0x0227
  1573. #define WM_MDIICONARRANGE               0x0228
  1574. #define WM_MDIGETACTIVE                 0x0229
  1575.  
  1576.  
  1577. #define WM_MDISETMENU                   0x0230
  1578. #define WM_ENTERSIZEMOVE                0x0231
  1579. #define WM_EXITSIZEMOVE                 0x0232
  1580. #define WM_DROPFILES                    0x0233
  1581. #define WM_MDIREFRESHMENU               0x0234
  1582.  
  1583.  
  1584. #if(WINVER >= 0x0400)
  1585. #define WM_IME_SETCONTEXT               0x0281
  1586. #define WM_IME_NOTIFY                   0x0282
  1587. #define WM_IME_CONTROL                  0x0283
  1588. #define WM_IME_COMPOSITIONFULL          0x0284
  1589. #define WM_IME_SELECT                   0x0285
  1590. #define WM_IME_CHAR                     0x0286
  1591. #endif /* WINVER >= 0x0400 */
  1592. #if(WINVER >= 0x0500)
  1593. #define WM_IME_REQUEST                  0x0288
  1594. #endif /* WINVER >= 0x0500 */
  1595. #if(WINVER >= 0x0400)
  1596. #define WM_IME_KEYDOWN                  0x0290
  1597. #define WM_IME_KEYUP                    0x0291
  1598. #endif /* WINVER >= 0x0400 */
  1599.  
  1600.  
  1601. #if(_WIN32_WINNT >= 0x0400)
  1602. #define WM_MOUSEHOVER                   0x02A1
  1603. #define WM_MOUSELEAVE                   0x02A3
  1604. #endif /* _WIN32_WINNT >= 0x0400 */
  1605.  
  1606. #define WM_CUT                          0x0300
  1607. #define WM_COPY                         0x0301
  1608. #define WM_PASTE                        0x0302
  1609. #define WM_CLEAR                        0x0303
  1610. #define WM_UNDO                         0x0304
  1611. #define WM_RENDERFORMAT                 0x0305
  1612. #define WM_RENDERALLFORMATS             0x0306
  1613. #define WM_DESTROYCLIPBOARD             0x0307
  1614. #define WM_DRAWCLIPBOARD                0x0308
  1615. #define WM_PAINTCLIPBOARD               0x0309
  1616. #define WM_VSCROLLCLIPBOARD             0x030A
  1617. #define WM_SIZECLIPBOARD                0x030B
  1618. #define WM_ASKCBFORMATNAME              0x030C
  1619. #define WM_CHANGECBCHAIN                0x030D
  1620. #define WM_HSCROLLCLIPBOARD             0x030E
  1621. #define WM_QUERYNEWPALETTE              0x030F
  1622. #define WM_PALETTEISCHANGING            0x0310
  1623. #define WM_PALETTECHANGED               0x0311
  1624. #define WM_HOTKEY                       0x0312
  1625.  
  1626. #if(WINVER >= 0x0400)
  1627. #define WM_PRINT                        0x0317
  1628. #define WM_PRINTCLIENT                  0x0318
  1629.  
  1630. #define WM_HANDHELDFIRST                0x0358
  1631. #define WM_HANDHELDLAST                 0x035F
  1632.  
  1633. #define WM_AFXFIRST                     0x0360
  1634. #define WM_AFXLAST                      0x037F
  1635. #endif /* WINVER >= 0x0400 */
  1636.  
  1637. #define WM_PENWINFIRST                  0x0380
  1638. #define WM_PENWINLAST                   0x038F
  1639.  
  1640.  
  1641. #if(WINVER >= 0x0400)
  1642. #define WM_APP                          0x8000
  1643. #endif /* WINVER >= 0x0400 */
  1644.  
  1645.  
  1646. /*
  1647.  * NOTE: All Message Numbers below 0x0400 are RESERVED.
  1648.  *
  1649.  * Private Window Messages Start Here:
  1650.  */
  1651. #define WM_USER                         0x0400
  1652.  
  1653. #if(WINVER >= 0x0400)
  1654.  
  1655. /*  wParam for WM_SIZING message  */
  1656. #define WMSZ_LEFT           1
  1657. #define WMSZ_RIGHT          2
  1658. #define WMSZ_TOP            3
  1659. #define WMSZ_TOPLEFT        4
  1660. #define WMSZ_TOPRIGHT       5
  1661. #define WMSZ_BOTTOM         6
  1662. #define WMSZ_BOTTOMLEFT     7
  1663. #define WMSZ_BOTTOMRIGHT    8
  1664. #endif /* WINVER >= 0x0400 */
  1665.  
  1666. #ifndef NONCMESSAGES
  1667.  
  1668. /*
  1669.  * WM_NCHITTEST and MOUSEHOOKSTRUCT Mouse Position Codes
  1670.  */
  1671. #define HTERROR             (-2)
  1672. #define HTTRANSPARENT       (-1)
  1673. #define HTNOWHERE           0
  1674. #define HTCLIENT            1
  1675. #define HTCAPTION           2
  1676. #define HTSYSMENU           3
  1677. #define HTGROWBOX           4
  1678. #define HTSIZE              HTGROWBOX
  1679. #define HTMENU              5
  1680. #define HTHSCROLL           6
  1681. #define HTVSCROLL           7
  1682. #define HTMINBUTTON         8
  1683. #define HTMAXBUTTON         9
  1684. #define HTLEFT              10
  1685. #define HTRIGHT             11
  1686. #define HTTOP               12
  1687. #define HTTOPLEFT           13
  1688. #define HTTOPRIGHT          14
  1689. #define HTBOTTOM            15
  1690. #define HTBOTTOMLEFT        16
  1691. #define HTBOTTOMRIGHT       17
  1692. #define HTBORDER            18
  1693. #define HTREDUCE            HTMINBUTTON
  1694. #define HTZOOM              HTMAXBUTTON
  1695. #define HTSIZEFIRST         HTLEFT
  1696. #define HTSIZELAST          HTBOTTOMRIGHT
  1697. #if(WINVER >= 0x0400)
  1698. #define HTOBJECT            19
  1699. #define HTCLOSE             20
  1700. #define HTHELP              21
  1701. #endif /* WINVER >= 0x0400 */
  1702.  
  1703. /*
  1704.  * SendMessageTimeout values
  1705.  */
  1706. #define SMTO_NORMAL         0x0000
  1707. #define SMTO_BLOCK          0x0001
  1708. #define SMTO_ABORTIFHUNG    0x0002
  1709. #if(WINVER >= 0x0500)
  1710. #define SMTO_NOTIMEOUTIFNOTHUNG 0x0008
  1711. #endif /* WINVER >= 0x0500 */
  1712.  
  1713. #endif /* !NONCMESSAGES */
  1714.  
  1715. /*
  1716.  * WM_MOUSEACTIVATE Return Codes
  1717.  */
  1718. #define MA_ACTIVATE         1
  1719. #define MA_ACTIVATEANDEAT   2
  1720. #define MA_NOACTIVATE       3
  1721. #define MA_NOACTIVATEANDEAT 4
  1722.  
  1723. /*
  1724.  * WM_SETICON / WM_GETICON Type Codes
  1725.  */
  1726. #define ICON_SMALL          0
  1727. #define ICON_BIG            1
  1728.  
  1729. // end_r_winuser
  1730.  
  1731. WINUSERAPI
  1732. UINT
  1733. WINAPI
  1734. RegisterWindowMessageA(
  1735.     LPCSTR lpString);
  1736. WINUSERAPI
  1737. UINT
  1738. WINAPI
  1739. RegisterWindowMessageW(
  1740.     LPCWSTR lpString);
  1741. #ifdef UNICODE
  1742. #define RegisterWindowMessage  RegisterWindowMessageW
  1743. #else
  1744. #define RegisterWindowMessage  RegisterWindowMessageA
  1745. #endif // !UNICODE
  1746.  
  1747. // begin_r_winuser
  1748.  
  1749. /*
  1750.  * WM_SIZE message wParam values
  1751.  */
  1752. #define SIZE_RESTORED       0
  1753. #define SIZE_MINIMIZED      1
  1754. #define SIZE_MAXIMIZED      2
  1755. #define SIZE_MAXSHOW        3
  1756. #define SIZE_MAXHIDE        4
  1757.  
  1758. /*
  1759.  * Obsolete constant names
  1760.  */
  1761. #define SIZENORMAL          SIZE_RESTORED
  1762. #define SIZEICONIC          SIZE_MINIMIZED
  1763. #define SIZEFULLSCREEN      SIZE_MAXIMIZED
  1764. #define SIZEZOOMSHOW        SIZE_MAXSHOW
  1765. #define SIZEZOOMHIDE        SIZE_MAXHIDE
  1766.  
  1767. // end_r_winuser
  1768. /*
  1769.  * WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam
  1770.  */
  1771. typedef struct tagWINDOWPOS {
  1772.     HWND    hwnd;
  1773.     HWND    hwndInsertAfter;
  1774.     int     x;
  1775.     int     y;
  1776.     int     cx;
  1777.     int     cy;
  1778.     UINT    flags;
  1779. } WINDOWPOS, *LPWINDOWPOS, *PWINDOWPOS;
  1780.  
  1781. /*
  1782.  * WM_NCCALCSIZE parameter structure
  1783.  */
  1784. typedef struct tagNCCALCSIZE_PARAMS {
  1785.     RECT       rgrc[3];
  1786.     PWINDOWPOS lppos;
  1787. } NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS;
  1788.  
  1789. // begin_r_winuser
  1790. /*
  1791.  * WM_NCCALCSIZE "window valid rect" return values
  1792.  */
  1793. #define WVR_ALIGNTOP        0x0010
  1794. #define WVR_ALIGNLEFT       0x0020
  1795. #define WVR_ALIGNBOTTOM     0x0040
  1796. #define WVR_ALIGNRIGHT      0x0080
  1797. #define WVR_HREDRAW         0x0100
  1798. #define WVR_VREDRAW         0x0200
  1799. #define WVR_REDRAW         (WVR_HREDRAW | \
  1800.                             WVR_VREDRAW)
  1801. #define WVR_VALIDRECTS      0x0400
  1802.  
  1803.  
  1804. #ifndef NOKEYSTATES
  1805.  
  1806. /*
  1807.  * Key State Masks for Mouse Messages
  1808.  */
  1809. #define MK_LBUTTON          0x0001
  1810. #define MK_RBUTTON          0x0002
  1811. #define MK_SHIFT            0x0004
  1812. #define MK_CONTROL          0x0008
  1813. #define MK_MBUTTON          0x0010
  1814.  
  1815. #endif /* !NOKEYSTATES */
  1816.  
  1817. #if(_WIN32_WINNT >= 0x0400)
  1818. #ifndef NOTRACKMOUSEEVENT
  1819.  
  1820. #define TME_HOVER       0x00000001
  1821. #define TME_LEAVE       0x00000002
  1822. #define TME_QUERY       0x40000000
  1823. #define TME_CANCEL      0x80000000
  1824.  
  1825.  
  1826. #define HOVER_DEFAULT   0xFFFFFFFF
  1827. // end_r_winuser
  1828.  
  1829. typedef struct tagTRACKMOUSEEVENT {
  1830.     DWORD cbSize;
  1831.     DWORD dwFlags;
  1832.     HWND  hwndTrack;
  1833.     DWORD dwHoverTime;
  1834. } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
  1835.  
  1836. WINUSERAPI
  1837. BOOL
  1838. WINAPI
  1839. TrackMouseEvent(
  1840.     LPTRACKMOUSEEVENT lpEventTrack);
  1841.  
  1842. // begin_r_winuser
  1843.  
  1844. #endif /* !NOTRACKMOUSEEVENT */
  1845. #endif /* _WIN32_WINNT >= 0x0400 */
  1846.  
  1847. // end_r_winuser
  1848.  
  1849. #endif /* !NOWINMESSAGES */
  1850.  
  1851. #ifndef NOWINSTYLES
  1852.  
  1853. // begin_r_winuser
  1854.  
  1855. /*
  1856.  * Window Styles
  1857.  */
  1858. #define WS_OVERLAPPED       0x00000000L
  1859. #define WS_POPUP            0x80000000L
  1860. #define WS_CHILD            0x40000000L
  1861. #define WS_MINIMIZE         0x20000000L
  1862. #define WS_VISIBLE          0x10000000L
  1863. #define WS_DISABLED         0x08000000L
  1864. #define WS_CLIPSIBLINGS     0x04000000L
  1865. #define WS_CLIPCHILDREN     0x02000000L
  1866. #define WS_MAXIMIZE         0x01000000L
  1867. #define WS_CAPTION          0x00C00000L     /* WS_BORDER | WS_DLGFRAME  */
  1868. #define WS_BORDER           0x00800000L
  1869. #define WS_DLGFRAME         0x00400000L
  1870. #define WS_VSCROLL          0x00200000L
  1871. #define WS_HSCROLL          0x00100000L
  1872. #define WS_SYSMENU          0x00080000L
  1873. #define WS_THICKFRAME       0x00040000L
  1874. #define WS_GROUP            0x00020000L
  1875. #define WS_TABSTOP          0x00010000L
  1876.  
  1877. #define WS_MINIMIZEBOX      0x00020000L
  1878. #define WS_MAXIMIZEBOX      0x00010000L
  1879.  
  1880.  
  1881. #define WS_TILED            WS_OVERLAPPED
  1882. #define WS_ICONIC           WS_MINIMIZE
  1883. #define WS_SIZEBOX          WS_THICKFRAME
  1884. #define WS_TILEDWINDOW      WS_OVERLAPPEDWINDOW
  1885.  
  1886. /*
  1887.  * Common Window Styles
  1888.  */
  1889. #define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED     | \
  1890.                              WS_CAPTION        | \
  1891.                              WS_SYSMENU        | \
  1892.                              WS_THICKFRAME     | \
  1893.                              WS_MINIMIZEBOX    | \
  1894.                              WS_MAXIMIZEBOX)
  1895.  
  1896. #define WS_POPUPWINDOW      (WS_POPUP          | \
  1897.                              WS_BORDER         | \
  1898.                              WS_SYSMENU)
  1899.  
  1900. #define WS_CHILDWINDOW      (WS_CHILD)
  1901.  
  1902. /*
  1903.  * Extended Window Styles
  1904.  */
  1905. #define WS_EX_DLGMODALFRAME     0x00000001L
  1906. #define WS_EX_NOPARENTNOTIFY    0x00000004L
  1907. #define WS_EX_TOPMOST           0x00000008L
  1908. #define WS_EX_ACCEPTFILES       0x00000010L
  1909. #define WS_EX_TRANSPARENT       0x00000020L
  1910. #if(WINVER >= 0x0400)
  1911. #define WS_EX_MDICHILD          0x00000040L
  1912. #define WS_EX_TOOLWINDOW        0x00000080L
  1913. #define WS_EX_WINDOWEDGE        0x00000100L
  1914. #define WS_EX_CLIENTEDGE        0x00000200L
  1915. #define WS_EX_CONTEXTHELP       0x00000400L
  1916.  
  1917. #define WS_EX_RIGHT             0x00001000L
  1918. #define WS_EX_LEFT              0x00000000L
  1919. #define WS_EX_RTLREADING        0x00002000L
  1920. #define WS_EX_LTRREADING        0x00000000L
  1921. #define WS_EX_LEFTSCROLLBAR     0x00004000L
  1922. #define WS_EX_RIGHTSCROLLBAR    0x00000000L
  1923.  
  1924. #define WS_EX_CONTROLPARENT     0x00010000L
  1925. #define WS_EX_STATICEDGE        0x00020000L
  1926. #define WS_EX_APPWINDOW         0x00040000L
  1927.  
  1928.  
  1929. #define WS_EX_OVERLAPPEDWINDOW  (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
  1930. #define WS_EX_PALETTEWINDOW     (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
  1931.  
  1932. #endif /* WINVER >= 0x0400 */
  1933.  
  1934.  
  1935. /*
  1936.  * Class styles
  1937.  */
  1938. #define CS_VREDRAW          0x0001
  1939. #define CS_HREDRAW          0x0002
  1940. #define CS_DBLCLKS          0x0008
  1941. #define CS_OWNDC            0x0020
  1942. #define CS_CLASSDC          0x0040
  1943. #define CS_PARENTDC         0x0080
  1944. #define CS_NOCLOSE          0x0200
  1945. #define CS_SAVEBITS         0x0800
  1946. #define CS_BYTEALIGNCLIENT  0x1000
  1947. #define CS_BYTEALIGNWINDOW  0x2000
  1948. #define CS_GLOBALCLASS      0x4000
  1949.  
  1950. #define CS_IME              0x00010000
  1951.  
  1952.  
  1953. // end_r_winuser
  1954.  
  1955. #endif /* !NOWINSTYLES */
  1956. #if(WINVER >= 0x0400)
  1957. /* WM_PRINT flags */
  1958. #define PRF_CHECKVISIBLE    0x00000001L
  1959. #define PRF_NONCLIENT       0x00000002L
  1960. #define PRF_CLIENT          0x00000004L
  1961. #define PRF_ERASEBKGND      0x00000008L
  1962. #define PRF_CHILDREN        0x00000010L
  1963. #define PRF_OWNED           0x00000020L
  1964.  
  1965. /* 3D border styles */
  1966. #define BDR_RAISEDOUTER 0x0001
  1967. #define BDR_SUNKENOUTER 0x0002
  1968. #define BDR_RAISEDINNER 0x0004
  1969. #define BDR_SUNKENINNER 0x0008
  1970.  
  1971.  
  1972. #define EDGE_RAISED     (BDR_RAISEDOUTER | BDR_RAISEDINNER)
  1973. #define EDGE_SUNKEN     (BDR_SUNKENOUTER | BDR_SUNKENINNER)
  1974. #define EDGE_ETCHED     (BDR_SUNKENOUTER | BDR_RAISEDINNER)
  1975. #define EDGE_BUMP       (BDR_RAISEDOUTER | BDR_SUNKENINNER)
  1976.  
  1977. /* Border flags */
  1978. #define BF_LEFT         0x0001
  1979. #define BF_TOP          0x0002
  1980. #define BF_RIGHT        0x0004
  1981. #define BF_BOTTOM       0x0008
  1982.  
  1983. #define BF_TOPLEFT      (BF_TOP | BF_LEFT)
  1984. #define BF_TOPRIGHT     (BF_TOP | BF_RIGHT)
  1985. #define BF_BOTTOMLEFT   (BF_BOTTOM | BF_LEFT)
  1986. #define BF_BOTTOMRIGHT  (BF_BOTTOM | BF_RIGHT)
  1987. #define BF_RECT         (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM)
  1988.  
  1989. #define BF_DIAGONAL     0x0010
  1990.  
  1991. // For diagonal lines, the BF_RECT flags specify the end point of the
  1992. // vector bounded by the rectangle parameter.
  1993. #define BF_DIAGONAL_ENDTOPRIGHT     (BF_DIAGONAL | BF_TOP | BF_RIGHT)
  1994. #define BF_DIAGONAL_ENDTOPLEFT      (BF_DIAGONAL | BF_TOP | BF_LEFT)
  1995. #define BF_DIAGONAL_ENDBOTTOMLEFT   (BF_DIAGONAL | BF_BOTTOM | BF_LEFT)
  1996. #define BF_DIAGONAL_ENDBOTTOMRIGHT  (BF_DIAGONAL | BF_BOTTOM | BF_RIGHT)
  1997.  
  1998.  
  1999. #define BF_MIDDLE       0x0800  /* Fill in the middle */
  2000. #define BF_SOFT         0x1000  /* For softer buttons */
  2001. #define BF_ADJUST       0x2000  /* Calculate the space left over */
  2002. #define BF_FLAT         0x4000  /* For flat rather than 3D borders */
  2003. #define BF_MONO         0x8000  /* For monochrome borders */
  2004.  
  2005.  
  2006. WINUSERAPI
  2007. BOOL
  2008. WINAPI
  2009. DrawEdge(HDC hdc, LPRECT qrc, UINT edge, UINT grfFlags);
  2010.  
  2011. /* flags for DrawFrameControl */
  2012.  
  2013. #define DFC_CAPTION             1
  2014. #define DFC_MENU                2
  2015. #define DFC_SCROLL              3
  2016. #define DFC_BUTTON              4
  2017. #if(WINVER >= 0x0500)
  2018. #define DFC_POPUPMENU           5
  2019. #endif /* WINVER >= 0x0500 */
  2020.  
  2021. #define DFCS_CAPTIONCLOSE       0x0000
  2022. #define DFCS_CAPTIONMIN         0x0001
  2023. #define DFCS_CAPTIONMAX         0x0002
  2024. #define DFCS_CAPTIONRESTORE     0x0003
  2025. #define DFCS_CAPTIONHELP        0x0004
  2026.  
  2027. #define DFCS_MENUARROW          0x0000
  2028. #define DFCS_MENUCHECK          0x0001
  2029. #define DFCS_MENUBULLET         0x0002
  2030. #define DFCS_MENUARROWRIGHT     0x0004
  2031. #define DFCS_SCROLLUP           0x0000
  2032. #define DFCS_SCROLLDOWN         0x0001
  2033. #define DFCS_SCROLLLEFT         0x0002
  2034. #define DFCS_SCROLLRIGHT        0x0003
  2035. #define DFCS_SCROLLCOMBOBOX     0x0005
  2036. #define DFCS_SCROLLSIZEGRIP     0x0008
  2037. #define DFCS_SCROLLSIZEGRIPRIGHT 0x0010
  2038.  
  2039. #define DFCS_BUTTONCHECK        0x0000
  2040. #define DFCS_BUTTONRADIOIMAGE   0x0001
  2041. #define DFCS_BUTTONRADIOMASK    0x0002
  2042. #define DFCS_BUTTONRADIO        0x0004
  2043. #define DFCS_BUTTON3STATE       0x0008
  2044. #define DFCS_BUTTONPUSH         0x0010
  2045.  
  2046. #define DFCS_INACTIVE           0x0100
  2047. #define DFCS_PUSHED             0x0200
  2048. #define DFCS_CHECKED            0x0400
  2049.  
  2050. #if(WINVER >= 0x0500)
  2051. #define DFCS_TRANSPARENT        0x0800
  2052. #define DFCS_HOT                0x1000
  2053. #endif /* WINVER >= 0x0500 */
  2054.  
  2055. #define DFCS_ADJUSTRECT         0x2000
  2056. #define DFCS_FLAT               0x4000
  2057. #define DFCS_MONO               0x8000
  2058.  
  2059. WINUSERAPI
  2060. BOOL
  2061. WINAPI
  2062. DrawFrameControl(HDC, LPRECT, UINT, UINT);
  2063.  
  2064.  
  2065. /* flags for DrawCaption */
  2066. #define DC_ACTIVE           0x0001
  2067. #define DC_SMALLCAP         0x0002
  2068. #define DC_ICON             0x0004
  2069. #define DC_TEXT             0x0008
  2070. #define DC_INBUTTON         0x0010
  2071. #if(WINVER >= 0x0500)
  2072. #define DC_GRADIENT         0x0020
  2073. #endif /* WINVER >= 0x0500 */
  2074.  
  2075. WINUSERAPI
  2076. BOOL
  2077. WINAPI
  2078. DrawCaption(HWND, HDC, CONST RECT *, UINT);
  2079.  
  2080.  
  2081. #define IDANI_OPEN          1
  2082. #define IDANI_CLOSE         2
  2083. #define IDANI_CAPTION       3
  2084.  
  2085. WINUSERAPI
  2086. BOOL
  2087. WINAPI
  2088. DrawAnimatedRects(HWND hwnd, int idAni, CONST RECT * lprcFrom, CONST RECT * lprcTo);
  2089.  
  2090. #endif /* WINVER >= 0x0400 */
  2091.  
  2092. #ifndef NOCLIPBOARD
  2093.  
  2094. // begin_r_winuser
  2095.  
  2096. /*
  2097.  * Predefined Clipboard Formats
  2098.  */
  2099. #define CF_TEXT             1
  2100. #define CF_BITMAP           2
  2101. #define CF_METAFILEPICT     3
  2102. #define CF_SYLK             4
  2103. #define CF_DIF              5
  2104. #define CF_TIFF             6
  2105. #define CF_OEMTEXT          7
  2106. #define CF_DIB              8
  2107. #define CF_PALETTE          9
  2108. #define CF_PENDATA          10
  2109. #define CF_RIFF             11
  2110. #define CF_WAVE             12
  2111. #define CF_UNICODETEXT      13
  2112. #define CF_ENHMETAFILE      14
  2113. #if(WINVER >= 0x0400)
  2114. #define CF_HDROP            15
  2115. #define CF_LOCALE           16
  2116. #define CF_MAX              17
  2117. #endif /* WINVER >= 0x0400 */
  2118.  
  2119. #define CF_OWNERDISPLAY     0x0080
  2120. #define CF_DSPTEXT          0x0081
  2121. #define CF_DSPBITMAP        0x0082
  2122. #define CF_DSPMETAFILEPICT  0x0083
  2123. #define CF_DSPENHMETAFILE   0x008E
  2124.  
  2125. /*
  2126.  * "Private" formats don't get GlobalFree()'d
  2127.  */
  2128. #define CF_PRIVATEFIRST     0x0200
  2129. #define CF_PRIVATELAST      0x02FF
  2130.  
  2131. /*
  2132.  * "GDIOBJ" formats do get DeleteObject()'d
  2133.  */
  2134. #define CF_GDIOBJFIRST      0x0300
  2135. #define CF_GDIOBJLAST       0x03FF
  2136.  
  2137. // end_r_winuser
  2138.  
  2139. #endif /* !NOCLIPBOARD */
  2140.  
  2141. /*
  2142.  * Defines for the fVirt field of the Accelerator table structure.
  2143.  */
  2144. #define FVIRTKEY  TRUE          /* Assumed to be == TRUE */
  2145. #define FNOINVERT 0x02
  2146. #define FSHIFT    0x04
  2147. #define FCONTROL  0x08
  2148. #define FALT      0x10
  2149.  
  2150. typedef struct tagACCEL {
  2151. #ifndef _MAC
  2152.     BYTE   fVirt;               /* Also called the flags field */
  2153.     WORD   key;
  2154.     WORD   cmd;
  2155. #else
  2156.     WORD   fVirt;               /* Also called the flags field */
  2157.     WORD   key;
  2158.     DWORD  cmd;
  2159. #endif
  2160. } ACCEL, *LPACCEL;
  2161.  
  2162. typedef struct tagPAINTSTRUCT {
  2163.     HDC         hdc;
  2164.     BOOL        fErase;
  2165.     RECT        rcPaint;
  2166.     BOOL        fRestore;
  2167.     BOOL        fIncUpdate;
  2168.     BYTE        rgbReserved[32];
  2169. } PAINTSTRUCT, *PPAINTSTRUCT, *NPPAINTSTRUCT, *LPPAINTSTRUCT;
  2170.  
  2171. typedef struct tagCREATESTRUCTA {
  2172.     LPVOID      lpCreateParams;
  2173.     HINSTANCE   hInstance;
  2174.     HMENU       hMenu;
  2175.     HWND        hwndParent;
  2176.     int         cy;
  2177.     int         cx;
  2178.     int         y;
  2179.     int         x;
  2180.     LONG        style;
  2181.     LPCSTR      lpszName;
  2182.     LPCSTR      lpszClass;
  2183.     DWORD       dwExStyle;
  2184. } CREATESTRUCTA, *LPCREATESTRUCTA;
  2185. typedef struct tagCREATESTRUCTW {
  2186.     LPVOID      lpCreateParams;
  2187.     HINSTANCE   hInstance;
  2188.     HMENU       hMenu;
  2189.     HWND        hwndParent;
  2190.     int         cy;
  2191.     int         cx;
  2192.     int         y;
  2193.     int         x;
  2194.     LONG        style;
  2195.     LPCWSTR     lpszName;
  2196.     LPCWSTR     lpszClass;
  2197.     DWORD       dwExStyle;
  2198. } CREATESTRUCTW, *LPCREATESTRUCTW;
  2199. #ifdef UNICODE
  2200. typedef CREATESTRUCTW CREATESTRUCT;
  2201. typedef LPCREATESTRUCTW LPCREATESTRUCT;
  2202. #else
  2203. typedef CREATESTRUCTA CREATESTRUCT;
  2204. typedef LPCREATESTRUCTA LPCREATESTRUCT;
  2205. #endif // UNICODE
  2206.  
  2207. typedef struct tagWINDOWPLACEMENT {
  2208.     UINT  length;
  2209.     UINT  flags;
  2210.     UINT  showCmd;
  2211.     POINT ptMinPosition;
  2212.     POINT ptMaxPosition;
  2213.     RECT  rcNormalPosition;
  2214. #ifdef _MAC
  2215.     RECT  rcDevice;
  2216. #endif
  2217. } WINDOWPLACEMENT;
  2218. typedef WINDOWPLACEMENT *PWINDOWPLACEMENT, *LPWINDOWPLACEMENT;
  2219.  
  2220. #define WPF_SETMINPOSITION      0x0001
  2221. #define WPF_RESTORETOMAXIMIZED  0x0002
  2222. #if(WINVER >= 0x0400)
  2223. typedef struct tagNMHDR
  2224. {
  2225.     HWND  hwndFrom;
  2226.     UINT  idFrom;
  2227.     UINT  code;         // NM_ code
  2228. }   NMHDR;
  2229. typedef NMHDR FAR * LPNMHDR;
  2230.  
  2231. typedef struct tagSTYLESTRUCT
  2232. {
  2233.     DWORD   styleOld;
  2234.     DWORD   styleNew;
  2235. } STYLESTRUCT, * LPSTYLESTRUCT;
  2236. #endif /* WINVER >= 0x0400 */
  2237.  
  2238.  
  2239. /*
  2240.  * Owner draw control types
  2241.  */
  2242. #define ODT_MENU        1
  2243. #define ODT_LISTBOX     2
  2244. #define ODT_COMBOBOX    3
  2245. #define ODT_BUTTON      4
  2246. #if(WINVER >= 0x0400)
  2247. #define ODT_STATIC      5
  2248. #endif /* WINVER >= 0x0400 */
  2249.  
  2250. /*
  2251.  * Owner draw actions
  2252.  */
  2253. #define ODA_DRAWENTIRE  0x0001
  2254. #define ODA_SELECT      0x0002
  2255. #define ODA_FOCUS       0x0004
  2256.  
  2257. /*
  2258.  * Owner draw state
  2259.  */
  2260. #define ODS_SELECTED    0x0001
  2261. #define ODS_GRAYED      0x0002
  2262. #define ODS_DISABLED    0x0004
  2263. #define ODS_CHECKED     0x0008
  2264. #define ODS_FOCUS       0x0010
  2265. #if(WINVER >= 0x0400)
  2266. #define ODS_DEFAULT         0x0020
  2267. #define ODS_COMBOBOXEDIT    0x1000
  2268. #endif /* WINVER >= 0x0400 */
  2269. #if(WINVER >= 0x0500)
  2270. #define ODS_HOTLIGHT        0x0040
  2271. #define ODS_INACTIVE        0x0080
  2272. #endif /* WINVER >= 0x0500 */
  2273.  
  2274. /*
  2275.  * MEASUREITEMSTRUCT for ownerdraw
  2276.  */
  2277. typedef struct tagMEASUREITEMSTRUCT {
  2278.     UINT       CtlType;
  2279.     UINT       CtlID;
  2280.     UINT       itemID;
  2281.     UINT       itemWidth;
  2282.     UINT       itemHeight;
  2283.     DWORD      itemData;
  2284. } MEASUREITEMSTRUCT, NEAR *PMEASUREITEMSTRUCT, FAR *LPMEASUREITEMSTRUCT;
  2285.  
  2286.  
  2287. /*
  2288.  * DRAWITEMSTRUCT for ownerdraw
  2289.  */
  2290. typedef struct tagDRAWITEMSTRUCT {
  2291.     UINT        CtlType;
  2292.     UINT        CtlID;
  2293.     UINT        itemID;
  2294.     UINT        itemAction;
  2295.     UINT        itemState;
  2296.     HWND        hwndItem;
  2297.     HDC         hDC;
  2298.     RECT        rcItem;
  2299.     DWORD       itemData;
  2300. } DRAWITEMSTRUCT, NEAR *PDRAWITEMSTRUCT, FAR *LPDRAWITEMSTRUCT;
  2301.  
  2302. /*
  2303.  * DELETEITEMSTRUCT for ownerdraw
  2304.  */
  2305. typedef struct tagDELETEITEMSTRUCT {
  2306.     UINT       CtlType;
  2307.     UINT       CtlID;
  2308.     UINT       itemID;
  2309.     HWND       hwndItem;
  2310.     UINT       itemData;
  2311. } DELETEITEMSTRUCT, NEAR *PDELETEITEMSTRUCT, FAR *LPDELETEITEMSTRUCT;
  2312.  
  2313. /*
  2314.  * COMPAREITEMSTUCT for ownerdraw sorting
  2315.  */
  2316. typedef struct tagCOMPAREITEMSTRUCT {
  2317.     UINT        CtlType;
  2318.     UINT        CtlID;
  2319.     HWND        hwndItem;
  2320.     UINT        itemID1;
  2321.     DWORD       itemData1;
  2322.     UINT        itemID2;
  2323.     DWORD       itemData2;
  2324.     DWORD       dwLocaleId;
  2325. } COMPAREITEMSTRUCT, NEAR *PCOMPAREITEMSTRUCT, FAR *LPCOMPAREITEMSTRUCT;
  2326.  
  2327. #ifndef NOMSG
  2328.  
  2329. /*
  2330.  * Message Function Templates
  2331.  */
  2332.  
  2333. WINUSERAPI
  2334. BOOL
  2335. WINAPI
  2336. GetMessageA(
  2337.     LPMSG lpMsg,
  2338.     HWND hWnd ,
  2339.     UINT wMsgFilterMin,
  2340.     UINT wMsgFilterMax);
  2341. WINUSERAPI
  2342. BOOL
  2343. WINAPI
  2344. GetMessageW(
  2345.     LPMSG lpMsg,
  2346.     HWND hWnd ,
  2347.     UINT wMsgFilterMin,
  2348.     UINT wMsgFilterMax);
  2349. #ifdef UNICODE
  2350. #define GetMessage  GetMessageW
  2351. #else
  2352. #define GetMessage  GetMessageA
  2353. #endif // !UNICODE
  2354.  
  2355. WINUSERAPI
  2356. BOOL
  2357. WINAPI
  2358. TranslateMessage(
  2359.     CONST MSG *lpMsg);
  2360.  
  2361. WINUSERAPI
  2362. LONG
  2363. WINAPI
  2364. DispatchMessageA(
  2365.     CONST MSG *lpMsg);
  2366. WINUSERAPI
  2367. LONG
  2368. WINAPI
  2369. DispatchMessageW(
  2370.     CONST MSG *lpMsg);
  2371. #ifdef UNICODE
  2372. #define DispatchMessage  DispatchMessageW
  2373. #else
  2374. #define DispatchMessage  DispatchMessageA
  2375. #endif // !UNICODE
  2376.  
  2377.  
  2378. WINUSERAPI
  2379. BOOL
  2380. WINAPI
  2381. SetMessageQueue(
  2382.     int cMessagesMax);
  2383.  
  2384. WINUSERAPI
  2385. BOOL
  2386. WINAPI
  2387. PeekMessageA(
  2388.     LPMSG lpMsg,
  2389.     HWND hWnd ,
  2390.     UINT wMsgFilterMin,
  2391.     UINT wMsgFilterMax,
  2392.     UINT wRemoveMsg);
  2393. WINUSERAPI
  2394. BOOL
  2395. WINAPI
  2396. PeekMessageW(
  2397.     LPMSG lpMsg,
  2398.     HWND hWnd ,
  2399.     UINT wMsgFilterMin,
  2400.     UINT wMsgFilterMax,
  2401.     UINT wRemoveMsg);
  2402. #ifdef UNICODE
  2403. #define PeekMessage  PeekMessageW
  2404. #else
  2405. #define PeekMessage  PeekMessageA
  2406. #endif // !UNICODE
  2407.  
  2408. /*
  2409.  * PeekMessage() Options
  2410.  */
  2411. #define PM_NOREMOVE         0x0000
  2412. #define PM_REMOVE           0x0001
  2413. #define PM_NOYIELD          0x0002
  2414.  
  2415. #endif /* !NOMSG */
  2416.  
  2417. WINUSERAPI
  2418. BOOL
  2419. WINAPI
  2420. RegisterHotKey(
  2421.     HWND hWnd ,
  2422.     int id,
  2423.     UINT fsModifiers,
  2424.     UINT vk);
  2425.  
  2426. WINUSERAPI
  2427. BOOL
  2428. WINAPI
  2429. UnregisterHotKey(
  2430.     HWND hWnd,
  2431.     int id);
  2432.  
  2433. #define MOD_ALT         0x0001
  2434. #define MOD_CONTROL     0x0002
  2435. #define MOD_SHIFT       0x0004
  2436. #define MOD_WIN         0x0008
  2437.  
  2438.  
  2439. #define IDHOT_SNAPWINDOW        (-1)    /* SHIFT-PRINTSCRN  */
  2440. #define IDHOT_SNAPDESKTOP       (-2)    /* PRINTSCRN        */
  2441.  
  2442. #ifdef WIN_INTERNAL
  2443.     #ifndef LSTRING
  2444.     #define NOLSTRING
  2445.     #endif /* LSTRING */
  2446.     #ifndef LFILEIO
  2447.     #define NOLFILEIO
  2448.     #endif /* LFILEIO */
  2449. #endif /* WIN_INTERNAL */
  2450.  
  2451. #if(WINVER >= 0x0400)
  2452.  
  2453. #define ENDSESSION_LOGOFF    0x80000000
  2454. #endif /* WINVER >= 0x0400 */
  2455.  
  2456. #define EWX_LOGOFF           0
  2457. #define EWX_SHUTDOWN         0x00000001
  2458. #define EWX_REBOOT           0x00000002
  2459. #define EWX_FORCE            0x00000004
  2460. #define EWX_POWEROFF         0x00000008
  2461. #if(_WIN32_WINNT >= 0x0500)
  2462. #define EWX_FORCEIFHUNG      0x00000010
  2463. #endif /* _WIN32_WINNT >= 0x0500 */
  2464.  
  2465.  
  2466. #define ExitWindows(dwReserved, Code) ExitWindowsEx(EWX_LOGOFF, 0xFFFFFFFF)
  2467.  
  2468. WINUSERAPI
  2469. BOOL
  2470. WINAPI
  2471. ExitWindowsEx(
  2472.     UINT uFlags,
  2473.     DWORD dwReserved);
  2474.  
  2475. WINUSERAPI
  2476. BOOL
  2477. WINAPI
  2478. SwapMouseButton(
  2479.     BOOL fSwap);
  2480.  
  2481. WINUSERAPI
  2482. DWORD
  2483. WINAPI
  2484. GetMessagePos(
  2485.     VOID);
  2486.  
  2487. WINUSERAPI
  2488. LONG
  2489. WINAPI
  2490. GetMessageTime(
  2491.     VOID);
  2492.  
  2493. WINUSERAPI
  2494. LONG
  2495. WINAPI
  2496. GetMessageExtraInfo(
  2497.     VOID);
  2498.  
  2499. #if(WINVER >= 0x0400)
  2500. WINUSERAPI
  2501. LPARAM
  2502. WINAPI
  2503. SetMessageExtraInfo(
  2504.     LPARAM lParam);
  2505. #endif /* WINVER >= 0x0400 */
  2506.  
  2507. WINUSERAPI
  2508. LRESULT
  2509. WINAPI
  2510. SendMessageA(
  2511.     HWND hWnd,
  2512.     UINT Msg,
  2513.     WPARAM wParam,
  2514.     LPARAM lParam);
  2515. WINUSERAPI
  2516. LRESULT
  2517. WINAPI
  2518. SendMessageW(
  2519.     HWND hWnd,
  2520.     UINT Msg,
  2521.     WPARAM wParam,
  2522.     LPARAM lParam);
  2523. #ifdef UNICODE
  2524. #define SendMessage  SendMessageW
  2525. #else
  2526. #define SendMessage  SendMessageA
  2527. #endif // !UNICODE
  2528.  
  2529. WINUSERAPI
  2530. LRESULT
  2531. WINAPI
  2532. SendMessageTimeoutA(
  2533.     HWND hWnd,
  2534.     UINT Msg,
  2535.     WPARAM wParam,
  2536.     LPARAM lParam,
  2537.     UINT fuFlags,
  2538.     UINT uTimeout,
  2539.     LPDWORD lpdwResult);
  2540. WINUSERAPI
  2541. LRESULT
  2542. WINAPI
  2543. SendMessageTimeoutW(
  2544.     HWND hWnd,
  2545.     UINT Msg,
  2546.     WPARAM wParam,
  2547.     LPARAM lParam,
  2548.     UINT fuFlags,
  2549.     UINT uTimeout,
  2550.     LPDWORD lpdwResult);
  2551. #ifdef UNICODE
  2552. #define SendMessageTimeout  SendMessageTimeoutW
  2553. #else
  2554. #define SendMessageTimeout  SendMessageTimeoutA
  2555. #endif // !UNICODE
  2556.  
  2557. WINUSERAPI
  2558. BOOL
  2559. WINAPI
  2560. SendNotifyMessageA(
  2561.     HWND hWnd,
  2562.     UINT Msg,
  2563.     WPARAM wParam,
  2564.     LPARAM lParam);
  2565. WINUSERAPI
  2566. BOOL
  2567. WINAPI
  2568. SendNotifyMessageW(
  2569.     HWND hWnd,
  2570.     UINT Msg,
  2571.     WPARAM wParam,
  2572.     LPARAM lParam);
  2573. #ifdef UNICODE
  2574. #define SendNotifyMessage  SendNotifyMessageW
  2575. #else
  2576. #define SendNotifyMessage  SendNotifyMessageA
  2577. #endif // !UNICODE
  2578.  
  2579. WINUSERAPI
  2580. BOOL
  2581. WINAPI
  2582. SendMessageCallbackA(
  2583.     HWND hWnd,
  2584.     UINT Msg,
  2585.     WPARAM wParam,
  2586.     LPARAM lParam,
  2587.     SENDASYNCPROC lpResultCallBack,
  2588.     DWORD dwData);
  2589. WINUSERAPI
  2590. BOOL
  2591. WINAPI
  2592. SendMessageCallbackW(
  2593.     HWND hWnd,
  2594.     UINT Msg,
  2595.     WPARAM wParam,
  2596.     LPARAM lParam,
  2597.     SENDASYNCPROC lpResultCallBack,
  2598.     DWORD dwData);
  2599. #ifdef UNICODE
  2600. #define SendMessageCallback  SendMessageCallbackW
  2601. #else
  2602. #define SendMessageCallback  SendMessageCallbackA
  2603. #endif // !UNICODE
  2604.  
  2605. #if(WINVER >= 0x0400)
  2606.  
  2607. #if defined(_WIN32_WINNT)
  2608. WINUSERAPI long  WINAPI  BroadcastSystemMessageA(DWORD, LPDWORD, UINT, WPARAM, LPARAM);
  2609. WINUSERAPI long  WINAPI  BroadcastSystemMessageW(DWORD, LPDWORD, UINT, WPARAM, LPARAM);
  2610. #ifdef UNICODE
  2611. #define BroadcastSystemMessage  BroadcastSystemMessageW
  2612. #else
  2613. #define BroadcastSystemMessage  BroadcastSystemMessageA
  2614. #endif // !UNICODE
  2615. #elif defined(_WIN32_WINDOWS)
  2616. // The Win95 version isn't A/W decorated
  2617. WINUSERAPI long  WINAPI  BroadcastSystemMessage(DWORD, LPDWORD, UINT, WPARAM, LPARAM);
  2618. #endif
  2619.  
  2620. //Broadcast Special Message Recipient list
  2621. #define BSM_ALLCOMPONENTS       0x00000000
  2622. #define BSM_VXDS                0x00000001
  2623. #define BSM_NETDRIVER           0x00000002
  2624. #define BSM_INSTALLABLEDRIVERS  0x00000004
  2625. #define BSM_APPLICATIONS        0x00000008
  2626. #define BSM_ALLDESKTOPS         0x00000010
  2627.  
  2628. //Broadcast Special Message Flags
  2629. #define BSF_QUERY               0x00000001
  2630. #define BSF_IGNORECURRENTTASK   0x00000002
  2631. #define BSF_FLUSHDISK           0x00000004
  2632. #define BSF_NOHANG              0x00000008
  2633. #define BSF_POSTMESSAGE         0x00000010
  2634. #define BSF_FORCEIFHUNG         0x00000020
  2635. #define BSF_NOTIMEOUTIFNOTHUNG  0x00000040
  2636.  
  2637. #define BROADCAST_QUERY_DENY         0x424D5144  // Return this value to deny a query.
  2638. #endif /* WINVER >= 0x0400 */
  2639.  
  2640. // RegisterDeviceNotification
  2641.  
  2642. #if(WINVER >= 0x0500)
  2643. typedef  PVOID           HDEVNOTIFY;
  2644. typedef  HDEVNOTIFY     *PHDEVNOTIFY;
  2645.  
  2646. #define DEVICE_NOTIFY_WINDOW_HANDLE     0x00000000
  2647.  
  2648. WINUSERAPI
  2649. HDEVNOTIFY
  2650. WINAPI
  2651. RegisterDeviceNotificationA(
  2652.     IN HANDLE hRecipient,
  2653.     IN LPVOID NotificationFilter,
  2654.     IN DWORD Flags
  2655.     );
  2656. WINUSERAPI
  2657. HDEVNOTIFY
  2658. WINAPI
  2659. RegisterDeviceNotificationW(
  2660.     IN HANDLE hRecipient,
  2661.     IN LPVOID NotificationFilter,
  2662.     IN DWORD Flags
  2663.     );
  2664. #ifdef UNICODE
  2665. #define RegisterDeviceNotification  RegisterDeviceNotificationW
  2666. #else
  2667. #define RegisterDeviceNotification  RegisterDeviceNotificationA
  2668. #endif // !UNICODE
  2669.  
  2670. WINUSERAPI
  2671. BOOL
  2672. WINAPI
  2673. UnregisterDeviceNotification(
  2674.     IN HDEVNOTIFY Handle
  2675.     );
  2676. #endif /* WINVER >= 0x0500 */
  2677.  
  2678.  
  2679. WINUSERAPI
  2680. BOOL
  2681. WINAPI
  2682. PostMessageA(
  2683.     HWND hWnd,
  2684.     UINT Msg,
  2685.     WPARAM wParam,
  2686.     LPARAM lParam);
  2687. WINUSERAPI
  2688. BOOL
  2689. WINAPI
  2690. PostMessageW(
  2691.     HWND hWnd,
  2692.     UINT Msg,
  2693.     WPARAM wParam,
  2694.     LPARAM lParam);
  2695. #ifdef UNICODE
  2696. #define PostMessage  PostMessageW
  2697. #else
  2698. #define PostMessage  PostMessageA
  2699. #endif // !UNICODE
  2700.  
  2701. WINUSERAPI
  2702. BOOL
  2703. WINAPI
  2704. PostThreadMessageA(
  2705.     DWORD idThread,
  2706.     UINT Msg,
  2707.     WPARAM wParam,
  2708.     LPARAM lParam);
  2709. WINUSERAPI
  2710. BOOL
  2711. WINAPI
  2712. PostThreadMessageW(
  2713.     DWORD idThread,
  2714.     UINT Msg,
  2715.     WPARAM wParam,
  2716.     LPARAM lParam);
  2717. #ifdef UNICODE
  2718. #define PostThreadMessage  PostThreadMessageW
  2719. #else
  2720. #define PostThreadMessage  PostThreadMessageA
  2721. #endif // !UNICODE
  2722.  
  2723. #define PostAppMessageA(idThread, wMsg, wParam, lParam)\
  2724.         PostThreadMessageA((DWORD)idThread, wMsg, wParam, lParam)
  2725. #define PostAppMessageW(idThread, wMsg, wParam, lParam)\
  2726.         PostThreadMessageW((DWORD)idThread, wMsg, wParam, lParam)
  2727. #ifdef UNICODE
  2728. #define PostAppMessage  PostAppMessageW
  2729. #else
  2730. #define PostAppMessage  PostAppMessageA
  2731. #endif // !UNICODE
  2732.  
  2733. /*
  2734.  * Special HWND value for use with PostMessage() and SendMessage()
  2735.  */
  2736. #define HWND_BROADCAST  ((HWND)0xffff)
  2737.  
  2738. #if(WINVER >= 0x0500)
  2739. #define HWND_MESSAGE     ((HWND)-3)
  2740. #endif /* WINVER >= 0x0500 */
  2741.  
  2742. WINUSERAPI
  2743. BOOL
  2744. WINAPI
  2745. AttachThreadInput(
  2746.     DWORD idAttach,
  2747.     DWORD idAttachTo,
  2748.     BOOL fAttach);
  2749.  
  2750.  
  2751. WINUSERAPI
  2752. BOOL
  2753. WINAPI
  2754. ReplyMessage(
  2755.     LRESULT lResult);
  2756.  
  2757. WINUSERAPI
  2758. BOOL
  2759. WINAPI
  2760. WaitMessage(
  2761.     VOID);
  2762.  
  2763. WINUSERAPI
  2764. DWORD
  2765. WINAPI
  2766. WaitForInputIdle(
  2767.     HANDLE hProcess,
  2768.     DWORD dwMilliseconds);
  2769.  
  2770. WINUSERAPI
  2771. #ifndef _MAC
  2772. LRESULT
  2773. WINAPI
  2774. #else
  2775. LRESULT
  2776. CALLBACK
  2777. #endif
  2778. DefWindowProcA(
  2779.     HWND hWnd,
  2780.     UINT Msg,
  2781.     WPARAM wParam,
  2782.     LPARAM lParam);
  2783. WINUSERAPI
  2784. #ifndef _MAC
  2785. LRESULT
  2786. WINAPI
  2787. #else
  2788. LRESULT
  2789. CALLBACK
  2790. #endif
  2791. DefWindowProcW(
  2792.     HWND hWnd,
  2793.     UINT Msg,
  2794.     WPARAM wParam,
  2795.     LPARAM lParam);
  2796. #ifdef UNICODE
  2797. #define DefWindowProc  DefWindowProcW
  2798. #else
  2799. #define DefWindowProc  DefWindowProcA
  2800. #endif // !UNICODE
  2801.  
  2802. WINUSERAPI
  2803. VOID
  2804. WINAPI
  2805. PostQuitMessage(
  2806.     int nExitCode);
  2807.  
  2808. #ifdef STRICT
  2809.  
  2810. WINUSERAPI
  2811. LRESULT
  2812. WINAPI
  2813. CallWindowProcA(
  2814.     WNDPROC lpPrevWndFunc,
  2815.     HWND hWnd,
  2816.     UINT Msg,
  2817.     WPARAM wParam,
  2818.     LPARAM lParam);
  2819. WINUSERAPI
  2820. LRESULT
  2821. WINAPI
  2822. CallWindowProcW(
  2823.     WNDPROC lpPrevWndFunc,
  2824.     HWND hWnd,
  2825.     UINT Msg,
  2826.     WPARAM wParam,
  2827.     LPARAM lParam);
  2828. #ifdef UNICODE
  2829. #define CallWindowProc  CallWindowProcW
  2830. #else
  2831. #define CallWindowProc  CallWindowProcA
  2832. #endif // !UNICODE
  2833.  
  2834. #else /* !STRICT */
  2835.  
  2836. WINUSERAPI
  2837. LRESULT
  2838. WINAPI
  2839. CallWindowProcA(
  2840.     FARPROC lpPrevWndFunc,
  2841.     HWND hWnd,
  2842.     UINT Msg,
  2843.     WPARAM wParam,
  2844.     LPARAM lParam);
  2845. WINUSERAPI
  2846. LRESULT
  2847. WINAPI
  2848. CallWindowProcW(
  2849.     FARPROC lpPrevWndFunc,
  2850.     HWND hWnd,
  2851.     UINT Msg,
  2852.     WPARAM wParam,
  2853.     LPARAM lParam);
  2854. #ifdef UNICODE
  2855. #define CallWindowProc  CallWindowProcW
  2856. #else
  2857. #define CallWindowProc  CallWindowProcA
  2858. #endif // !UNICODE
  2859.  
  2860. #endif /* !STRICT */
  2861.  
  2862. WINUSERAPI
  2863. BOOL
  2864. WINAPI
  2865. InSendMessage(
  2866.     VOID);
  2867.  
  2868. #if(WINVER >= 0x0500)
  2869. WINUSERAPI
  2870. DWORD
  2871. WINAPI
  2872. InSendMessageEx(
  2873.     LPVOID lpReserved);
  2874.  
  2875. /*
  2876.  * InSendMessageEx return value
  2877.  */
  2878. #define ISMEX_NOSEND      0x00000000
  2879. #define ISMEX_SEND        0x00000001
  2880. #define ISMEX_NOTIFY      0x00000002
  2881. #define ISMEX_CALLBACK    0x00000004
  2882. #define ISMEX_REPLIED     0x00000008
  2883. #endif /* WINVER >= 0x0500 */
  2884.  
  2885. WINUSERAPI
  2886. UINT
  2887. WINAPI
  2888. GetDoubleClickTime(
  2889.     VOID);
  2890.  
  2891. WINUSERAPI
  2892. BOOL
  2893. WINAPI
  2894. SetDoubleClickTime(
  2895.     UINT);
  2896.  
  2897. WINUSERAPI
  2898. ATOM
  2899. WINAPI
  2900. RegisterClassA(
  2901.     CONST WNDCLASSA *lpWndClass);
  2902. WINUSERAPI
  2903. ATOM
  2904. WINAPI
  2905. RegisterClassW(
  2906.     CONST WNDCLASSW *lpWndClass);
  2907. #ifdef UNICODE
  2908. #define RegisterClass  RegisterClassW
  2909. #else
  2910. #define RegisterClass  RegisterClassA
  2911. #endif // !UNICODE
  2912.  
  2913. WINUSERAPI
  2914. BOOL
  2915. WINAPI
  2916. UnregisterClassA(
  2917.     LPCSTR lpClassName,
  2918.     HINSTANCE hInstance);
  2919. WINUSERAPI
  2920. BOOL
  2921. WINAPI
  2922. UnregisterClassW(
  2923.     LPCWSTR lpClassName,
  2924.     HINSTANCE hInstance);
  2925. #ifdef UNICODE
  2926. #define UnregisterClass  UnregisterClassW
  2927. #else
  2928. #define UnregisterClass  UnregisterClassA
  2929. #endif // !UNICODE
  2930.  
  2931. WINUSERAPI
  2932. BOOL
  2933. WINAPI
  2934. GetClassInfoA(
  2935.     HINSTANCE hInstance ,
  2936.     LPCSTR lpClassName,
  2937.     LPWNDCLASSA lpWndClass);
  2938. WINUSERAPI
  2939. BOOL
  2940. WINAPI
  2941. GetClassInfoW(
  2942.     HINSTANCE hInstance ,
  2943.     LPCWSTR lpClassName,
  2944.     LPWNDCLASSW lpWndClass);
  2945. #ifdef UNICODE
  2946. #define GetClassInfo  GetClassInfoW
  2947. #else
  2948. #define GetClassInfo  GetClassInfoA
  2949. #endif // !UNICODE
  2950.  
  2951. #if(WINVER >= 0x0400)
  2952. WINUSERAPI
  2953. ATOM
  2954. WINAPI
  2955. RegisterClassExA(CONST WNDCLASSEXA *);
  2956. WINUSERAPI
  2957. ATOM
  2958. WINAPI
  2959. RegisterClassExW(CONST WNDCLASSEXW *);
  2960. #ifdef UNICODE
  2961. #define RegisterClassEx  RegisterClassExW
  2962. #else
  2963. #define RegisterClassEx  RegisterClassExA
  2964. #endif // !UNICODE
  2965.  
  2966. WINUSERAPI
  2967. BOOL
  2968. WINAPI
  2969. GetClassInfoExA(HINSTANCE, LPCSTR, LPWNDCLASSEXA);
  2970. WINUSERAPI
  2971. BOOL
  2972. WINAPI
  2973. GetClassInfoExW(HINSTANCE, LPCWSTR, LPWNDCLASSEXW);
  2974. #ifdef UNICODE
  2975. #define GetClassInfoEx  GetClassInfoExW
  2976. #else
  2977. #define GetClassInfoEx  GetClassInfoExA
  2978. #endif // !UNICODE
  2979.  
  2980. #endif /* WINVER >= 0x0400 */
  2981.  
  2982. #define CW_USEDEFAULT       ((int)0x80000000)
  2983.  
  2984. /*
  2985.  * Special value for CreateWindow, et al.
  2986.  */
  2987. #define HWND_DESKTOP        ((HWND)0)
  2988.  
  2989. WINUSERAPI
  2990. HWND
  2991. WINAPI
  2992. CreateWindowExA(
  2993.     DWORD dwExStyle,
  2994.     LPCSTR lpClassName,
  2995.     LPCSTR lpWindowName,
  2996.     DWORD dwStyle,
  2997.     int X,
  2998.     int Y,
  2999.     int nWidth,
  3000.     int nHeight,
  3001.     HWND hWndParent ,
  3002.     HMENU hMenu,
  3003.     HINSTANCE hInstance,
  3004.     LPVOID lpParam);
  3005. WINUSERAPI
  3006. HWND
  3007. WINAPI
  3008. CreateWindowExW(
  3009.     DWORD dwExStyle,
  3010.     LPCWSTR lpClassName,
  3011.     LPCWSTR lpWindowName,
  3012.     DWORD dwStyle,
  3013.     int X,
  3014.     int Y,
  3015.     int nWidth,
  3016.     int nHeight,
  3017.     HWND hWndParent ,
  3018.     HMENU hMenu,
  3019.     HINSTANCE hInstance,
  3020.     LPVOID lpParam);
  3021. #ifdef UNICODE
  3022. #define CreateWindowEx  CreateWindowExW
  3023. #else
  3024. #define CreateWindowEx  CreateWindowExA
  3025. #endif // !UNICODE
  3026.  
  3027. #define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y,\
  3028. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\
  3029. CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,\
  3030. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
  3031. #define CreateWindowW(lpClassName, lpWindowName, dwStyle, x, y,\
  3032. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\
  3033. CreateWindowExW(0L, lpClassName, lpWindowName, dwStyle, x, y,\
  3034. nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
  3035. #ifdef UNICODE
  3036. #define CreateWindow  CreateWindowW
  3037. #else
  3038. #define CreateWindow  CreateWindowA
  3039. #endif // !UNICODE
  3040.  
  3041. WINUSERAPI
  3042. BOOL
  3043. WINAPI
  3044. IsWindow(
  3045.     HWND hWnd);
  3046.  
  3047. WINUSERAPI
  3048. BOOL
  3049. WINAPI
  3050. IsMenu(
  3051.     HMENU hMenu);
  3052.  
  3053. WINUSERAPI
  3054. BOOL
  3055. WINAPI
  3056. IsChild(
  3057.     HWND hWndParent,
  3058.     HWND hWnd);
  3059.  
  3060. WINUSERAPI
  3061. BOOL
  3062. WINAPI
  3063. DestroyWindow(
  3064.     HWND hWnd);
  3065.  
  3066. WINUSERAPI
  3067. BOOL
  3068. WINAPI
  3069. ShowWindow(
  3070.     HWND hWnd,
  3071.     int nCmdShow);
  3072.  
  3073. #if(WINVER >= 0x0500)
  3074. WINUSERAPI
  3075. BOOL
  3076. WINAPI
  3077. AnimateWindow(
  3078.     HWND hWnd,
  3079.     DWORD dwTime,
  3080.     DWORD dwFlags);
  3081. #endif /* WINVER >= 0x0500 */
  3082.  
  3083. #if(WINVER >= 0x0400)
  3084. WINUSERAPI
  3085. BOOL
  3086. WINAPI
  3087. ShowWindowAsync(
  3088.     HWND hWnd,
  3089.     int nCmdShow);
  3090. #endif /* WINVER >= 0x0400 */
  3091.  
  3092. WINUSERAPI
  3093. BOOL
  3094. WINAPI
  3095. FlashWindow(
  3096.     HWND hWnd,
  3097. #if(WINVER >= 0x0500)
  3098.     DWORD dwFlags);
  3099. #else
  3100.     BOOL bInvert);
  3101. #endif
  3102.  
  3103. #if(WINVER >= 0x0500)
  3104. #define FLASHW_STOP         0
  3105. #define FLASHW_CAPTION      0x00000001
  3106. #define FLASHW_TRAY         0x00000002
  3107. #define FLASHW_ALL          (FLASHW_CAPTION | FLASHW_TRAY)
  3108. #define FLASHW_TIMER        0x00000004
  3109. #define FLASHW_TIMERNOFG    0x0000000C
  3110. #endif /* WINVER >= 0x0500 */
  3111.  
  3112. WINUSERAPI
  3113. BOOL
  3114. WINAPI
  3115. ShowOwnedPopups(
  3116.     HWND hWnd,
  3117.     BOOL fShow);
  3118.  
  3119. WINUSERAPI
  3120. BOOL
  3121. WINAPI
  3122. OpenIcon(
  3123.     HWND hWnd);
  3124.  
  3125. WINUSERAPI
  3126. BOOL
  3127. WINAPI
  3128. CloseWindow(
  3129.     HWND hWnd);
  3130.  
  3131. WINUSERAPI
  3132. BOOL
  3133. WINAPI
  3134. MoveWindow(
  3135.     HWND hWnd,
  3136.     int X,
  3137.     int Y,
  3138.     int nWidth,
  3139.     int nHeight,
  3140.     BOOL bRepaint);
  3141.  
  3142. WINUSERAPI
  3143. BOOL
  3144. WINAPI
  3145. SetWindowPos(
  3146.     HWND hWnd,
  3147.     HWND hWndInsertAfter ,
  3148.     int X,
  3149.     int Y,
  3150.     int cx,
  3151.     int cy,
  3152.     UINT uFlags);
  3153.  
  3154. WINUSERAPI
  3155. BOOL
  3156. WINAPI
  3157. GetWindowPlacement(
  3158.     HWND hWnd,
  3159.     WINDOWPLACEMENT *lpwndpl);
  3160.  
  3161. WINUSERAPI
  3162. BOOL
  3163. WINAPI
  3164. SetWindowPlacement(
  3165.     HWND hWnd,
  3166.     CONST WINDOWPLACEMENT *lpwndpl);
  3167.  
  3168.  
  3169. #ifndef NODEFERWINDOWPOS
  3170.  
  3171. WINUSERAPI
  3172. HDWP
  3173. WINAPI
  3174. BeginDeferWindowPos(
  3175.     int nNumWindows);
  3176.  
  3177. WINUSERAPI
  3178. HDWP
  3179. WINAPI
  3180. DeferWindowPos(
  3181.     HDWP hWinPosInfo,
  3182.     HWND hWnd,
  3183.     HWND hWndInsertAfter ,
  3184.     int x,
  3185.     int y,
  3186.     int cx,
  3187.     int cy,
  3188.     UINT uFlags);
  3189.  
  3190. WINUSERAPI
  3191. BOOL
  3192. WINAPI
  3193. EndDeferWindowPos(
  3194.     HDWP hWinPosInfo);
  3195.  
  3196. #endif /* !NODEFERWINDOWPOS */
  3197.  
  3198. WINUSERAPI
  3199. BOOL
  3200. WINAPI
  3201. IsWindowVisible(
  3202.     HWND hWnd);
  3203.  
  3204. WINUSERAPI
  3205. BOOL
  3206. WINAPI
  3207. IsIconic(
  3208.     HWND hWnd);
  3209.  
  3210. WINUSERAPI
  3211. BOOL
  3212. WINAPI
  3213. AnyPopup(
  3214.     VOID);
  3215.  
  3216. WINUSERAPI
  3217. BOOL
  3218. WINAPI
  3219. BringWindowToTop(
  3220.     HWND hWnd);
  3221.  
  3222. WINUSERAPI
  3223. BOOL
  3224. WINAPI
  3225. IsZoomed(
  3226.     HWND hWnd);
  3227.  
  3228. /*
  3229.  * SetWindowPos Flags
  3230.  */
  3231. #define SWP_NOSIZE          0x0001
  3232. #define SWP_NOMOVE          0x0002
  3233. #define SWP_NOZORDER        0x0004
  3234. #define SWP_NOREDRAW        0x0008
  3235. #define SWP_NOACTIVATE      0x0010
  3236. #define SWP_FRAMECHANGED    0x0020  /* The frame changed: send WM_NCCALCSIZE */
  3237. #define SWP_SHOWWINDOW      0x0040
  3238. #define SWP_HIDEWINDOW      0x0080
  3239. #define SWP_NOCOPYBITS      0x0100
  3240. #define SWP_NOOWNERZORDER   0x0200  /* Don't do owner Z ordering */
  3241. #define SWP_NOSENDCHANGING  0x0400  /* Don't send WM_WINDOWPOSCHANGING */
  3242.  
  3243. #define SWP_DRAWFRAME       SWP_FRAMECHANGED
  3244. #define SWP_NOREPOSITION    SWP_NOOWNERZORDER
  3245.  
  3246. #if(WINVER >= 0x0400)
  3247. #define SWP_DEFERERASE      0x2000
  3248. #define SWP_ASYNCWINDOWPOS  0x4000
  3249. #endif /* WINVER >= 0x0400 */
  3250.  
  3251.  
  3252. #define HWND_TOP        ((HWND)0)
  3253. #define HWND_BOTTOM     ((HWND)1)
  3254. #define HWND_TOPMOST    ((HWND)-1)
  3255. #define HWND_NOTOPMOST  ((HWND)-2)
  3256.  
  3257. #ifndef NOCTLMGR
  3258.  
  3259. /*
  3260.  * WARNING:
  3261.  * The following structures must NOT be DWORD padded because they are
  3262.  * followed by strings, etc that do not have to be DWORD aligned.
  3263.  */
  3264. #include <pshpack2.h>
  3265.  
  3266. /*
  3267.  * original NT 32 bit dialog template:
  3268.  */
  3269. typedef struct {
  3270.     DWORD style;
  3271.     DWORD dwExtendedStyle;
  3272.     WORD cdit;
  3273.     short x;
  3274.     short y;
  3275.     short cx;
  3276.     short cy;
  3277. } DLGTEMPLATE;
  3278. typedef DLGTEMPLATE *LPDLGTEMPLATEA;
  3279. typedef DLGTEMPLATE *LPDLGTEMPLATEW;
  3280. #ifdef UNICODE
  3281. typedef LPDLGTEMPLATEW LPDLGTEMPLATE;
  3282. #else
  3283. typedef LPDLGTEMPLATEA LPDLGTEMPLATE;
  3284. #endif // UNICODE
  3285. typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEA;
  3286. typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEW;
  3287. #ifdef UNICODE
  3288. typedef LPCDLGTEMPLATEW LPCDLGTEMPLATE;
  3289. #else
  3290. typedef LPCDLGTEMPLATEA LPCDLGTEMPLATE;
  3291. #endif // UNICODE
  3292.  
  3293. /*
  3294.  * 32 bit Dialog item template.
  3295.  */
  3296. typedef struct {
  3297.     DWORD style;
  3298.     DWORD dwExtendedStyle;
  3299.     short x;
  3300.     short y;
  3301.     short cx;
  3302.     short cy;
  3303.     WORD id;
  3304. } DLGITEMTEMPLATE;
  3305. typedef DLGITEMTEMPLATE *PDLGITEMTEMPLATEA;
  3306. typedef DLGITEMTEMPLATE *PDLGITEMTEMPLATEW;
  3307. #ifdef UNICODE
  3308. typedef PDLGITEMTEMPLATEW PDLGITEMTEMPLATE;
  3309. #else
  3310. typedef PDLGITEMTEMPLATEA PDLGITEMTEMPLATE;
  3311. #endif // UNICODE
  3312. typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEA;
  3313. typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEW;
  3314. #ifdef UNICODE
  3315. typedef LPDLGITEMTEMPLATEW LPDLGITEMTEMPLATE;
  3316. #else
  3317. typedef LPDLGITEMTEMPLATEA LPDLGITEMTEMPLATE;
  3318. #endif // UNICODE
  3319.  
  3320.  
  3321. #include <poppack.h> /* Resume normal packing */
  3322.  
  3323. WINUSERAPI
  3324. HWND
  3325. WINAPI
  3326. CreateDialogParamA(
  3327.     HINSTANCE hInstance,
  3328.     LPCSTR lpTemplateName,
  3329.     HWND hWndParent ,
  3330.     DLGPROC lpDialogFunc,
  3331.     LPARAM dwInitParam);
  3332. WINUSERAPI
  3333. HWND
  3334. WINAPI
  3335. CreateDialogParamW(
  3336.     HINSTANCE hInstance,
  3337.     LPCWSTR lpTemplateName,
  3338.     HWND hWndParent ,
  3339.     DLGPROC lpDialogFunc,
  3340.     LPARAM dwInitParam);
  3341. #ifdef UNICODE
  3342. #define CreateDialogParam  CreateDialogParamW
  3343. #else
  3344. #define CreateDialogParam  CreateDialogParamA
  3345. #endif // !UNICODE
  3346.  
  3347. WINUSERAPI
  3348. HWND
  3349. WINAPI
  3350. CreateDialogIndirectParamA(
  3351.     HINSTANCE hInstance,
  3352.     LPCDLGTEMPLATEA lpTemplate,
  3353.     HWND hWndParent,
  3354.     DLGPROC lpDialogFunc,
  3355.     LPARAM dwInitParam);
  3356. WINUSERAPI
  3357. HWND
  3358. WINAPI
  3359. CreateDialogIndirectParamW(
  3360.     HINSTANCE hInstance,
  3361.     LPCDLGTEMPLATEW lpTemplate,
  3362.     HWND hWndParent,
  3363.     DLGPROC lpDialogFunc,
  3364.     LPARAM dwInitParam);
  3365. #ifdef UNICODE
  3366. #define CreateDialogIndirectParam  CreateDialogIndirectParamW
  3367. #else
  3368. #define CreateDialogIndirectParam  CreateDialogIndirectParamA
  3369. #endif // !UNICODE
  3370.  
  3371. #define CreateDialogA(hInstance, lpName, hWndParent, lpDialogFunc) \
  3372. CreateDialogParamA(hInstance, lpName, hWndParent, lpDialogFunc, 0L)
  3373. #define CreateDialogW(hInstance, lpName, hWndParent, lpDialogFunc) \
  3374. CreateDialogParamW(hInstance, lpName, hWndParent, lpDialogFunc, 0L)
  3375. #ifdef UNICODE
  3376. #define CreateDialog  CreateDialogW
  3377. #else
  3378. #define CreateDialog  CreateDialogA
  3379. #endif // !UNICODE
  3380.  
  3381. #define CreateDialogIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3382. CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3383. #define CreateDialogIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3384. CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3385. #ifdef UNICODE
  3386. #define CreateDialogIndirect  CreateDialogIndirectW
  3387. #else
  3388. #define CreateDialogIndirect  CreateDialogIndirectA
  3389. #endif // !UNICODE
  3390.  
  3391. WINUSERAPI
  3392. int
  3393. WINAPI
  3394. DialogBoxParamA(
  3395.     HINSTANCE hInstance,
  3396.     LPCSTR lpTemplateName,
  3397.     HWND hWndParent ,
  3398.     DLGPROC lpDialogFunc,
  3399.     LPARAM dwInitParam);
  3400. WINUSERAPI
  3401. int
  3402. WINAPI
  3403. DialogBoxParamW(
  3404.     HINSTANCE hInstance,
  3405.     LPCWSTR lpTemplateName,
  3406.     HWND hWndParent ,
  3407.     DLGPROC lpDialogFunc,
  3408.     LPARAM dwInitParam);
  3409. #ifdef UNICODE
  3410. #define DialogBoxParam  DialogBoxParamW
  3411. #else
  3412. #define DialogBoxParam  DialogBoxParamA
  3413. #endif // !UNICODE
  3414.  
  3415. WINUSERAPI
  3416. int
  3417. WINAPI
  3418. DialogBoxIndirectParamA(
  3419.     HINSTANCE hInstance,
  3420.     LPCDLGTEMPLATEA hDialogTemplate,
  3421.     HWND hWndParent ,
  3422.     DLGPROC lpDialogFunc,
  3423.     LPARAM dwInitParam);
  3424. WINUSERAPI
  3425. int
  3426. WINAPI
  3427. DialogBoxIndirectParamW(
  3428.     HINSTANCE hInstance,
  3429.     LPCDLGTEMPLATEW hDialogTemplate,
  3430.     HWND hWndParent ,
  3431.     DLGPROC lpDialogFunc,
  3432.     LPARAM dwInitParam);
  3433. #ifdef UNICODE
  3434. #define DialogBoxIndirectParam  DialogBoxIndirectParamW
  3435. #else
  3436. #define DialogBoxIndirectParam  DialogBoxIndirectParamA
  3437. #endif // !UNICODE
  3438.  
  3439. #define DialogBoxA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3440. DialogBoxParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3441. #define DialogBoxW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3442. DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3443. #ifdef UNICODE
  3444. #define DialogBox  DialogBoxW
  3445. #else
  3446. #define DialogBox  DialogBoxA
  3447. #endif // !UNICODE
  3448.  
  3449. #define DialogBoxIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3450. DialogBoxIndirectParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3451. #define DialogBoxIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
  3452. DialogBoxIndirectParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
  3453. #ifdef UNICODE
  3454. #define DialogBoxIndirect  DialogBoxIndirectW
  3455. #else
  3456. #define DialogBoxIndirect  DialogBoxIndirectA
  3457. #endif // !UNICODE
  3458.  
  3459. WINUSERAPI
  3460. BOOL
  3461. WINAPI
  3462. EndDialog(
  3463.     HWND hDlg,
  3464.     int nResult);
  3465.  
  3466. WINUSERAPI
  3467. HWND
  3468. WINAPI
  3469. GetDlgItem(
  3470.     HWND hDlg,
  3471.     int nIDDlgItem);
  3472.  
  3473. WINUSERAPI
  3474. BOOL
  3475. WINAPI
  3476. SetDlgItemInt(
  3477.     HWND hDlg,
  3478.     int nIDDlgItem,
  3479.     UINT uValue,
  3480.     BOOL bSigned);
  3481.  
  3482. WINUSERAPI
  3483. UINT
  3484. WINAPI
  3485. GetDlgItemInt(
  3486.     HWND hDlg,
  3487.     int nIDDlgItem,
  3488.     BOOL *lpTranslated,
  3489.     BOOL bSigned);
  3490.  
  3491. WINUSERAPI
  3492. BOOL
  3493. WINAPI
  3494. SetDlgItemTextA(
  3495.     HWND hDlg,
  3496.     int nIDDlgItem,
  3497.     LPCSTR lpString);
  3498. WINUSERAPI
  3499. BOOL
  3500. WINAPI
  3501. SetDlgItemTextW(
  3502.     HWND hDlg,
  3503.     int nIDDlgItem,
  3504.     LPCWSTR lpString);
  3505. #ifdef UNICODE
  3506. #define SetDlgItemText  SetDlgItemTextW
  3507. #else
  3508. #define SetDlgItemText  SetDlgItemTextA
  3509. #endif // !UNICODE
  3510.  
  3511. WINUSERAPI
  3512. UINT
  3513. WINAPI
  3514. GetDlgItemTextA(
  3515.     HWND hDlg,
  3516.     int nIDDlgItem,
  3517.     LPSTR lpString,
  3518.     int nMaxCount);
  3519. WINUSERAPI
  3520. UINT
  3521. WINAPI
  3522. GetDlgItemTextW(
  3523.     HWND hDlg,
  3524.     int nIDDlgItem,
  3525.     LPWSTR lpString,
  3526.     int nMaxCount);
  3527. #ifdef UNICODE
  3528. #define GetDlgItemText  GetDlgItemTextW
  3529. #else
  3530. #define GetDlgItemText  GetDlgItemTextA
  3531. #endif // !UNICODE
  3532.  
  3533. WINUSERAPI
  3534. BOOL
  3535. WINAPI
  3536. CheckDlgButton(
  3537.     HWND hDlg,
  3538.     int nIDButton,
  3539.     UINT uCheck);
  3540.  
  3541. WINUSERAPI
  3542. BOOL
  3543. WINAPI
  3544. CheckRadioButton(
  3545.     HWND hDlg,
  3546.     int nIDFirstButton,
  3547.     int nIDLastButton,
  3548.     int nIDCheckButton);
  3549.  
  3550. WINUSERAPI
  3551. UINT
  3552. WINAPI
  3553. IsDlgButtonChecked(
  3554.     HWND hDlg,
  3555.     int nIDButton);
  3556.  
  3557. WINUSERAPI
  3558. LONG
  3559. WINAPI
  3560. SendDlgItemMessageA(
  3561.     HWND hDlg,
  3562.     int nIDDlgItem,
  3563.     UINT Msg,
  3564.     WPARAM wParam,
  3565.     LPARAM lParam);
  3566. WINUSERAPI
  3567. LONG
  3568. WINAPI
  3569. SendDlgItemMessageW(
  3570.     HWND hDlg,
  3571.     int nIDDlgItem,
  3572.     UINT Msg,
  3573.     WPARAM wParam,
  3574.     LPARAM lParam);
  3575. #ifdef UNICODE
  3576. #define SendDlgItemMessage  SendDlgItemMessageW
  3577. #else
  3578. #define SendDlgItemMessage  SendDlgItemMessageA
  3579. #endif // !UNICODE
  3580.  
  3581. WINUSERAPI
  3582. HWND
  3583. WINAPI
  3584. GetNextDlgGroupItem(
  3585.     HWND hDlg,
  3586.     HWND hCtl,
  3587.     BOOL bPrevious);
  3588.  
  3589. WINUSERAPI
  3590. HWND
  3591. WINAPI
  3592. GetNextDlgTabItem(
  3593.     HWND hDlg,
  3594.     HWND hCtl,
  3595.     BOOL bPrevious);
  3596.  
  3597. WINUSERAPI
  3598. int
  3599. WINAPI
  3600. GetDlgCtrlID(
  3601.     HWND hWnd);
  3602.  
  3603. WINUSERAPI
  3604. long
  3605. WINAPI
  3606. GetDialogBaseUnits(VOID);
  3607.  
  3608. WINUSERAPI
  3609. #ifndef _MAC
  3610. LRESULT
  3611. WINAPI
  3612. #else
  3613. LRESULT
  3614. CALLBACK
  3615. #endif
  3616. DefDlgProcA(
  3617.     HWND hDlg,
  3618.     UINT Msg,
  3619.     WPARAM wParam,
  3620.     LPARAM lParam);
  3621. WINUSERAPI
  3622. #ifndef _MAC
  3623. LRESULT
  3624. WINAPI
  3625. #else
  3626. LRESULT
  3627. CALLBACK
  3628. #endif
  3629. DefDlgProcW(
  3630.     HWND hDlg,
  3631.     UINT Msg,
  3632.     WPARAM wParam,
  3633.     LPARAM lParam);
  3634. #ifdef UNICODE
  3635. #define DefDlgProc  DefDlgProcW
  3636. #else
  3637. #define DefDlgProc  DefDlgProcA
  3638. #endif // !UNICODE
  3639.  
  3640. /*
  3641.  * Window extra byted needed for private dialog classes.
  3642.  */
  3643. #ifndef _MAC
  3644. #define DLGWINDOWEXTRA 30
  3645. #else
  3646. #define DLGWINDOWEXTRA 48
  3647. #endif
  3648.  
  3649. #endif /* !NOCTLMGR */
  3650.  
  3651. #ifndef NOMSG
  3652.  
  3653. WINUSERAPI
  3654. BOOL
  3655. WINAPI
  3656. CallMsgFilterA(
  3657.     LPMSG lpMsg,
  3658.     int nCode);
  3659. WINUSERAPI
  3660. BOOL
  3661. WINAPI
  3662. CallMsgFilterW(
  3663.     LPMSG lpMsg,
  3664.     int nCode);
  3665. #ifdef UNICODE
  3666. #define CallMsgFilter  CallMsgFilterW
  3667. #else
  3668. #define CallMsgFilter  CallMsgFilterA
  3669. #endif // !UNICODE
  3670.  
  3671. #endif /* !NOMSG */
  3672.  
  3673. #ifndef NOCLIPBOARD
  3674.  
  3675. /*
  3676.  * Clipboard Manager Functions
  3677.  */
  3678.  
  3679. WINUSERAPI
  3680. BOOL
  3681. WINAPI
  3682. OpenClipboard(
  3683.     HWND hWndNewOwner);
  3684.  
  3685. WINUSERAPI
  3686. BOOL
  3687. WINAPI
  3688. CloseClipboard(
  3689.     VOID);
  3690.  
  3691.  
  3692. #if(WINVER >= 0x0500)
  3693. WINUSERAPI
  3694. DWORD
  3695. WINAPI
  3696. GetClipboardSequenceNumber(
  3697.     VOID);
  3698. #endif /* WINVER >= 0x0500 */
  3699.  
  3700. WINUSERAPI
  3701. HWND
  3702. WINAPI
  3703. GetClipboardOwner(
  3704.     VOID);
  3705.  
  3706. WINUSERAPI
  3707. HWND
  3708. WINAPI
  3709. SetClipboardViewer(
  3710.     HWND hWndNewViewer);
  3711.  
  3712. WINUSERAPI
  3713. HWND
  3714. WINAPI
  3715. GetClipboardViewer(
  3716.     VOID);
  3717.  
  3718. WINUSERAPI
  3719. BOOL
  3720. WINAPI
  3721. ChangeClipboardChain(
  3722.     HWND hWndRemove,
  3723.     HWND hWndNewNext);
  3724.  
  3725. WINUSERAPI
  3726. HANDLE
  3727. WINAPI
  3728. SetClipboardData(
  3729.     UINT uFormat,
  3730.     HANDLE hMem);
  3731.  
  3732. WINUSERAPI
  3733. HANDLE
  3734. WINAPI
  3735.     GetClipboardData(
  3736.     UINT uFormat);
  3737.  
  3738. WINUSERAPI
  3739. UINT
  3740. WINAPI
  3741. RegisterClipboardFormatA(
  3742.     LPCSTR lpszFormat);
  3743. WINUSERAPI
  3744. UINT
  3745. WINAPI
  3746. RegisterClipboardFormatW(
  3747.     LPCWSTR lpszFormat);
  3748. #ifdef UNICODE
  3749. #define RegisterClipboardFormat  RegisterClipboardFormatW
  3750. #else
  3751. #define RegisterClipboardFormat  RegisterClipboardFormatA
  3752. #endif // !UNICODE
  3753.  
  3754. WINUSERAPI
  3755. int
  3756. WINAPI
  3757. CountClipboardFormats(
  3758.     VOID);
  3759.  
  3760. WINUSERAPI
  3761. UINT
  3762. WINAPI
  3763. EnumClipboardFormats(
  3764.     UINT format);
  3765.  
  3766. WINUSERAPI
  3767. int
  3768. WINAPI
  3769. GetClipboardFormatNameA(
  3770.     UINT format,
  3771.     LPSTR lpszFormatName,
  3772.     int cchMaxCount);
  3773. WINUSERAPI
  3774. int
  3775. WINAPI
  3776. GetClipboardFormatNameW(
  3777.     UINT format,
  3778.     LPWSTR lpszFormatName,
  3779.     int cchMaxCount);
  3780. #ifdef UNICODE
  3781. #define GetClipboardFormatName  GetClipboardFormatNameW
  3782. #else
  3783. #define GetClipboardFormatName  GetClipboardFormatNameA
  3784. #endif // !UNICODE
  3785.  
  3786. WINUSERAPI
  3787. BOOL
  3788. WINAPI
  3789. EmptyClipboard(
  3790.     VOID);
  3791.  
  3792. WINUSERAPI
  3793. BOOL
  3794. WINAPI
  3795. IsClipboardFormatAvailable(
  3796.     UINT format);
  3797.  
  3798. WINUSERAPI
  3799. int
  3800. WINAPI
  3801. GetPriorityClipboardFormat(
  3802.     UINT *paFormatPriorityList,
  3803.     int cFormats);
  3804.  
  3805. WINUSERAPI
  3806. HWND
  3807. WINAPI
  3808. GetOpenClipboardWindow(
  3809.     VOID);
  3810.  
  3811. #endif /* !NOCLIPBOARD */
  3812.  
  3813. /*
  3814.  * Character Translation Routines
  3815.  */
  3816.  
  3817. WINUSERAPI
  3818. BOOL
  3819. WINAPI
  3820. CharToOemA(
  3821.     LPCSTR lpszSrc,
  3822.     LPSTR lpszDst);
  3823. WINUSERAPI
  3824. BOOL
  3825. WINAPI
  3826. CharToOemW(
  3827.     LPCWSTR lpszSrc,
  3828.     LPSTR lpszDst);
  3829. #ifdef UNICODE
  3830. #define CharToOem  CharToOemW
  3831. #else
  3832. #define CharToOem  CharToOemA
  3833. #endif // !UNICODE
  3834.  
  3835. WINUSERAPI
  3836. BOOL
  3837. WINAPI
  3838. OemToCharA(
  3839.     LPCSTR lpszSrc,
  3840.     LPSTR lpszDst);
  3841. WINUSERAPI
  3842. BOOL
  3843. WINAPI
  3844. OemToCharW(
  3845.     LPCSTR lpszSrc,
  3846.     LPWSTR lpszDst);
  3847. #ifdef UNICODE
  3848. #define OemToChar  OemToCharW
  3849. #else
  3850. #define OemToChar  OemToCharA
  3851. #endif // !UNICODE
  3852.  
  3853. WINUSERAPI
  3854. BOOL
  3855. WINAPI
  3856. CharToOemBuffA(
  3857.     LPCSTR lpszSrc,
  3858.     LPSTR lpszDst,
  3859.     DWORD cchDstLength);
  3860. WINUSERAPI
  3861. BOOL
  3862. WINAPI
  3863. CharToOemBuffW(
  3864.     LPCWSTR lpszSrc,
  3865.     LPSTR lpszDst,
  3866.     DWORD cchDstLength);
  3867. #ifdef UNICODE
  3868. #define CharToOemBuff  CharToOemBuffW
  3869. #else
  3870. #define CharToOemBuff  CharToOemBuffA
  3871. #endif // !UNICODE
  3872.  
  3873. WINUSERAPI
  3874. BOOL
  3875. WINAPI
  3876. OemToCharBuffA(
  3877.     LPCSTR lpszSrc,
  3878.     LPSTR lpszDst,
  3879.     DWORD cchDstLength);
  3880. WINUSERAPI
  3881. BOOL
  3882. WINAPI
  3883. OemToCharBuffW(
  3884.     LPCSTR lpszSrc,
  3885.     LPWSTR lpszDst,
  3886.     DWORD cchDstLength);
  3887. #ifdef UNICODE
  3888. #define OemToCharBuff  OemToCharBuffW
  3889. #else
  3890. #define OemToCharBuff  OemToCharBuffA
  3891. #endif // !UNICODE
  3892.  
  3893. WINUSERAPI
  3894. LPSTR
  3895. WINAPI
  3896. CharUpperA(
  3897.     LPSTR lpsz);
  3898. WINUSERAPI
  3899. LPWSTR
  3900. WINAPI
  3901. CharUpperW(
  3902.     LPWSTR lpsz);
  3903. #ifdef UNICODE
  3904. #define CharUpper  CharUpperW
  3905. #else
  3906. #define CharUpper  CharUpperA
  3907. #endif // !UNICODE
  3908.  
  3909. WINUSERAPI
  3910. DWORD
  3911. WINAPI
  3912. CharUpperBuffA(
  3913.     LPSTR lpsz,
  3914.     DWORD cchLength);
  3915. WINUSERAPI
  3916. DWORD
  3917. WINAPI
  3918. CharUpperBuffW(
  3919.     LPWSTR lpsz,
  3920.     DWORD cchLength);
  3921. #ifdef UNICODE
  3922. #define CharUpperBuff  CharUpperBuffW
  3923. #else
  3924. #define CharUpperBuff  CharUpperBuffA
  3925. #endif // !UNICODE
  3926.  
  3927. WINUSERAPI
  3928. LPSTR
  3929. WINAPI
  3930. CharLowerA(
  3931.     LPSTR lpsz);
  3932. WINUSERAPI
  3933. LPWSTR
  3934. WINAPI
  3935. CharLowerW(
  3936.     LPWSTR lpsz);
  3937. #ifdef UNICODE
  3938. #define CharLower  CharLowerW
  3939. #else
  3940. #define CharLower  CharLowerA
  3941. #endif // !UNICODE
  3942.  
  3943. WINUSERAPI
  3944. DWORD
  3945. WINAPI
  3946. CharLowerBuffA(
  3947.     LPSTR lpsz,
  3948.     DWORD cchLength);
  3949. WINUSERAPI
  3950. DWORD
  3951. WINAPI
  3952. CharLowerBuffW(
  3953.     LPWSTR lpsz,
  3954.     DWORD cchLength);
  3955. #ifdef UNICODE
  3956. #define CharLowerBuff  CharLowerBuffW
  3957. #else
  3958. #define CharLowerBuff  CharLowerBuffA
  3959. #endif // !UNICODE
  3960.  
  3961. WINUSERAPI
  3962. LPSTR
  3963. WINAPI
  3964. CharNextA(
  3965.     LPCSTR lpsz);
  3966. WINUSERAPI
  3967. LPWSTR
  3968. WINAPI
  3969. CharNextW(
  3970.     LPCWSTR lpsz);
  3971. #ifdef UNICODE
  3972. #define CharNext  CharNextW
  3973. #else
  3974. #define CharNext  CharNextA
  3975. #endif // !UNICODE
  3976.  
  3977. WINUSERAPI
  3978. LPSTR
  3979. WINAPI
  3980. CharPrevA(
  3981.     LPCSTR lpszStart,
  3982.     LPCSTR lpszCurrent);
  3983. WINUSERAPI
  3984. LPWSTR
  3985. WINAPI
  3986. CharPrevW(
  3987.     LPCWSTR lpszStart,
  3988.     LPCWSTR lpszCurrent);
  3989. #ifdef UNICODE
  3990. #define CharPrev  CharPrevW
  3991. #else
  3992. #define CharPrev  CharPrevA
  3993. #endif // !UNICODE
  3994.  
  3995. #if(WINVER >= 0x0400)
  3996. WINUSERAPI
  3997. LPSTR
  3998. WINAPI
  3999. CharNextExA(
  4000.      WORD CodePage,
  4001.      LPCSTR lpCurrentChar,
  4002.      DWORD dwFlags);
  4003.  
  4004. WINUSERAPI
  4005. LPSTR
  4006. WINAPI
  4007. CharPrevExA(
  4008.      WORD CodePage,
  4009.      LPCSTR lpStart,
  4010.      LPCSTR lpCurrentChar,
  4011.      DWORD dwFlags);
  4012. #endif /* WINVER >= 0x0400 */
  4013.  
  4014. /*
  4015.  * Compatibility defines for character translation routines
  4016.  */
  4017. #define AnsiToOem CharToOemA
  4018. #define OemToAnsi OemToCharA
  4019. #define AnsiToOemBuff CharToOemBuffA
  4020. #define OemToAnsiBuff OemToCharBuffA
  4021. #define AnsiUpper CharUpperA
  4022. #define AnsiUpperBuff CharUpperBuffA
  4023. #define AnsiLower CharLowerA
  4024. #define AnsiLowerBuff CharLowerBuffA
  4025. #define AnsiNext CharNextA
  4026. #define AnsiPrev CharPrevA
  4027.  
  4028. #ifndef  NOLANGUAGE
  4029. /*
  4030.  * Language dependent Routines
  4031.  */
  4032.  
  4033. WINUSERAPI
  4034. BOOL
  4035. WINAPI
  4036. IsCharAlphaA(
  4037.     CHAR ch);
  4038. WINUSERAPI
  4039. BOOL
  4040. WINAPI
  4041. IsCharAlphaW(
  4042.     WCHAR ch);
  4043. #ifdef UNICODE
  4044. #define IsCharAlpha  IsCharAlphaW
  4045. #else
  4046. #define IsCharAlpha  IsCharAlphaA
  4047. #endif // !UNICODE
  4048.  
  4049. WINUSERAPI
  4050. BOOL
  4051. WINAPI
  4052. IsCharAlphaNumericA(
  4053.     CHAR ch);
  4054. WINUSERAPI
  4055. BOOL
  4056. WINAPI
  4057. IsCharAlphaNumericW(
  4058.     WCHAR ch);
  4059. #ifdef UNICODE
  4060. #define IsCharAlphaNumeric  IsCharAlphaNumericW
  4061. #else
  4062. #define IsCharAlphaNumeric  IsCharAlphaNumericA
  4063. #endif // !UNICODE
  4064.  
  4065. WINUSERAPI
  4066. BOOL
  4067. WINAPI
  4068. IsCharUpperA(
  4069.     CHAR ch);
  4070. WINUSERAPI
  4071. BOOL
  4072. WINAPI
  4073. IsCharUpperW(
  4074.     WCHAR ch);
  4075. #ifdef UNICODE
  4076. #define IsCharUpper  IsCharUpperW
  4077. #else
  4078. #define IsCharUpper  IsCharUpperA
  4079. #endif // !UNICODE
  4080.  
  4081. WINUSERAPI
  4082. BOOL
  4083. WINAPI
  4084. IsCharLowerA(
  4085.     CHAR ch);
  4086. WINUSERAPI
  4087. BOOL
  4088. WINAPI
  4089. IsCharLowerW(
  4090.     WCHAR ch);
  4091. #ifdef UNICODE
  4092. #define IsCharLower  IsCharLowerW
  4093. #else
  4094. #define IsCharLower  IsCharLowerA
  4095. #endif // !UNICODE
  4096.  
  4097. #endif  /* !NOLANGUAGE */
  4098.  
  4099. WINUSERAPI
  4100. HWND
  4101. WINAPI
  4102. SetFocus(
  4103.     HWND hWnd);
  4104.  
  4105. WINUSERAPI
  4106. HWND
  4107. WINAPI
  4108. GetActiveWindow(
  4109.     VOID);
  4110.  
  4111. WINUSERAPI
  4112. HWND
  4113. WINAPI
  4114. GetFocus(
  4115.     VOID);
  4116.  
  4117. WINUSERAPI
  4118. UINT
  4119. WINAPI
  4120. GetKBCodePage(
  4121.     VOID);
  4122.  
  4123. WINUSERAPI
  4124. SHORT
  4125. WINAPI
  4126. GetKeyState(
  4127.     int nVirtKey);
  4128.  
  4129. WINUSERAPI
  4130. SHORT
  4131. WINAPI
  4132. GetAsyncKeyState(
  4133.     int vKey);
  4134.  
  4135. WINUSERAPI
  4136. BOOL
  4137. WINAPI
  4138. GetKeyboardState(
  4139.     PBYTE lpKeyState);
  4140.  
  4141. WINUSERAPI
  4142. BOOL
  4143. WINAPI
  4144. SetKeyboardState(
  4145.     LPBYTE lpKeyState);
  4146.  
  4147. WINUSERAPI
  4148. int
  4149. WINAPI
  4150. GetKeyNameTextA(
  4151.     LONG lParam,
  4152.     LPSTR lpString,
  4153.     int nSize
  4154.     );
  4155. WINUSERAPI
  4156. int
  4157. WINAPI
  4158. GetKeyNameTextW(
  4159.     LONG lParam,
  4160.     LPWSTR lpString,
  4161.     int nSize
  4162.     );
  4163. #ifdef UNICODE
  4164. #define GetKeyNameText  GetKeyNameTextW
  4165. #else
  4166. #define GetKeyNameText  GetKeyNameTextA
  4167. #endif // !UNICODE
  4168.  
  4169. WINUSERAPI
  4170. int
  4171. WINAPI
  4172. GetKeyboardType(
  4173.     int nTypeFlag);
  4174.  
  4175. WINUSERAPI
  4176. int
  4177. WINAPI
  4178. ToAscii(
  4179.     UINT uVirtKey,
  4180.     UINT uScanCode,
  4181.     PBYTE lpKeyState,
  4182.     LPWORD lpChar,
  4183.     UINT uFlags);
  4184.  
  4185. #if(WINVER >= 0x0400)
  4186. WINUSERAPI
  4187. int
  4188. WINAPI
  4189. ToAsciiEx(
  4190.     UINT uVirtKey,
  4191.     UINT uScanCode,
  4192.     PBYTE lpKeyState,
  4193.     LPWORD lpChar,
  4194.     UINT uFlags,
  4195.     HKL dwhkl);
  4196. #endif /* WINVER >= 0x0400 */
  4197.  
  4198. WINUSERAPI
  4199. int
  4200. WINAPI
  4201. ToUnicode(
  4202.     UINT wVirtKey,
  4203.     UINT wScanCode,
  4204.     PBYTE lpKeyState,
  4205.     LPWSTR pwszBuff,
  4206.     int cchBuff,
  4207.     UINT wFlags);
  4208.  
  4209. WINUSERAPI
  4210. DWORD
  4211. WINAPI
  4212. OemKeyScan(
  4213.     WORD wOemChar);
  4214.  
  4215. WINUSERAPI
  4216. SHORT
  4217. WINAPI
  4218. VkKeyScanA(
  4219.     CHAR ch);
  4220. WINUSERAPI
  4221. SHORT
  4222. WINAPI
  4223. VkKeyScanW(
  4224.     WCHAR ch);
  4225. #ifdef UNICODE
  4226. #define VkKeyScan  VkKeyScanW
  4227. #else
  4228. #define VkKeyScan  VkKeyScanA
  4229. #endif // !UNICODE
  4230.  
  4231. #if(WINVER >= 0x0400)
  4232. WINUSERAPI
  4233. SHORT
  4234. WINAPI VkKeyScanExA(
  4235.     CHAR  ch,
  4236.     HKL   dwhkl);
  4237. WINUSERAPI
  4238. SHORT
  4239. WINAPI VkKeyScanExW(
  4240.     WCHAR  ch,
  4241.     HKL   dwhkl);
  4242. #ifdef UNICODE
  4243. #define VkKeyScanEx  VkKeyScanExW
  4244. #else
  4245. #define VkKeyScanEx  VkKeyScanExA
  4246. #endif // !UNICODE
  4247. #endif /* WINVER >= 0x0400 */
  4248. #define KEYEVENTF_EXTENDEDKEY 0x0001
  4249. #define KEYEVENTF_KEYUP       0x0002
  4250.  
  4251. WINUSERAPI
  4252. VOID
  4253. WINAPI
  4254. keybd_event(
  4255.     BYTE bVk,
  4256.     BYTE bScan,
  4257.     DWORD dwFlags,
  4258.     DWORD dwExtraInfo);
  4259.  
  4260. #define MOUSEEVENTF_MOVE        0x0001 /* mouse move */
  4261. #define MOUSEEVENTF_LEFTDOWN    0x0002 /* left button down */
  4262. #define MOUSEEVENTF_LEFTUP      0x0004 /* left button up */
  4263. #define MOUSEEVENTF_RIGHTDOWN   0x0008 /* right button down */
  4264. #define MOUSEEVENTF_RIGHTUP     0x0010 /* right button up */
  4265. #define MOUSEEVENTF_MIDDLEDOWN  0x0020 /* middle button down */
  4266. #define MOUSEEVENTF_MIDDLEUP    0x0040 /* middle button up */
  4267. #define MOUSEEVENTF_WHEEL       0x0800 /* wheel button rolled */
  4268. #define MOUSEEVENTF_ABSOLUTE    0x8000 /* absolute move */
  4269.  
  4270. WINUSERAPI
  4271. VOID
  4272. WINAPI
  4273. mouse_event(
  4274.     DWORD dwFlags,
  4275.     DWORD dx,
  4276.     DWORD dy,
  4277.     DWORD dwData,
  4278.     DWORD dwExtraInfo);
  4279.  
  4280. #if (_WIN32_WINNT > 0x0400)
  4281.  
  4282. typedef struct tagMOUSEINPUT {
  4283.     LONG    dx;
  4284.     LONG    dy;
  4285.     DWORD   mouseData;
  4286.     DWORD   dwFlags;
  4287.     DWORD   time;
  4288.     DWORD   dwExtraInfo;
  4289. } MOUSEINPUT, *PMOUSEINPUT, FAR* LPMOUSEINPUT;
  4290.  
  4291. typedef struct tagKEYBDINPUT {
  4292.     WORD    wVk;
  4293.     WORD    wScan;
  4294.     DWORD   dwFlags;
  4295.     DWORD   time;
  4296.     DWORD   dwExtraInfo;
  4297. } KEYBDINPUT, *PKEYBDINPUT, FAR* LPKEYBDINPUT;
  4298.  
  4299. typedef struct tagHARDWAREINPUT {
  4300.     DWORD   uMsg;
  4301.     WORD    wParamL;
  4302.     WORD    wParamH;
  4303. } HARDWAREINPUT, *PHARDWAREINPUT, FAR* LPHARDWAREINPUT;
  4304.  
  4305. #define INPUT_MOUSE     0
  4306. #define INPUT_KEYBOARD  1
  4307. #define INPUT_HARDWARE  2
  4308.  
  4309. typedef struct tagINPUT {
  4310.     DWORD   type;
  4311.  
  4312.     union
  4313.     {
  4314.         MOUSEINPUT      mi;
  4315.         KEYBDINPUT      ki;
  4316.         HARDWAREINPUT   hi;
  4317.     };
  4318. } INPUT, *PINPUT, FAR* LPINPUT;
  4319.  
  4320. WINUSERAPI
  4321. UINT
  4322. WINAPI
  4323. SendInput(
  4324.     UINT    cInputs,     // number of input in the array
  4325.     LPINPUT pInputs,     // array of inputs
  4326.     int     cbSize);     // sizeof(INPUT)
  4327.  
  4328. #endif // (_WIN32_WINNT > 0x0400)
  4329.  
  4330. #if(_WIN32_WINNT >= 0x0500)
  4331. typedef struct tagLASTINPUTINFO {
  4332.     UINT cbSize;
  4333.     DWORD dwTime;
  4334. } LASTINPUTINFO, * PLASTINPUTINFO;
  4335.  
  4336. WINUSERAPI
  4337. BOOL
  4338. WINAPI
  4339. GetLastInputInfo(
  4340.     PLASTINPUTINFO plii);
  4341. #endif /* _WIN32_WINNT >= 0x0500 */
  4342.  
  4343. WINUSERAPI
  4344. UINT
  4345. WINAPI
  4346. MapVirtualKeyA(
  4347.     UINT uCode,
  4348.     UINT uMapType);
  4349. WINUSERAPI
  4350. UINT
  4351. WINAPI
  4352. MapVirtualKeyW(
  4353.     UINT uCode,
  4354.     UINT uMapType);
  4355. #ifdef UNICODE
  4356. #define MapVirtualKey  MapVirtualKeyW
  4357. #else
  4358. #define MapVirtualKey  MapVirtualKeyA
  4359. #endif // !UNICODE
  4360.  
  4361. #if(WINVER >= 0x0400)
  4362. WINUSERAPI
  4363. UINT
  4364. WINAPI
  4365. MapVirtualKeyExA(
  4366.     UINT uCode,
  4367.     UINT uMapType,
  4368.     HKL dwhkl);
  4369. WINUSERAPI
  4370. UINT
  4371. WINAPI
  4372. MapVirtualKeyExW(
  4373.     UINT uCode,
  4374.     UINT uMapType,
  4375.     HKL dwhkl);
  4376. #ifdef UNICODE
  4377. #define MapVirtualKeyEx  MapVirtualKeyExW
  4378. #else
  4379. #define MapVirtualKeyEx  MapVirtualKeyExA
  4380. #endif // !UNICODE
  4381. #endif /* WINVER >= 0x0400 */
  4382.  
  4383. WINUSERAPI
  4384. BOOL
  4385. WINAPI
  4386. GetInputState(
  4387.     VOID);
  4388.  
  4389. WINUSERAPI
  4390. DWORD
  4391. WINAPI
  4392. GetQueueStatus(
  4393.     UINT flags);
  4394.  
  4395. WINUSERAPI
  4396. HWND
  4397. WINAPI
  4398. GetCapture(
  4399.     VOID);
  4400.  
  4401. WINUSERAPI
  4402. HWND
  4403. WINAPI
  4404. SetCapture(
  4405.     HWND hWnd);
  4406.  
  4407. WINUSERAPI
  4408. BOOL
  4409. WINAPI
  4410. ReleaseCapture(
  4411.     VOID);
  4412.  
  4413. WINUSERAPI
  4414. DWORD
  4415. WINAPI
  4416. MsgWaitForMultipleObjects(
  4417.     DWORD nCount,
  4418.     LPHANDLE pHandles,
  4419.     BOOL fWaitAll,
  4420.     DWORD dwMilliseconds,
  4421.     DWORD dwWakeMask);
  4422.  
  4423. WINUSERAPI
  4424. DWORD
  4425. WINAPI
  4426. MsgWaitForMultipleObjectsEx(
  4427.     DWORD nCount,
  4428.     LPHANDLE pHandles,
  4429.     DWORD dwMilliseconds,
  4430.     DWORD dwWakeMask,
  4431.     DWORD dwFlags);
  4432.  
  4433. #define MWMO_WAITALL        0x0001
  4434. #define MWMO_ALERTABLE      0x0002
  4435. #define MWMO_INPUTAVAILABLE 0x0004
  4436.  
  4437. /*
  4438.  * Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects()
  4439.  */
  4440. #define QS_KEY              0x0001
  4441. #define QS_MOUSEMOVE        0x0002
  4442. #define QS_MOUSEBUTTON      0x0004
  4443. #define QS_POSTMESSAGE      0x0008
  4444. #define QS_TIMER            0x0010
  4445. #define QS_PAINT            0x0020
  4446. #define QS_SENDMESSAGE      0x0040
  4447. #define QS_HOTKEY           0x0080
  4448. #define QS_ALLPOSTMESSAGE   0x0100
  4449.  
  4450. #define QS_MOUSE           (QS_MOUSEMOVE     | \
  4451.                             QS_MOUSEBUTTON)
  4452.  
  4453. #define QS_INPUT           (QS_MOUSE         | \
  4454.                             QS_KEY)
  4455.  
  4456. #define QS_ALLEVENTS       (QS_INPUT         | \
  4457.                             QS_POSTMESSAGE   | \
  4458.                             QS_TIMER         | \
  4459.                             QS_PAINT         | \
  4460.                             QS_HOTKEY)
  4461.  
  4462. #define QS_ALLINPUT        (QS_INPUT         | \
  4463.                             QS_POSTMESSAGE   | \
  4464.                             QS_TIMER         | \
  4465.                             QS_PAINT         | \
  4466.                             QS_HOTKEY        | \
  4467.                             QS_SENDMESSAGE)
  4468.  
  4469.  
  4470. /*
  4471.  * Windows Functions
  4472.  */
  4473.  
  4474. WINUSERAPI
  4475. UINT
  4476. WINAPI
  4477. SetTimer(
  4478.     HWND hWnd ,
  4479.     UINT nIDEvent,
  4480.     UINT uElapse,
  4481.     TIMERPROC lpTimerFunc);
  4482.  
  4483. WINUSERAPI
  4484. BOOL
  4485. WINAPI
  4486. KillTimer(
  4487.     HWND hWnd,
  4488.     UINT uIDEvent);
  4489.  
  4490. WINUSERAPI
  4491. BOOL
  4492. WINAPI
  4493. IsWindowUnicode(
  4494.     HWND hWnd);
  4495.  
  4496. WINUSERAPI
  4497. BOOL
  4498. WINAPI
  4499. EnableWindow(
  4500.     HWND hWnd,
  4501.     BOOL bEnable);
  4502.  
  4503. WINUSERAPI
  4504. BOOL
  4505. WINAPI
  4506. IsWindowEnabled(
  4507.     HWND hWnd);
  4508.  
  4509. WINUSERAPI
  4510. HACCEL
  4511. WINAPI
  4512. LoadAcceleratorsA(
  4513.     HINSTANCE hInstance,
  4514.     LPCSTR lpTableName);
  4515. WINUSERAPI
  4516. HACCEL
  4517. WINAPI
  4518. LoadAcceleratorsW(
  4519.     HINSTANCE hInstance,
  4520.     LPCWSTR lpTableName);
  4521. #ifdef UNICODE
  4522. #define LoadAccelerators  LoadAcceleratorsW
  4523. #else
  4524. #define LoadAccelerators  LoadAcceleratorsA
  4525. #endif // !UNICODE
  4526.  
  4527. WINUSERAPI
  4528. HACCEL
  4529. WINAPI
  4530. CreateAcceleratorTableA(
  4531.     LPACCEL, int);
  4532. WINUSERAPI
  4533. HACCEL
  4534. WINAPI
  4535. CreateAcceleratorTableW(
  4536.     LPACCEL, int);
  4537. #ifdef UNICODE
  4538. #define CreateAcceleratorTable  CreateAcceleratorTableW
  4539. #else
  4540. #define CreateAcceleratorTable  CreateAcceleratorTableA
  4541. #endif // !UNICODE
  4542.  
  4543. WINUSERAPI
  4544. BOOL
  4545. WINAPI
  4546. DestroyAcceleratorTable(
  4547.     HACCEL hAccel);
  4548.  
  4549. WINUSERAPI
  4550. int
  4551. WINAPI
  4552. CopyAcceleratorTableA(
  4553.     HACCEL hAccelSrc,
  4554.     LPACCEL lpAccelDst,
  4555.     int cAccelEntries);
  4556. WINUSERAPI
  4557. int
  4558. WINAPI
  4559. CopyAcceleratorTableW(
  4560.     HACCEL hAccelSrc,
  4561.     LPACCEL lpAccelDst,
  4562.     int cAccelEntries);
  4563. #ifdef UNICODE
  4564. #define CopyAcceleratorTable  CopyAcceleratorTableW
  4565. #else
  4566. #define CopyAcceleratorTable  CopyAcceleratorTableA
  4567. #endif // !UNICODE
  4568.  
  4569. #ifndef NOMSG
  4570.  
  4571. WINUSERAPI
  4572. int
  4573. WINAPI
  4574. TranslateAcceleratorA(
  4575.     HWND hWnd,
  4576.     HACCEL hAccTable,
  4577.     LPMSG lpMsg);
  4578. WINUSERAPI
  4579. int
  4580. WINAPI
  4581. TranslateAcceleratorW(
  4582.     HWND hWnd,
  4583.     HACCEL hAccTable,
  4584.     LPMSG lpMsg);
  4585. #ifdef UNICODE
  4586. #define TranslateAccelerator  TranslateAcceleratorW
  4587. #else
  4588. #define TranslateAccelerator  TranslateAcceleratorA
  4589. #endif // !UNICODE
  4590.  
  4591. #endif /* !NOMSG */
  4592.  
  4593. #ifndef NOSYSMETRICS
  4594.  
  4595. /*
  4596.  * GetSystemMetrics() codes
  4597.  */
  4598.  
  4599. #define SM_CXSCREEN             0
  4600. #define SM_CYSCREEN             1
  4601. #define SM_CXVSCROLL            2
  4602. #define SM_CYHSCROLL            3
  4603. #define SM_CYCAPTION            4
  4604. #define SM_CXBORDER             5
  4605. #define SM_CYBORDER             6
  4606. #define SM_CXDLGFRAME           7
  4607. #define SM_CYDLGFRAME           8
  4608. #define SM_CYVTHUMB             9
  4609. #define SM_CXHTHUMB             10
  4610. #define SM_CXICON               11
  4611. #define SM_CYICON               12
  4612. #define SM_CXCURSOR             13
  4613. #define SM_CYCURSOR             14
  4614. #define SM_CYMENU               15
  4615. #define SM_CXFULLSCREEN         16
  4616. #define SM_CYFULLSCREEN         17
  4617. #define SM_CYKANJIWINDOW        18
  4618. #define SM_MOUSEPRESENT         19
  4619. #define SM_CYVSCROLL            20
  4620. #define SM_CXHSCROLL            21
  4621. #define SM_DEBUG                22
  4622. #define SM_SWAPBUTTON           23
  4623. #define SM_RESERVED1            24
  4624. #define SM_RESERVED2            25
  4625. #define SM_RESERVED3            26
  4626. #define SM_RESERVED4            27
  4627. #define SM_CXMIN                28
  4628. #define SM_CYMIN                29
  4629. #define SM_CXSIZE               30
  4630. #define SM_CYSIZE               31
  4631. #define SM_CXFRAME              32
  4632. #define SM_CYFRAME              33
  4633. #define SM_CXMINTRACK           34
  4634. #define SM_CYMINTRACK           35
  4635. #define SM_CXDOUBLECLK          36
  4636. #define SM_CYDOUBLECLK          37
  4637. #define SM_CXICONSPACING        38
  4638. #define SM_CYICONSPACING        39
  4639. #define SM_MENUDROPALIGNMENT    40
  4640. #define SM_PENWINDOWS           41
  4641. #define SM_DBCSENABLED          42
  4642. #define SM_CMOUSEBUTTONS        43
  4643.  
  4644. #if(WINVER >= 0x0400)
  4645. #define SM_CXFIXEDFRAME           SM_CXDLGFRAME  /* ;win40 name change */
  4646. #define SM_CYFIXEDFRAME           SM_CYDLGFRAME  /* ;win40 name change */
  4647. #define SM_CXSIZEFRAME            SM_CXFRAME     /* ;win40 name change */
  4648. #define SM_CYSIZEFRAME            SM_CYFRAME     /* ;win40 name change */
  4649.  
  4650. #define SM_SECURE               44
  4651. #define SM_CXEDGE               45
  4652. #define SM_CYEDGE               46
  4653. #define SM_CXMINSPACING         47
  4654. #define SM_CYMINSPACING         48
  4655. #define SM_CXSMICON             49
  4656. #define SM_CYSMICON             50
  4657. #define SM_CYSMCAPTION          51
  4658. #define SM_CXSMSIZE             52
  4659. #define SM_CYSMSIZE             53
  4660. #define SM_CXMENUSIZE           54
  4661. #define SM_CYMENUSIZE           55
  4662. #define SM_ARRANGE              56
  4663. #define SM_CXMINIMIZED          57
  4664. #define SM_CYMINIMIZED          58
  4665. #define SM_CXMAXTRACK           59
  4666. #define SM_CYMAXTRACK           60
  4667. #define SM_CXMAXIMIZED          61
  4668. #define SM_CYMAXIMIZED          62
  4669. #define SM_NETWORK              63
  4670. #define SM_CLEANBOOT            67
  4671. #define SM_CXDRAG               68
  4672. #define SM_CYDRAG               69
  4673. #endif /* WINVER >= 0x0400 */
  4674. #define SM_SHOWSOUNDS           70
  4675. #if(WINVER >= 0x0400)
  4676. #define SM_CXMENUCHECK          71   /* Use instead of GetMenuCheckMarkDimensions()! */
  4677. #define SM_CYMENUCHECK          72
  4678. #define SM_SLOWMACHINE          73
  4679. #define SM_MIDEASTENABLED       74
  4680. #endif /* WINVER >= 0x0400 */
  4681. #if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
  4682. #define SM_MOUSEWHEELPRESENT    75
  4683. #endif
  4684. #if(WINVER >= 0x0500)
  4685. #define SM_XVIRTUALSCREEN       76
  4686. #define SM_YVIRTUALSCREEN       77
  4687. #define SM_CXVIRTUALSCREEN      78
  4688. #define SM_CYVIRTUALSCREEN      79
  4689. #define SM_CMONITORS            80
  4690. #define SM_SAMEDISPLAYFORMAT    81
  4691. #endif /* WINVER >= 0x0500 */
  4692.  
  4693. #if (WINVER < 0x0500) && (!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0400))
  4694. #define SM_CMETRICS             76
  4695. #else
  4696. #define SM_CMETRICS             83
  4697. #endif
  4698.  
  4699. WINUSERAPI
  4700. int
  4701. WINAPI
  4702. GetSystemMetrics(
  4703.     int nIndex);
  4704.  
  4705. #endif /* !NOSYSMETRICS */
  4706.  
  4707. #ifndef NOMENUS
  4708.  
  4709. WINUSERAPI
  4710. HMENU
  4711. WINAPI
  4712. LoadMenuA(
  4713.     HINSTANCE hInstance,
  4714.     LPCSTR lpMenuName);
  4715. WINUSERAPI
  4716. HMENU
  4717. WINAPI
  4718. LoadMenuW(
  4719.     HINSTANCE hInstance,
  4720.     LPCWSTR lpMenuName);
  4721. #ifdef UNICODE
  4722. #define LoadMenu  LoadMenuW
  4723. #else
  4724. #define LoadMenu  LoadMenuA
  4725. #endif // !UNICODE
  4726.  
  4727. WINUSERAPI
  4728. HMENU
  4729. WINAPI
  4730. LoadMenuIndirectA(
  4731.     CONST MENUTEMPLATEA *lpMenuTemplate);
  4732. WINUSERAPI
  4733. HMENU
  4734. WINAPI
  4735. LoadMenuIndirectW(
  4736.     CONST MENUTEMPLATEW *lpMenuTemplate);
  4737. #ifdef UNICODE
  4738. #define LoadMenuIndirect  LoadMenuIndirectW
  4739. #else
  4740. #define LoadMenuIndirect  LoadMenuIndirectA
  4741. #endif // !UNICODE
  4742.  
  4743. WINUSERAPI
  4744. HMENU
  4745. WINAPI
  4746. GetMenu(
  4747.     HWND hWnd);
  4748.  
  4749. WINUSERAPI
  4750. BOOL
  4751. WINAPI
  4752. SetMenu(
  4753.     HWND hWnd,
  4754.     HMENU hMenu);
  4755.  
  4756. WINUSERAPI
  4757. BOOL
  4758. WINAPI
  4759. ChangeMenuA(
  4760.     HMENU hMenu,
  4761.     UINT cmd,
  4762.     LPCSTR lpszNewItem,
  4763.     UINT cmdInsert,
  4764.     UINT flags);
  4765. WINUSERAPI
  4766. BOOL
  4767. WINAPI
  4768. ChangeMenuW(
  4769.     HMENU hMenu,
  4770.     UINT cmd,
  4771.     LPCWSTR lpszNewItem,
  4772.     UINT cmdInsert,
  4773.     UINT flags);
  4774. #ifdef UNICODE
  4775. #define ChangeMenu  ChangeMenuW
  4776. #else
  4777. #define ChangeMenu  ChangeMenuA
  4778. #endif // !UNICODE
  4779.  
  4780. WINUSERAPI
  4781. BOOL
  4782. WINAPI
  4783. HiliteMenuItem(
  4784.     HWND hWnd,
  4785.     HMENU hMenu,
  4786.     UINT uIDHiliteItem,
  4787.     UINT uHilite);
  4788.  
  4789. WINUSERAPI
  4790. int
  4791. WINAPI
  4792. GetMenuStringA(
  4793.     HMENU hMenu,
  4794.     UINT uIDItem,
  4795.     LPSTR lpString,
  4796.     int nMaxCount,
  4797.     UINT uFlag);
  4798. WINUSERAPI
  4799. int
  4800. WINAPI
  4801. GetMenuStringW(
  4802.     HMENU hMenu,
  4803.     UINT uIDItem,
  4804.     LPWSTR lpString,
  4805.     int nMaxCount,
  4806.     UINT uFlag);
  4807. #ifdef UNICODE
  4808. #define GetMenuString  GetMenuStringW
  4809. #else
  4810. #define GetMenuString  GetMenuStringA
  4811. #endif // !UNICODE
  4812.  
  4813. WINUSERAPI
  4814. UINT
  4815. WINAPI
  4816. GetMenuState(
  4817.     HMENU hMenu,
  4818.     UINT uId,
  4819.     UINT uFlags);
  4820.  
  4821. WINUSERAPI
  4822. BOOL
  4823. WINAPI
  4824. DrawMenuBar(
  4825.     HWND hWnd);
  4826.  
  4827.  
  4828. WINUSERAPI
  4829. HMENU
  4830. WINAPI
  4831. GetSystemMenu(
  4832.     HWND hWnd,
  4833.     BOOL bRevert);
  4834.  
  4835.  
  4836. WINUSERAPI
  4837. HMENU
  4838. WINAPI
  4839. CreateMenu(
  4840.     VOID);
  4841.  
  4842. WINUSERAPI
  4843. HMENU
  4844. WINAPI
  4845. CreatePopupMenu(
  4846.     VOID);
  4847.  
  4848. WINUSERAPI
  4849. BOOL
  4850. WINAPI
  4851. DestroyMenu(
  4852.     HMENU hMenu);
  4853.  
  4854. WINUSERAPI
  4855. DWORD
  4856. WINAPI
  4857. CheckMenuItem(
  4858.     HMENU hMenu,
  4859.     UINT uIDCheckItem,
  4860.     UINT uCheck);
  4861.  
  4862. WINUSERAPI
  4863. BOOL
  4864. WINAPI
  4865. EnableMenuItem(
  4866.     HMENU hMenu,
  4867.     UINT uIDEnableItem,
  4868.     UINT uEnable);
  4869.  
  4870. WINUSERAPI
  4871. HMENU
  4872. WINAPI
  4873. GetSubMenu(
  4874.     HMENU hMenu,
  4875.     int nPos);
  4876.  
  4877. WINUSERAPI
  4878. UINT
  4879. WINAPI
  4880. GetMenuItemID(
  4881.     HMENU hMenu,
  4882.     int nPos);
  4883.  
  4884. WINUSERAPI
  4885. int
  4886. WINAPI
  4887. GetMenuItemCount(
  4888.     HMENU hMenu);
  4889.  
  4890. WINUSERAPI
  4891. BOOL
  4892. WINAPI
  4893. InsertMenuA(
  4894.     HMENU hMenu,
  4895.     UINT uPosition,
  4896.     UINT uFlags,
  4897.     UINT uIDNewItem,
  4898.     LPCSTR lpNewItem
  4899.     );
  4900. WINUSERAPI
  4901. BOOL
  4902. WINAPI
  4903. InsertMenuW(
  4904.     HMENU hMenu,
  4905.     UINT uPosition,
  4906.     UINT uFlags,
  4907.     UINT uIDNewItem,
  4908.     LPCWSTR lpNewItem
  4909.     );
  4910. #ifdef UNICODE
  4911. #define InsertMenu  InsertMenuW
  4912. #else
  4913. #define InsertMenu  InsertMenuA
  4914. #endif // !UNICODE
  4915.  
  4916. WINUSERAPI
  4917. BOOL
  4918. WINAPI
  4919. AppendMenuA(
  4920.     HMENU hMenu,
  4921.     UINT uFlags,
  4922.     UINT uIDNewItem,
  4923.     LPCSTR lpNewItem
  4924.     );
  4925. WINUSERAPI
  4926. BOOL
  4927. WINAPI
  4928. AppendMenuW(
  4929.     HMENU hMenu,
  4930.     UINT uFlags,
  4931.     UINT uIDNewItem,
  4932.     LPCWSTR lpNewItem
  4933.     );
  4934. #ifdef UNICODE
  4935. #define AppendMenu  AppendMenuW
  4936. #else
  4937. #define AppendMenu  AppendMenuA
  4938. #endif // !UNICODE
  4939.  
  4940. WINUSERAPI
  4941. BOOL
  4942. WINAPI
  4943. ModifyMenuA(
  4944.     HMENU hMnu,
  4945.     UINT uPosition,
  4946.     UINT uFlags,
  4947.     UINT uIDNewItem,
  4948.     LPCSTR lpNewItem
  4949.     );
  4950. WINUSERAPI
  4951. BOOL
  4952. WINAPI
  4953. ModifyMenuW(
  4954.     HMENU hMnu,
  4955.     UINT uPosition,
  4956.     UINT uFlags,
  4957.     UINT uIDNewItem,
  4958.     LPCWSTR lpNewItem
  4959.     );
  4960. #ifdef UNICODE
  4961. #define ModifyMenu  ModifyMenuW
  4962. #else
  4963. #define ModifyMenu  ModifyMenuA
  4964. #endif // !UNICODE
  4965.  
  4966. WINUSERAPI
  4967. BOOL
  4968. WINAPI RemoveMenu(
  4969.     HMENU hMenu,
  4970.     UINT uPosition,
  4971.     UINT uFlags);
  4972.  
  4973. WINUSERAPI
  4974. BOOL
  4975. WINAPI
  4976. DeleteMenu(
  4977.     HMENU hMenu,
  4978.     UINT uPosition,
  4979.     UINT uFlags);
  4980.  
  4981. WINUSERAPI
  4982. BOOL
  4983. WINAPI
  4984. SetMenuItemBitmaps(
  4985.     HMENU hMenu,
  4986.     UINT uPosition,
  4987.     UINT uFlags,
  4988.     HBITMAP hBitmapUnchecked,
  4989.     HBITMAP hBitmapChecked);
  4990.  
  4991. WINUSERAPI
  4992. LONG
  4993. WINAPI
  4994. GetMenuCheckMarkDimensions(
  4995.     VOID);
  4996.  
  4997. WINUSERAPI
  4998. BOOL
  4999. WINAPI
  5000. TrackPopupMenu(
  5001.     HMENU hMenu,
  5002.     UINT uFlags,
  5003.     int x,
  5004.     int y,
  5005.     int nReserved,
  5006.     HWND hWnd,
  5007.     CONST RECT *prcRect);
  5008.  
  5009. #if(WINVER >= 0x0400)
  5010. /* return codes for WM_MENUCHAR */
  5011. #define MNC_IGNORE  0
  5012. #define MNC_CLOSE   1
  5013. #define MNC_EXECUTE 2
  5014. #define MNC_SELECT  3
  5015.  
  5016. typedef struct tagTPMPARAMS
  5017. {
  5018.     UINT    cbSize;     /* Size of structure */
  5019.     RECT    rcExclude;  /* Screen coordinates of rectangle to exclude when positioning */
  5020. }   TPMPARAMS;
  5021. typedef TPMPARAMS FAR *LPTPMPARAMS;
  5022.  
  5023. WINUSERAPI BOOL    WINAPI TrackPopupMenuEx(HMENU, UINT, int, int, HWND, LPTPMPARAMS);
  5024. #endif /* WINVER >= 0x0400 */
  5025.  
  5026. #if(WINVER >= 0x0500)
  5027. #define MNS_NOCHECK         0x80000000
  5028. #define MNS_MODELESS        0x40000000
  5029. #define MNS_DRAGDROP        0x20000000
  5030. #define MNS_AUTODISMISS     0x10000000
  5031. #define MNS_NOTIFYBYPOS     0x08000000
  5032. #define MNS_CHECKORBMP      0x04000000
  5033.  
  5034. #define MIM_MAXHEIGHT               0x00000001
  5035. #define MIM_BACKGROUND              0x00000002
  5036. #define MIM_HELPID                  0x00000004
  5037. #define MIM_MENUDATA                0x00000008
  5038. #define MIM_STYLE                   0x00000010
  5039. #define MIM_APPLYTOSUBMENUS         0x80000000
  5040.  
  5041. typedef struct tagMENUINFO
  5042. {
  5043.     DWORD   cbSize;
  5044.     DWORD   fMask;
  5045.     DWORD   dwStyle;
  5046.     UINT    cyMax;
  5047.     HBRUSH  hbrBack;
  5048.     DWORD   dwContextHelpID;
  5049.     DWORD   dwMenuData;
  5050. }   MENUINFO, FAR *LPMENUINFO;
  5051. typedef MENUINFO CONST FAR *LPCMENUINFO;
  5052.  
  5053. WINUSERAPI
  5054. BOOL
  5055. WINAPI
  5056. GetMenuInfo(
  5057.              HMENU,
  5058.              LPMENUINFO);
  5059.  
  5060. WINUSERAPI
  5061. BOOL
  5062. WINAPI
  5063. SetMenuInfo(
  5064.              HMENU,
  5065.              LPCMENUINFO);
  5066.  
  5067. WINUSERAPI
  5068. BOOL
  5069. WINAPI
  5070. EndMenu(
  5071.         VOID);
  5072.  
  5073. /*
  5074.  * WM_MENUDRAG return values.
  5075.  */
  5076. #define MND_CONTINUE       0
  5077. #define MND_ENDMENU        1
  5078.  
  5079. typedef struct tagMENUGETOBJECTINFO
  5080. {
  5081.     DWORD dwFlags;
  5082.     UINT uPos;
  5083.     HMENU hmenu;
  5084.     PVOID riid;
  5085.     PVOID pvObj;
  5086. } MENUGETOBJECTINFO, * PMENUGETOBJECTINFO;
  5087.  
  5088. /*
  5089.  * MENUGETOBJECTINFO dwFlags values
  5090.  */
  5091. #define MNGOF_GAP            0x00000003
  5092.  
  5093. /*
  5094.  * WM_MENUGETOBJECT return values
  5095.  */
  5096. #define MNGO_NOINTERFACE     0x00000000
  5097. #define MNGO_NOERROR         0x00000001
  5098. #endif /* WINVER >= 0x0500 */
  5099.  
  5100. #if(WINVER >= 0x0400)
  5101. #define MIIM_STATE       0x00000001
  5102. #define MIIM_ID          0x00000002
  5103. #define MIIM_SUBMENU     0x00000004
  5104. #define MIIM_CHECKMARKS  0x00000008
  5105. #define MIIM_TYPE        0x00000010
  5106. #define MIIM_DATA        0x00000020
  5107. #endif /* WINVER >= 0x0400 */
  5108.  
  5109. #if(WINVER >= 0x0500)
  5110. #define MIIM_STRING      0x00000040
  5111. #define MIIM_BITMAP      0x00000080
  5112. #define MIIM_FTYPE       0x00000100
  5113.  
  5114. #define HBMMENU_CALLBACK            ((HBITMAP) -1)
  5115. #define HBMMENU_SYSTEM              ((HBITMAP)  1)
  5116. #define HBMMENU_MBAR_RESTORE        ((HBITMAP)  2)
  5117. #define HBMMENU_MBAR_MINIMIZE       ((HBITMAP)  3)
  5118. #define HBMMENU_MBAR_CLOSE          ((HBITMAP)  5)
  5119. #define HBMMENU_MBAR_CLOSE_D        ((HBITMAP)  6)
  5120. #define HBMMENU_MBAR_MINIMIZE_D     ((HBITMAP)  7)
  5121. #define HBMMENU_POPUP_CLOSE         ((HBITMAP)  8)
  5122. #define HBMMENU_POPUP_RESTORE       ((HBITMAP)  9)
  5123. #define HBMMENU_POPUP_MAXIMIZE      ((HBITMAP) 10)
  5124. #define HBMMENU_POPUP_MINIMIZE      ((HBITMAP) 11)
  5125. #endif /* WINVER >= 0x0500 */
  5126.  
  5127. #if(WINVER >= 0x0400)
  5128. typedef struct tagMENUITEMINFOA
  5129. {
  5130.     UINT    cbSize;
  5131.     UINT    fMask;
  5132.     UINT    fType;          // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
  5133.     UINT    fState;         // used if MIIM_STATE
  5134.     UINT    wID;            // used if MIIM_ID
  5135.     HMENU   hSubMenu;       // used if MIIM_SUBMENU
  5136.     HBITMAP hbmpChecked;    // used if MIIM_CHECKMARKS
  5137.     HBITMAP hbmpUnchecked;  // used if MIIM_CHECKMARKS
  5138.     DWORD   dwItemData;     // used if MIIM_DATA
  5139.     LPSTR   dwTypeData;     // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5140.     UINT    cch;            // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5141. #if (_WIN32_WINNT >= 0x0500)
  5142.     HBITMAP hbmpItem;       // used if MIIM_BITMAP
  5143. #endif
  5144. }   MENUITEMINFOA, FAR *LPMENUITEMINFOA;
  5145. typedef struct tagMENUITEMINFOW
  5146. {
  5147.     UINT    cbSize;
  5148.     UINT    fMask;
  5149.     UINT    fType;          // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
  5150.     UINT    fState;         // used if MIIM_STATE
  5151.     UINT    wID;            // used if MIIM_ID
  5152.     HMENU   hSubMenu;       // used if MIIM_SUBMENU
  5153.     HBITMAP hbmpChecked;    // used if MIIM_CHECKMARKS
  5154.     HBITMAP hbmpUnchecked;  // used if MIIM_CHECKMARKS
  5155.     DWORD   dwItemData;     // used if MIIM_DATA
  5156.     LPWSTR  dwTypeData;     // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5157.     UINT    cch;            // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  5158. #if (_WIN32_WINNT >= 0x0500)
  5159.     HBITMAP hbmpItem;       // used if MIIM_BITMAP
  5160. #endif
  5161. }   MENUITEMINFOW, FAR *LPMENUITEMINFOW;
  5162. #ifdef UNICODE
  5163. typedef MENUITEMINFOW MENUITEMINFO;
  5164. typedef LPMENUITEMINFOW LPMENUITEMINFO;
  5165. #else
  5166. typedef MENUITEMINFOA MENUITEMINFO;
  5167. typedef LPMENUITEMINFOA LPMENUITEMINFO;
  5168. #endif // UNICODE
  5169. typedef MENUITEMINFOA CONST FAR *LPCMENUITEMINFOA;
  5170. typedef MENUITEMINFOW CONST FAR *LPCMENUITEMINFOW;
  5171. #ifdef UNICODE
  5172. typedef LPCMENUITEMINFOW LPCMENUITEMINFO;
  5173. #else
  5174. typedef LPCMENUITEMINFOA LPCMENUITEMINFO;
  5175. #endif // UNICODE
  5176.  
  5177. WINUSERAPI
  5178. BOOL
  5179. WINAPI
  5180. InsertMenuItemA(
  5181.     HMENU,
  5182.     UINT,
  5183.     BOOL,
  5184.     LPCMENUITEMINFOA
  5185.     );
  5186. WINUSERAPI
  5187. BOOL
  5188. WINAPI
  5189. InsertMenuItemW(
  5190.     HMENU,
  5191.     UINT,
  5192.     BOOL,
  5193.     LPCMENUITEMINFOW
  5194.     );
  5195. #ifdef UNICODE
  5196. #define InsertMenuItem  InsertMenuItemW
  5197. #else
  5198. #define InsertMenuItem  InsertMenuItemA
  5199. #endif // !UNICODE
  5200.  
  5201. WINUSERAPI
  5202. BOOL
  5203. WINAPI
  5204. GetMenuItemInfoA(
  5205.     HMENU,
  5206.     UINT,
  5207.     BOOL,
  5208.     LPMENUITEMINFOA
  5209.     );
  5210. WINUSERAPI
  5211. BOOL
  5212. WINAPI
  5213. GetMenuItemInfoW(
  5214.     HMENU,
  5215.     UINT,
  5216.     BOOL,
  5217.     LPMENUITEMINFOW
  5218.     );
  5219. #ifdef UNICODE
  5220. #define GetMenuItemInfo  GetMenuItemInfoW
  5221. #else
  5222. #define GetMenuItemInfo  GetMenuItemInfoA
  5223. #endif // !UNICODE
  5224.  
  5225. WINUSERAPI
  5226. BOOL
  5227. WINAPI
  5228. SetMenuItemInfoA(
  5229.     HMENU,
  5230.     UINT,
  5231.     BOOL,
  5232.     LPCMENUITEMINFOA
  5233.     );
  5234. WINUSERAPI
  5235. BOOL
  5236. WINAPI
  5237. SetMenuItemInfoW(
  5238.     HMENU,
  5239.     UINT,
  5240.     BOOL,
  5241.     LPCMENUITEMINFOW
  5242.     );
  5243. #ifdef UNICODE
  5244. #define SetMenuItemInfo  SetMenuItemInfoW
  5245. #else
  5246. #define SetMenuItemInfo  SetMenuItemInfoA
  5247. #endif // !UNICODE
  5248.  
  5249.  
  5250. #define GMDI_USEDISABLED    0x0001L
  5251. #define GMDI_GOINTOPOPUPS   0x0002L
  5252.  
  5253. WINUSERAPI UINT    WINAPI GetMenuDefaultItem(HMENU hMenu, UINT fByPos, UINT gmdiFlags);
  5254. WINUSERAPI BOOL    WINAPI SetMenuDefaultItem(HMENU hMenu, UINT uItem, UINT fByPos);
  5255.  
  5256. WINUSERAPI BOOL    WINAPI GetMenuItemRect(HWND hWnd, HMENU hMenu, UINT uItem, LPRECT lprcItem);
  5257. WINUSERAPI int     WINAPI MenuItemFromPoint(HWND hWnd, HMENU hMenu, POINT ptScreen);
  5258. #endif /* WINVER >= 0x0400 */
  5259.  
  5260. /*
  5261.  * Flags for TrackPopupMenu
  5262.  */
  5263. #define TPM_LEFTBUTTON  0x0000L
  5264. #define TPM_RIGHTBUTTON 0x0002L
  5265. #define TPM_LEFTALIGN   0x0000L
  5266. #define TPM_CENTERALIGN 0x0004L
  5267. #define TPM_RIGHTALIGN  0x0008L
  5268. #if(WINVER >= 0x0400)
  5269. #define TPM_TOPALIGN        0x0000L
  5270. #define TPM_VCENTERALIGN    0x0010L
  5271. #define TPM_BOTTOMALIGN     0x0020L
  5272.  
  5273. #define TPM_HORIZONTAL      0x0000L     /* Horz alignment matters more */
  5274. #define TPM_VERTICAL        0x0040L     /* Vert alignment matters more */
  5275. #define TPM_NONOTIFY        0x0080L     /* Don't send any notification msgs */
  5276. #define TPM_RETURNCMD       0x0100L
  5277. #endif /* WINVER >= 0x0400 */
  5278. #if(WINVER >= 0x0500)
  5279. #define TPM_RECURSE         0x0001L
  5280. #endif /* WINVER >= 0x0500 */
  5281.  
  5282.  
  5283. #endif /* !NOMENUS */
  5284.  
  5285.  
  5286. #if(WINVER >= 0x0400)
  5287. //
  5288. // Drag-and-drop support
  5289. //
  5290.  
  5291. typedef struct tagDROPSTRUCT
  5292. {
  5293.     HWND    hwndSource;
  5294.     HWND    hwndSink;
  5295.     DWORD   wFmt;
  5296.     DWORD   dwData;
  5297.     POINT   ptDrop;
  5298.     DWORD   dwControlData;
  5299. } DROPSTRUCT, *PDROPSTRUCT, *LPDROPSTRUCT;
  5300.  
  5301. #define DOF_EXECUTABLE      0x8001      // wFmt flags
  5302. #define DOF_DOCUMENT        0x8002
  5303. #define DOF_DIRECTORY       0x8003
  5304. #define DOF_MULTIPLE        0x8004
  5305. #define DOF_PROGMAN         0x0001
  5306. #define DOF_SHELLDATA       0x0002
  5307.  
  5308. #define DO_DROPFILE         0x454C4946L
  5309. #define DO_PRINTFILE        0x544E5250L
  5310.  
  5311. WINUSERAPI
  5312. DWORD
  5313. WINAPI
  5314. DragObject(HWND, HWND, UINT, DWORD, HCURSOR);
  5315.  
  5316. WINUSERAPI
  5317. BOOL
  5318. WINAPI
  5319. DragDetect(HWND, POINT);
  5320. #endif /* WINVER >= 0x0400 */
  5321.  
  5322. WINUSERAPI
  5323. BOOL
  5324. WINAPI
  5325. DrawIcon(
  5326.     HDC hDC,
  5327.     int X,
  5328.     int Y,
  5329.     HICON hIcon);
  5330.  
  5331. #ifndef NODRAWTEXT
  5332.  
  5333. /*
  5334.  * DrawText() Format Flags
  5335.  */
  5336. #define DT_TOP              0x00000000
  5337. #define DT_LEFT             0x00000000
  5338. #define DT_CENTER           0x00000001
  5339. #define DT_RIGHT            0x00000002
  5340. #define DT_VCENTER          0x00000004
  5341. #define DT_BOTTOM           0x00000008
  5342. #define DT_WORDBREAK        0x00000010
  5343. #define DT_SINGLELINE       0x00000020
  5344. #define DT_EXPANDTABS       0x00000040
  5345. #define DT_TABSTOP          0x00000080
  5346. #define DT_NOCLIP           0x00000100
  5347. #define DT_EXTERNALLEADING  0x00000200
  5348. #define DT_CALCRECT         0x00000400
  5349. #define DT_NOPREFIX         0x00000800
  5350. #define DT_INTERNAL         0x00001000
  5351.  
  5352. #if(WINVER >= 0x0400)
  5353. #define DT_EDITCONTROL      0x00002000
  5354. #define DT_PATH_ELLIPSIS    0x00004000
  5355. #define DT_END_ELLIPSIS     0x00008000
  5356. #define DT_MODIFYSTRING     0x00010000
  5357. #define DT_RTLREADING       0x00020000
  5358. #define DT_WORD_ELLIPSIS    0x00040000
  5359.  
  5360.  
  5361. typedef struct tagDRAWTEXTPARAMS
  5362. {
  5363.     UINT    cbSize;
  5364.     int     iTabLength;
  5365.     int     iLeftMargin;
  5366.     int     iRightMargin;
  5367.     UINT    uiLengthDrawn;
  5368. } DRAWTEXTPARAMS, FAR *LPDRAWTEXTPARAMS;
  5369. #endif /* WINVER >= 0x0400 */
  5370.  
  5371.  
  5372. WINUSERAPI
  5373. int
  5374. WINAPI
  5375. DrawTextA(
  5376.     HDC hDC,
  5377.     LPCSTR lpString,
  5378.     int nCount,
  5379.     LPRECT lpRect,
  5380.     UINT uFormat);
  5381. WINUSERAPI
  5382. int
  5383. WINAPI
  5384. DrawTextW(
  5385.     HDC hDC,
  5386.     LPCWSTR lpString,
  5387.     int nCount,
  5388.     LPRECT lpRect,
  5389.     UINT uFormat);
  5390. #ifdef UNICODE
  5391. #define DrawText  DrawTextW
  5392. #else
  5393. #define DrawText  DrawTextA
  5394. #endif // !UNICODE
  5395.  
  5396.  
  5397. #if(WINVER >= 0x0400)
  5398. WINUSERAPI
  5399. int
  5400. WINAPI
  5401. DrawTextExA(HDC, LPSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS);
  5402. WINUSERAPI
  5403. int
  5404. WINAPI
  5405. DrawTextExW(HDC, LPWSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS);
  5406. #ifdef UNICODE
  5407. #define DrawTextEx  DrawTextExW
  5408. #else
  5409. #define DrawTextEx  DrawTextExA
  5410. #endif // !UNICODE
  5411. #endif /* WINVER >= 0x0400 */
  5412.  
  5413. #endif /* !NODRAWTEXT */
  5414.  
  5415. WINUSERAPI
  5416. BOOL
  5417. WINAPI
  5418. GrayStringA(
  5419.     HDC hDC,
  5420.     HBRUSH hBrush,
  5421.     GRAYSTRINGPROC lpOutputFunc,
  5422.     LPARAM lpData,
  5423.     int nCount,
  5424.     int X,
  5425.     int Y,
  5426.     int nWidth,
  5427.     int nHeight);
  5428. WINUSERAPI
  5429. BOOL
  5430. WINAPI
  5431. GrayStringW(
  5432.     HDC hDC,
  5433.     HBRUSH hBrush,
  5434.     GRAYSTRINGPROC lpOutputFunc,
  5435.     LPARAM lpData,
  5436.     int nCount,
  5437.     int X,
  5438.     int Y,
  5439.     int nWidth,
  5440.     int nHeight);
  5441. #ifdef UNICODE
  5442. #define GrayString  GrayStringW
  5443. #else
  5444. #define GrayString  GrayStringA
  5445. #endif // !UNICODE
  5446.  
  5447. #if(WINVER >= 0x0400)
  5448. /* Monolithic state-drawing routine */
  5449. /* Image type */
  5450. #define DST_COMPLEX     0x0000
  5451. #define DST_TEXT        0x0001
  5452. #define DST_PREFIXTEXT  0x0002
  5453. #define DST_ICON        0x0003
  5454. #define DST_BITMAP      0x0004
  5455.  
  5456. /* State type */
  5457. #define DSS_NORMAL      0x0000
  5458. #define DSS_UNION       0x0010  /* Gray string appearance */
  5459. #define DSS_DISABLED    0x0020
  5460. #define DSS_MONO        0x0080
  5461. #define DSS_RIGHT       0x8000
  5462.  
  5463. WINUSERAPI BOOL WINAPI DrawStateA(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT);
  5464. WINUSERAPI BOOL WINAPI DrawStateW(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT);
  5465. #ifdef UNICODE
  5466. #define DrawState  DrawStateW
  5467. #else
  5468. #define DrawState  DrawStateA
  5469. #endif // !UNICODE
  5470. #endif /* WINVER >= 0x0400 */
  5471.  
  5472. WINUSERAPI
  5473. LONG
  5474. WINAPI
  5475. TabbedTextOutA(
  5476.     HDC hDC,
  5477.     int X,
  5478.     int Y,
  5479.     LPCSTR lpString,
  5480.     int nCount,
  5481.     int nTabPositions,
  5482.     LPINT lpnTabStopPositions,
  5483.     int nTabOrigin);
  5484. WINUSERAPI
  5485. LONG
  5486. WINAPI
  5487. TabbedTextOutW(
  5488.     HDC hDC,
  5489.     int X,
  5490.     int Y,
  5491.     LPCWSTR lpString,
  5492.     int nCount,
  5493.     int nTabPositions,
  5494.     LPINT lpnTabStopPositions,
  5495.     int nTabOrigin);
  5496. #ifdef UNICODE
  5497. #define TabbedTextOut  TabbedTextOutW
  5498. #else
  5499. #define TabbedTextOut  TabbedTextOutA
  5500. #endif // !UNICODE
  5501.  
  5502. WINUSERAPI
  5503. DWORD
  5504. WINAPI
  5505. GetTabbedTextExtentA(
  5506.     HDC hDC,
  5507.     LPCSTR lpString,
  5508.     int nCount,
  5509.     int nTabPositions,
  5510.     LPINT lpnTabStopPositions);
  5511. WINUSERAPI
  5512. DWORD
  5513. WINAPI
  5514. GetTabbedTextExtentW(
  5515.     HDC hDC,
  5516.     LPCWSTR lpString,
  5517.     int nCount,
  5518.     int nTabPositions,
  5519.     LPINT lpnTabStopPositions);
  5520. #ifdef UNICODE
  5521. #define GetTabbedTextExtent  GetTabbedTextExtentW
  5522. #else
  5523. #define GetTabbedTextExtent  GetTabbedTextExtentA
  5524. #endif // !UNICODE
  5525.  
  5526. WINUSERAPI
  5527. BOOL
  5528. WINAPI
  5529. UpdateWindow(
  5530.     HWND hWnd);
  5531.  
  5532. WINUSERAPI
  5533. HWND
  5534. WINAPI
  5535. SetActiveWindow(
  5536.     HWND hWnd);
  5537.  
  5538. WINUSERAPI
  5539. HWND
  5540. WINAPI
  5541. GetForegroundWindow(
  5542.     VOID);
  5543.  
  5544. #if(WINVER >= 0x0400)
  5545. WINUSERAPI BOOL WINAPI PaintDesktop(HDC hdc);
  5546.  
  5547. #endif /* WINVER >= 0x0400 */
  5548.  
  5549. WINUSERAPI
  5550. BOOL
  5551. WINAPI
  5552. SetForegroundWindow(
  5553.     HWND hWnd);
  5554.  
  5555. WINUSERAPI
  5556. HWND
  5557. WINAPI
  5558. WindowFromDC(
  5559.     HDC hDC);
  5560.  
  5561. WINUSERAPI
  5562. HDC
  5563. WINAPI
  5564. GetDC(
  5565.     HWND hWnd);
  5566.  
  5567. WINUSERAPI
  5568. HDC
  5569. WINAPI
  5570. GetDCEx(
  5571.     HWND hWnd ,
  5572.     HRGN hrgnClip,
  5573.     DWORD flags);
  5574.  
  5575. /*
  5576.  * GetDCEx() flags
  5577.  */
  5578. #define DCX_WINDOW           0x00000001L
  5579. #define DCX_CACHE            0x00000002L
  5580. #define DCX_NORESETATTRS     0x00000004L
  5581. #define DCX_CLIPCHILDREN     0x00000008L
  5582. #define DCX_CLIPSIBLINGS     0x00000010L
  5583. #define DCX_PARENTCLIP       0x00000020L
  5584.  
  5585. #define DCX_EXCLUDERGN       0x00000040L
  5586. #define DCX_INTERSECTRGN     0x00000080L
  5587.  
  5588. #define DCX_EXCLUDEUPDATE    0x00000100L
  5589. #define DCX_INTERSECTUPDATE  0x00000200L
  5590.  
  5591. #define DCX_LOCKWINDOWUPDATE 0x00000400L
  5592.  
  5593. #define DCX_VALIDATE         0x00200000L
  5594.  
  5595.  
  5596.  
  5597. WINUSERAPI
  5598. BOOL
  5599. WINAPI
  5600. AlignRects(LPRECT arc, DWORD cCount, DWORD iPrimary, DWORD dwFlags);
  5601.  
  5602. //
  5603. // AlignRects flags
  5604. //
  5605.  
  5606. #define CUDR_NORMAL             0x0000
  5607. #define CUDR_NOSNAPTOGRID       0x0001
  5608. #define CUDR_NORESOLVEPOSITIONS 0x0002
  5609. #define CUDR_NOCLOSEGAPS        0x0004
  5610. #define CUDR_NEGATIVECOORDS     0x0008
  5611. #define CUDR_NOPRIMARY          0x0010
  5612.  
  5613.  
  5614. WINUSERAPI
  5615. HDC
  5616. WINAPI
  5617. GetWindowDC(
  5618.     HWND hWnd);
  5619.  
  5620. WINUSERAPI
  5621. int
  5622. WINAPI
  5623. ReleaseDC(
  5624.     HWND hWnd,
  5625.     HDC hDC);
  5626.  
  5627. WINUSERAPI
  5628. HDC
  5629. WINAPI
  5630. BeginPaint(
  5631.     HWND hWnd,
  5632.     LPPAINTSTRUCT lpPaint);
  5633.  
  5634. WINUSERAPI
  5635. BOOL
  5636. WINAPI
  5637. EndPaint(
  5638.     HWND hWnd,
  5639.     CONST PAINTSTRUCT *lpPaint);
  5640.  
  5641. WINUSERAPI
  5642. BOOL
  5643. WINAPI
  5644. GetUpdateRect(
  5645.     HWND hWnd,
  5646.     LPRECT lpRect,
  5647.     BOOL bErase);
  5648.  
  5649. WINUSERAPI
  5650. int
  5651. WINAPI
  5652. GetUpdateRgn(
  5653.     HWND hWnd,
  5654.     HRGN hRgn,
  5655.     BOOL bErase);
  5656.  
  5657. WINUSERAPI
  5658. int
  5659. WINAPI
  5660. SetWindowRgn(
  5661.     HWND hWnd,
  5662.     HRGN hRgn,
  5663.     BOOL bRedraw);
  5664.  
  5665. WINUSERAPI
  5666. int
  5667. WINAPI
  5668. GetWindowRgn(
  5669.     HWND hWnd,
  5670.     HRGN hRgn);
  5671.  
  5672. WINUSERAPI
  5673. int
  5674. WINAPI
  5675. ExcludeUpdateRgn(
  5676.     HDC hDC,
  5677.     HWND hWnd);
  5678.  
  5679. WINUSERAPI
  5680. BOOL
  5681. WINAPI
  5682. InvalidateRect(
  5683.     HWND hWnd ,
  5684.     CONST RECT *lpRect,
  5685.     BOOL bErase);
  5686.  
  5687. WINUSERAPI
  5688. BOOL
  5689. WINAPI
  5690. ValidateRect(
  5691.     HWND hWnd ,
  5692.     CONST RECT *lpRect);
  5693.  
  5694. WINUSERAPI
  5695. BOOL
  5696. WINAPI
  5697. InvalidateRgn(
  5698.     HWND hWnd,
  5699.     HRGN hRgn,
  5700.     BOOL bErase);
  5701.  
  5702. WINUSERAPI
  5703. BOOL
  5704. WINAPI
  5705. ValidateRgn(
  5706.     HWND hWnd,
  5707.     HRGN hRgn);
  5708.  
  5709.  
  5710. WINUSERAPI
  5711. BOOL
  5712. WINAPI
  5713. RedrawWindow(
  5714.     HWND hWnd,
  5715.     CONST RECT *lprcUpdate,
  5716.     HRGN hrgnUpdate,
  5717.     UINT flags);
  5718.  
  5719. /*
  5720.  * RedrawWindow() flags
  5721.  */
  5722. #define RDW_INVALIDATE          0x0001
  5723. #define RDW_INTERNALPAINT       0x0002
  5724. #define RDW_ERASE               0x0004
  5725.  
  5726. #define RDW_VALIDATE            0x0008
  5727. #define RDW_NOINTERNALPAINT     0x0010
  5728. #define RDW_NOERASE             0x0020
  5729.  
  5730. #define RDW_NOCHILDREN          0x0040
  5731. #define RDW_ALLCHILDREN         0x0080
  5732.  
  5733. #define RDW_UPDATENOW           0x0100
  5734. #define RDW_ERASENOW            0x0200
  5735.  
  5736. #define RDW_FRAME               0x0400
  5737. #define RDW_NOFRAME             0x0800
  5738.  
  5739.  
  5740. /*
  5741.  * LockWindowUpdate API
  5742.  */
  5743.  
  5744. WINUSERAPI
  5745. BOOL
  5746. WINAPI
  5747. LockWindowUpdate(
  5748.     HWND hWndLock);
  5749.  
  5750. WINUSERAPI
  5751. BOOL
  5752. WINAPI
  5753. ScrollWindow(
  5754.     HWND hWnd,
  5755.     int XAmount,
  5756.     int YAmount,
  5757.     CONST RECT *lpRect,
  5758.     CONST RECT *lpClipRect);
  5759.  
  5760. WINUSERAPI
  5761. BOOL
  5762. WINAPI
  5763. ScrollDC(
  5764.     HDC hDC,
  5765.     int dx,
  5766.     int dy,
  5767.     CONST RECT *lprcScroll,
  5768.     CONST RECT *lprcClip ,
  5769.     HRGN hrgnUpdate,
  5770.     LPRECT lprcUpdate);
  5771.  
  5772. WINUSERAPI
  5773. int
  5774. WINAPI
  5775. ScrollWindowEx(
  5776.     HWND hWnd,
  5777.     int dx,
  5778.     int dy,
  5779.     CONST RECT *prcScroll,
  5780.     CONST RECT *prcClip ,
  5781.     HRGN hrgnUpdate,
  5782.     LPRECT prcUpdate,
  5783.     UINT flags);
  5784.  
  5785. #define SW_SCROLLCHILDREN   0x0001  /* Scroll children within *lprcScroll. */
  5786. #define SW_INVALIDATE       0x0002  /* Invalidate after scrolling */
  5787. #define SW_ERASE            0x0004  /* If SW_INVALIDATE, don't send WM_ERASEBACKGROUND */
  5788. #if(WINVER >= 0x0500)
  5789. #define SW_SMOOTHSCROLL     0x0010  /* Use smooth scrolling */
  5790. #endif /* WINVER >= 0x0500 */
  5791.  
  5792. #ifndef NOSCROLL
  5793.  
  5794. WINUSERAPI
  5795. int
  5796. WINAPI
  5797. SetScrollPos(
  5798.     HWND hWnd,
  5799.     int nBar,
  5800.     int nPos,
  5801.     BOOL bRedraw);
  5802.  
  5803. WINUSERAPI
  5804. int
  5805. WINAPI
  5806. GetScrollPos(
  5807.     HWND hWnd,
  5808.     int nBar);
  5809.  
  5810. WINUSERAPI
  5811. BOOL
  5812. WINAPI
  5813. SetScrollRange(
  5814.     HWND hWnd,
  5815.     int nBar,
  5816.     int nMinPos,
  5817.     int nMaxPos,
  5818.     BOOL bRedraw);
  5819.  
  5820. WINUSERAPI
  5821. BOOL
  5822. WINAPI
  5823. GetScrollRange(
  5824.     HWND hWnd,
  5825.     int nBar,
  5826.     LPINT lpMinPos,
  5827.     LPINT lpMaxPos);
  5828.  
  5829. WINUSERAPI
  5830. BOOL
  5831. WINAPI
  5832. ShowScrollBar(
  5833.     HWND hWnd,
  5834.     int wBar,
  5835.     BOOL bShow);
  5836.  
  5837. WINUSERAPI
  5838. BOOL
  5839. WINAPI
  5840. EnableScrollBar(
  5841.     HWND hWnd,
  5842.     UINT wSBflags,
  5843.     UINT wArrows);
  5844.  
  5845.  
  5846. /*
  5847.  * EnableScrollBar() flags
  5848.  */
  5849. #define ESB_ENABLE_BOTH     0x0000
  5850. #define ESB_DISABLE_BOTH    0x0003
  5851.  
  5852. #define ESB_DISABLE_LEFT    0x0001
  5853. #define ESB_DISABLE_RIGHT   0x0002
  5854.  
  5855. #define ESB_DISABLE_UP      0x0001
  5856. #define ESB_DISABLE_DOWN    0x0002
  5857.  
  5858. #define ESB_DISABLE_LTUP    ESB_DISABLE_LEFT
  5859. #define ESB_DISABLE_RTDN    ESB_DISABLE_RIGHT
  5860.  
  5861.  
  5862. #endif  /* !NOSCROLL */
  5863.  
  5864. WINUSERAPI
  5865. BOOL
  5866. WINAPI
  5867. SetPropA(
  5868.     HWND hWnd,
  5869.     LPCSTR lpString,
  5870.     HANDLE hData);
  5871. WINUSERAPI
  5872. BOOL
  5873. WINAPI
  5874. SetPropW(
  5875.     HWND hWnd,
  5876.     LPCWSTR lpString,
  5877.     HANDLE hData);
  5878. #ifdef UNICODE
  5879. #define SetProp  SetPropW
  5880. #else
  5881. #define SetProp  SetPropA
  5882. #endif // !UNICODE
  5883.  
  5884. WINUSERAPI
  5885. HANDLE
  5886. WINAPI
  5887. GetPropA(
  5888.     HWND hWnd,
  5889.     LPCSTR lpString);
  5890. WINUSERAPI
  5891. HANDLE
  5892. WINAPI
  5893. GetPropW(
  5894.     HWND hWnd,
  5895.     LPCWSTR lpString);
  5896. #ifdef UNICODE
  5897. #define GetProp  GetPropW
  5898. #else
  5899. #define GetProp  GetPropA
  5900. #endif // !UNICODE
  5901.  
  5902. WINUSERAPI
  5903. HANDLE
  5904. WINAPI
  5905. RemovePropA(
  5906.     HWND hWnd,
  5907.     LPCSTR lpString);
  5908. WINUSERAPI
  5909. HANDLE
  5910. WINAPI
  5911. RemovePropW(
  5912.     HWND hWnd,
  5913.     LPCWSTR lpString);
  5914. #ifdef UNICODE
  5915. #define RemoveProp  RemovePropW
  5916. #else
  5917. #define RemoveProp  RemovePropA
  5918. #endif // !UNICODE
  5919.  
  5920. WINUSERAPI
  5921. int
  5922. WINAPI
  5923. EnumPropsExA(
  5924.     HWND hWnd,
  5925.     PROPENUMPROCEXA lpEnumFunc,
  5926.     LPARAM lParam);
  5927. WINUSERAPI
  5928. int
  5929. WINAPI
  5930. EnumPropsExW(
  5931.     HWND hWnd,
  5932.     PROPENUMPROCEXW lpEnumFunc,
  5933.     LPARAM lParam);
  5934. #ifdef UNICODE
  5935. #define EnumPropsEx  EnumPropsExW
  5936. #else
  5937. #define EnumPropsEx  EnumPropsExA
  5938. #endif // !UNICODE
  5939.  
  5940. WINUSERAPI
  5941. int
  5942. WINAPI
  5943. EnumPropsA(
  5944.     HWND hWnd,
  5945.     PROPENUMPROCA lpEnumFunc);
  5946. WINUSERAPI
  5947. int
  5948. WINAPI
  5949. EnumPropsW(
  5950.     HWND hWnd,
  5951.     PROPENUMPROCW lpEnumFunc);
  5952. #ifdef UNICODE
  5953. #define EnumProps  EnumPropsW
  5954. #else
  5955. #define EnumProps  EnumPropsA
  5956. #endif // !UNICODE
  5957.  
  5958. WINUSERAPI
  5959. BOOL
  5960. WINAPI
  5961. SetWindowTextA(
  5962.     HWND hWnd,
  5963.     LPCSTR lpString);
  5964. WINUSERAPI
  5965. BOOL
  5966. WINAPI
  5967. SetWindowTextW(
  5968.     HWND hWnd,
  5969.     LPCWSTR lpString);
  5970. #ifdef UNICODE
  5971. #define SetWindowText  SetWindowTextW
  5972. #else
  5973. #define SetWindowText  SetWindowTextA
  5974. #endif // !UNICODE
  5975.  
  5976. WINUSERAPI
  5977. int
  5978. WINAPI
  5979. GetWindowTextA(
  5980.     HWND hWnd,
  5981.     LPSTR lpString,
  5982.     int nMaxCount);
  5983. WINUSERAPI
  5984. int
  5985. WINAPI
  5986. GetWindowTextW(
  5987.     HWND hWnd,
  5988.     LPWSTR lpString,
  5989.     int nMaxCount);
  5990. #ifdef UNICODE
  5991. #define GetWindowText  GetWindowTextW
  5992. #else
  5993. #define GetWindowText  GetWindowTextA
  5994. #endif // !UNICODE
  5995.  
  5996. WINUSERAPI
  5997. int
  5998. WINAPI
  5999. GetWindowTextLengthA(
  6000.     HWND hWnd);
  6001. WINUSERAPI
  6002. int
  6003. WINAPI
  6004. GetWindowTextLengthW(
  6005.     HWND hWnd);
  6006. #ifdef UNICODE
  6007. #define GetWindowTextLength  GetWindowTextLengthW
  6008. #else
  6009. #define GetWindowTextLength  GetWindowTextLengthA
  6010. #endif // !UNICODE
  6011.  
  6012. WINUSERAPI
  6013. BOOL
  6014. WINAPI
  6015. GetClientRect(
  6016.     HWND hWnd,
  6017.     LPRECT lpRect);
  6018.  
  6019. WINUSERAPI
  6020. BOOL
  6021. WINAPI
  6022. GetWindowRect(
  6023.     HWND hWnd,
  6024.     LPRECT lpRect);
  6025.  
  6026. WINUSERAPI
  6027. BOOL
  6028. WINAPI
  6029. AdjustWindowRect(
  6030.     LPRECT lpRect,
  6031.     DWORD dwStyle,
  6032.     BOOL bMenu);
  6033.  
  6034. WINUSERAPI
  6035. BOOL
  6036. WINAPI
  6037. AdjustWindowRectEx(
  6038.     LPRECT lpRect,
  6039.     DWORD dwStyle,
  6040.     BOOL bMenu,
  6041.     DWORD dwExStyle);
  6042.  
  6043. #if(WINVER >= 0x0400)
  6044. #define HELPINFO_WINDOW    0x0001
  6045. #define HELPINFO_MENUITEM  0x0002
  6046. typedef struct tagHELPINFO      /* Structure pointed to by lParam of WM_HELP */
  6047. {
  6048.     UINT    cbSize;             /* Size in bytes of this struct  */
  6049.     int     iContextType;       /* Either HELPINFO_WINDOW or HELPINFO_MENUITEM */
  6050.     int     iCtrlId;            /* Control Id or a Menu item Id. */
  6051.     HANDLE  hItemHandle;        /* hWnd of control or hMenu.     */
  6052.     DWORD   dwContextId;        /* Context Id associated with this item */
  6053.     POINT   MousePos;           /* Mouse Position in screen co-ordinates */
  6054. }  HELPINFO, FAR *LPHELPINFO;
  6055.  
  6056. WINUSERAPI BOOL  WINAPI  SetWindowContextHelpId(HWND, DWORD);
  6057. WINUSERAPI DWORD WINAPI  GetWindowContextHelpId(HWND);
  6058. WINUSERAPI BOOL  WINAPI  SetMenuContextHelpId(HMENU, DWORD);
  6059. WINUSERAPI DWORD WINAPI  GetMenuContextHelpId(HMENU);
  6060.  
  6061. #endif /* WINVER >= 0x0400 */
  6062.  
  6063.  
  6064. #ifndef NOMB
  6065.  
  6066. /*
  6067.  * MessageBox() Flags
  6068.  */
  6069. #define MB_OK                       0x00000000L
  6070. #define MB_OKCANCEL                 0x00000001L
  6071. #define MB_ABORTRETRYIGNORE         0x00000002L
  6072. #define MB_YESNOCANCEL              0x00000003L
  6073. #define MB_YESNO                    0x00000004L
  6074. #define MB_RETRYCANCEL              0x00000005L
  6075.  
  6076.  
  6077. #define MB_ICONHAND                 0x00000010L
  6078. #define MB_ICONQUESTION             0x00000020L
  6079. #define MB_ICONEXCLAMATION          0x00000030L
  6080. #define MB_ICONASTERISK             0x00000040L
  6081.  
  6082. #if(WINVER >= 0x0400)
  6083. #define MB_USERICON                 0x00000080L
  6084. #define MB_ICONWARNING              MB_ICONEXCLAMATION
  6085. #define MB_ICONERROR                MB_ICONHAND
  6086. #endif /* WINVER >= 0x0400 */
  6087.  
  6088. #define MB_ICONINFORMATION          MB_ICONASTERISK
  6089. #define MB_ICONSTOP                 MB_ICONHAND
  6090.  
  6091. #define MB_DEFBUTTON1               0x00000000L
  6092. #define MB_DEFBUTTON2               0x00000100L
  6093. #define MB_DEFBUTTON3               0x00000200L
  6094. #if(WINVER >= 0x0400)
  6095. #define MB_DEFBUTTON4               0x00000300L
  6096. #endif /* WINVER >= 0x0400 */
  6097.  
  6098. #define MB_APPLMODAL                0x00000000L
  6099. #define MB_SYSTEMMODAL              0x00001000L
  6100. #define MB_TASKMODAL                0x00002000L
  6101. #if(WINVER >= 0x0400)
  6102. #define MB_HELP                     0x00004000L // Help Button
  6103. #endif /* WINVER >= 0x0400 */
  6104.  
  6105. #define MB_NOFOCUS                  0x00008000L
  6106. #define MB_SETFOREGROUND            0x00010000L
  6107. #define MB_DEFAULT_DESKTOP_ONLY     0x00020000L
  6108.  
  6109. #if(WINVER >= 0x0400)
  6110. #define MB_TOPMOST                  0x00040000L
  6111. #define MB_RIGHT                    0x00080000L
  6112. #define MB_RTLREADING               0x00100000L
  6113.  
  6114.  
  6115. #endif /* WINVER >= 0x0400 */
  6116.  
  6117. #ifdef _WIN32_WINNT
  6118. #if (_WIN32_WINNT >= 0x0400)
  6119. #define MB_SERVICE_NOTIFICATION          0x00200000L
  6120. #else
  6121. #define MB_SERVICE_NOTIFICATION          0x00040000L
  6122. #endif
  6123. #define MB_SERVICE_NOTIFICATION_NT3X     0x00040000L
  6124. #endif
  6125.  
  6126. #define MB_TYPEMASK                 0x0000000FL
  6127. #define MB_ICONMASK                 0x000000F0L
  6128. #define MB_DEFMASK                  0x00000F00L
  6129. #define MB_MODEMASK                 0x00003000L
  6130. #define MB_MISCMASK                 0x0000C000L
  6131.  
  6132. WINUSERAPI
  6133. int
  6134. WINAPI
  6135. MessageBoxA(
  6136.     HWND hWnd ,
  6137.     LPCSTR lpText,
  6138.     LPCSTR lpCaption,
  6139.     UINT uType);
  6140. WINUSERAPI
  6141. int
  6142. WINAPI
  6143. MessageBoxW(
  6144.     HWND hWnd ,
  6145.     LPCWSTR lpText,
  6146.     LPCWSTR lpCaption,
  6147.     UINT uType);
  6148. #ifdef UNICODE
  6149. #define MessageBox  MessageBoxW
  6150. #else
  6151. #define MessageBox  MessageBoxA
  6152. #endif // !UNICODE
  6153.  
  6154. WINUSERAPI
  6155. int
  6156. WINAPI
  6157. MessageBoxExA(
  6158.     HWND hWnd ,
  6159.     LPCSTR lpText,
  6160.     LPCSTR lpCaption,
  6161.     UINT uType,
  6162.     WORD wLanguageId);
  6163. WINUSERAPI
  6164. int
  6165. WINAPI
  6166. MessageBoxExW(
  6167.     HWND hWnd ,
  6168.     LPCWSTR lpText,
  6169.     LPCWSTR lpCaption,
  6170.     UINT uType,
  6171.     WORD wLanguageId);
  6172. #ifdef UNICODE
  6173. #define MessageBoxEx  MessageBoxExW
  6174. #else
  6175. #define MessageBoxEx  MessageBoxExA
  6176. #endif // !UNICODE
  6177.  
  6178. #if(WINVER >= 0x0400)
  6179.  
  6180. typedef void (CALLBACK *MSGBOXCALLBACK)(LPHELPINFO lpHelpInfo);
  6181.  
  6182. typedef struct tagMSGBOXPARAMSA
  6183. {
  6184.     UINT        cbSize;
  6185.     HWND        hwndOwner;
  6186.     HINSTANCE   hInstance;
  6187.     LPCSTR      lpszText;
  6188.     LPCSTR      lpszCaption;
  6189.     DWORD       dwStyle;
  6190.     LPCSTR      lpszIcon;
  6191.     DWORD       dwContextHelpId;
  6192.     MSGBOXCALLBACK      lpfnMsgBoxCallback;
  6193.     DWORD   dwLanguageId;
  6194. } MSGBOXPARAMSA, *PMSGBOXPARAMSA, *LPMSGBOXPARAMSA;
  6195. typedef struct tagMSGBOXPARAMSW
  6196. {
  6197.     UINT        cbSize;
  6198.     HWND        hwndOwner;
  6199.     HINSTANCE   hInstance;
  6200.     LPCWSTR     lpszText;
  6201.     LPCWSTR     lpszCaption;
  6202.     DWORD       dwStyle;
  6203.     LPCWSTR     lpszIcon;
  6204.     DWORD       dwContextHelpId;
  6205.     MSGBOXCALLBACK      lpfnMsgBoxCallback;
  6206.     DWORD   dwLanguageId;
  6207. } MSGBOXPARAMSW, *PMSGBOXPARAMSW, *LPMSGBOXPARAMSW;
  6208. #ifdef UNICODE
  6209. typedef MSGBOXPARAMSW MSGBOXPARAMS;
  6210. typedef PMSGBOXPARAMSW PMSGBOXPARAMS;
  6211. typedef LPMSGBOXPARAMSW LPMSGBOXPARAMS;
  6212. #else
  6213. typedef MSGBOXPARAMSA MSGBOXPARAMS;
  6214. typedef PMSGBOXPARAMSA PMSGBOXPARAMS;
  6215. typedef LPMSGBOXPARAMSA LPMSGBOXPARAMS;
  6216. #endif // UNICODE
  6217.  
  6218.  
  6219. WINUSERAPI int     WINAPI MessageBoxIndirectA(LPMSGBOXPARAMSA);
  6220. WINUSERAPI int     WINAPI MessageBoxIndirectW(LPMSGBOXPARAMSW);
  6221. #ifdef UNICODE
  6222. #define MessageBoxIndirect  MessageBoxIndirectW
  6223. #else
  6224. #define MessageBoxIndirect  MessageBoxIndirectA
  6225. #endif // !UNICODE
  6226. #endif /* WINVER >= 0x0400 */
  6227.  
  6228.  
  6229.  
  6230. WINUSERAPI
  6231. BOOL
  6232. WINAPI
  6233. MessageBeep(
  6234.     UINT uType);
  6235.  
  6236. #endif /* !NOMB */
  6237.  
  6238. WINUSERAPI
  6239. int
  6240. WINAPI
  6241. ShowCursor(
  6242.     BOOL bShow);
  6243.  
  6244. WINUSERAPI
  6245. BOOL
  6246. WINAPI
  6247. SetCursorPos(
  6248.     int X,
  6249.     int Y);
  6250.  
  6251. WINUSERAPI
  6252. HCURSOR
  6253. WINAPI
  6254. SetCursor(
  6255.     HCURSOR hCursor);
  6256.  
  6257. WINUSERAPI
  6258. BOOL
  6259. WINAPI
  6260. GetCursorPos(
  6261.     LPPOINT lpPoint);
  6262.  
  6263. WINUSERAPI
  6264. BOOL
  6265. WINAPI
  6266. ClipCursor(
  6267.     CONST RECT *lpRect);
  6268.  
  6269. WINUSERAPI
  6270. BOOL
  6271. WINAPI
  6272. GetClipCursor(
  6273.     LPRECT lpRect);
  6274.  
  6275. WINUSERAPI
  6276. HCURSOR
  6277. WINAPI
  6278. GetCursor(
  6279.     VOID);
  6280.  
  6281. WINUSERAPI
  6282. BOOL
  6283. WINAPI
  6284. CreateCaret(
  6285.     HWND hWnd,
  6286.     HBITMAP hBitmap ,
  6287.     int nWidth,
  6288.     int nHeight);
  6289.  
  6290. WINUSERAPI
  6291. UINT
  6292. WINAPI
  6293. GetCaretBlinkTime(
  6294.     VOID);
  6295.  
  6296. WINUSERAPI
  6297. BOOL
  6298. WINAPI
  6299. SetCaretBlinkTime(
  6300.     UINT uMSeconds);
  6301.  
  6302. WINUSERAPI
  6303. BOOL
  6304. WINAPI
  6305. DestroyCaret(
  6306.     VOID);
  6307.  
  6308. WINUSERAPI
  6309. BOOL
  6310. WINAPI
  6311. HideCaret(
  6312.     HWND hWnd);
  6313.  
  6314. WINUSERAPI
  6315. BOOL
  6316. WINAPI
  6317. ShowCaret(
  6318.     HWND hWnd);
  6319.  
  6320. WINUSERAPI
  6321. BOOL
  6322. WINAPI
  6323. SetCaretPos(
  6324.     int X,
  6325.     int Y);
  6326.  
  6327. WINUSERAPI
  6328. BOOL
  6329. WINAPI
  6330. GetCaretPos(
  6331.     LPPOINT lpPoint);
  6332.  
  6333. WINUSERAPI
  6334. BOOL
  6335. WINAPI
  6336. ClientToScreen(
  6337.     HWND hWnd,
  6338.     LPPOINT lpPoint);
  6339.  
  6340. WINUSERAPI
  6341. BOOL
  6342. WINAPI
  6343. ScreenToClient(
  6344.     HWND hWnd,
  6345.     LPPOINT lpPoint);
  6346.  
  6347. WINUSERAPI
  6348. int
  6349. WINAPI
  6350. MapWindowPoints(
  6351.     HWND hWndFrom,
  6352.     HWND hWndTo,
  6353.     LPPOINT lpPoints,
  6354.     UINT cPoints);
  6355.  
  6356. WINUSERAPI
  6357. HWND
  6358. WINAPI
  6359. WindowFromPoint(
  6360.     POINT Point);
  6361.  
  6362. WINUSERAPI
  6363. HWND
  6364. WINAPI
  6365. ChildWindowFromPoint(
  6366.     HWND hWndParent,
  6367.     POINT Point);
  6368.  
  6369. #if(WINVER >= 0x0400)
  6370. #define CWP_ALL             0x0000
  6371. #define CWP_SKIPINVISIBLE   0x0001
  6372. #define CWP_SKIPDISABLED    0x0002
  6373. #define CWP_SKIPTRANSPARENT 0x0004
  6374.  
  6375. WINUSERAPI HWND    WINAPI ChildWindowFromPointEx(HWND, POINT, UINT);
  6376. #endif /* WINVER >= 0x0400 */
  6377.  
  6378. #ifndef NOCOLOR
  6379.  
  6380. /*
  6381.  * Color Types
  6382.  */
  6383. #define CTLCOLOR_MSGBOX         0
  6384. #define CTLCOLOR_EDIT           1
  6385. #define CTLCOLOR_LISTBOX        2
  6386. #define CTLCOLOR_BTN            3
  6387. #define CTLCOLOR_DLG            4
  6388. #define CTLCOLOR_SCROLLBAR      5
  6389. #define CTLCOLOR_STATIC         6
  6390. #define CTLCOLOR_MAX            7
  6391.  
  6392. #define COLOR_SCROLLBAR         0
  6393. #define COLOR_BACKGROUND        1
  6394. #define COLOR_ACTIVECAPTION     2
  6395. #define COLOR_INACTIVECAPTION   3
  6396. #define COLOR_MENU              4
  6397. #define COLOR_WINDOW            5
  6398. #define COLOR_WINDOWFRAME       6
  6399. #define COLOR_MENUTEXT          7
  6400. #define COLOR_WINDOWTEXT        8
  6401. #define COLOR_CAPTIONTEXT       9
  6402. #define COLOR_ACTIVEBORDER      10
  6403. #define COLOR_INACTIVEBORDER    11
  6404. #define COLOR_APPWORKSPACE      12
  6405. #define COLOR_HIGHLIGHT         13
  6406. #define COLOR_HIGHLIGHTTEXT     14
  6407. #define COLOR_BTNFACE           15
  6408. #define COLOR_BTNSHADOW         16
  6409. #define COLOR_GRAYTEXT          17
  6410. #define COLOR_BTNTEXT           18
  6411. #define COLOR_INACTIVECAPTIONTEXT 19
  6412. #define COLOR_BTNHIGHLIGHT      20
  6413.  
  6414. #if(WINVER >= 0x0400)
  6415. #define COLOR_3DDKSHADOW        21
  6416. #define COLOR_3DLIGHT           22
  6417. #define COLOR_INFOTEXT          23
  6418. #define COLOR_INFOBK            24
  6419. #endif /* WINVER >= 0x0400 */
  6420.  
  6421. #if(WINVER >= 0x0500)
  6422. #define COLOR_HOTLIGHT                  26
  6423. #define COLOR_GRADIENTACTIVECAPTION     27
  6424. #define COLOR_GRADIENTINACTIVECAPTION   28
  6425. #endif /* WINVER >= 0x0500 */
  6426.  
  6427. #if(WINVER >= 0x0400)
  6428. #define COLOR_DESKTOP           COLOR_BACKGROUND
  6429. #define COLOR_3DFACE            COLOR_BTNFACE
  6430. #define COLOR_3DSHADOW          COLOR_BTNSHADOW
  6431. #define COLOR_3DHIGHLIGHT       COLOR_BTNHIGHLIGHT
  6432. #define COLOR_3DHILIGHT         COLOR_BTNHIGHLIGHT
  6433. #define COLOR_BTNHILIGHT        COLOR_BTNHIGHLIGHT
  6434. #endif /* WINVER >= 0x0400 */
  6435.  
  6436.  
  6437. WINUSERAPI
  6438. DWORD
  6439. WINAPI
  6440. GetSysColor(
  6441.     int nIndex);
  6442.  
  6443. #if(WINVER >= 0x0400)
  6444. WINUSERAPI
  6445. HBRUSH
  6446. WINAPI
  6447. GetSysColorBrush(
  6448.     int nIndex);
  6449.  
  6450.  
  6451. #endif /* WINVER >= 0x0400 */
  6452.  
  6453. WINUSERAPI
  6454. BOOL
  6455. WINAPI
  6456. SetSysColors(
  6457.     int cElements,
  6458.     CONST INT * lpaElements,
  6459.     CONST COLORREF * lpaRgbValues);
  6460.  
  6461. #endif /* !NOCOLOR */
  6462.  
  6463. WINUSERAPI
  6464. BOOL
  6465. WINAPI
  6466. DrawFocusRect(
  6467.     HDC hDC,
  6468.     CONST RECT * lprc);
  6469.  
  6470. WINUSERAPI
  6471. int
  6472. WINAPI
  6473. FillRect(
  6474.     HDC hDC,
  6475.     CONST RECT *lprc,
  6476.     HBRUSH hbr);
  6477.  
  6478. WINUSERAPI
  6479. int
  6480. WINAPI
  6481. FrameRect(
  6482.     HDC hDC,
  6483.     CONST RECT *lprc,
  6484.     HBRUSH hbr);
  6485.  
  6486. WINUSERAPI
  6487. BOOL
  6488. WINAPI
  6489. InvertRect(
  6490.     HDC hDC,
  6491.     CONST RECT *lprc);
  6492.  
  6493. WINUSERAPI
  6494. BOOL
  6495. WINAPI
  6496. SetRect(
  6497.     LPRECT lprc,
  6498.     int xLeft,
  6499.     int yTop,
  6500.     int xRight,
  6501.     int yBottom);
  6502.  
  6503. WINUSERAPI
  6504. BOOL
  6505. WINAPI
  6506.     SetRectEmpty(
  6507.     LPRECT lprc);
  6508.  
  6509. WINUSERAPI
  6510. BOOL
  6511. WINAPI
  6512. CopyRect(
  6513.     LPRECT lprcDst,
  6514.     CONST RECT *lprcSrc);
  6515.  
  6516. WINUSERAPI
  6517. BOOL
  6518. WINAPI
  6519. InflateRect(
  6520.     LPRECT lprc,
  6521.     int dx,
  6522.     int dy);
  6523.  
  6524. WINUSERAPI
  6525. BOOL
  6526. WINAPI
  6527. IntersectRect(
  6528.     LPRECT lprcDst,
  6529.     CONST RECT *lprcSrc1,
  6530.     CONST RECT *lprcSrc2);
  6531.  
  6532. WINUSERAPI
  6533. BOOL
  6534. WINAPI
  6535. UnionRect(
  6536.     LPRECT lprcDst,
  6537.     CONST RECT *lprcSrc1,
  6538.     CONST RECT *lprcSrc2);
  6539.  
  6540. WINUSERAPI
  6541. BOOL
  6542. WINAPI
  6543. SubtractRect(
  6544.     LPRECT lprcDst,
  6545.     CONST RECT *lprcSrc1,
  6546.     CONST RECT *lprcSrc2);
  6547.  
  6548. WINUSERAPI
  6549. BOOL
  6550. WINAPI
  6551. OffsetRect(
  6552.     LPRECT lprc,
  6553.     int dx,
  6554.     int dy);
  6555.  
  6556. WINUSERAPI
  6557. BOOL
  6558. WINAPI
  6559. IsRectEmpty(
  6560.     CONST RECT *lprc);
  6561.  
  6562. WINUSERAPI
  6563. BOOL
  6564. WINAPI
  6565. EqualRect(
  6566.     CONST RECT *lprc1,
  6567.     CONST RECT *lprc2);
  6568.  
  6569. WINUSERAPI
  6570. BOOL
  6571. WINAPI
  6572. PtInRect(
  6573.     CONST RECT *lprc,
  6574.     POINT pt);
  6575.  
  6576. #ifndef NOWINOFFSETS
  6577.  
  6578. WINUSERAPI
  6579. WORD
  6580. WINAPI
  6581. GetWindowWord(
  6582.     HWND hWnd,
  6583.     int nIndex);
  6584.  
  6585. WINUSERAPI
  6586. WORD
  6587. WINAPI
  6588. SetWindowWord(
  6589.     HWND hWnd,
  6590.     int nIndex,
  6591.     WORD wNewWord);
  6592.  
  6593. WINUSERAPI
  6594. LONG
  6595. WINAPI
  6596. GetWindowLongA(
  6597.     HWND hWnd,
  6598.     int nIndex);
  6599. WINUSERAPI
  6600. LONG
  6601. WINAPI
  6602. GetWindowLongW(
  6603.     HWND hWnd,
  6604.     int nIndex);
  6605. #ifdef UNICODE
  6606. #define GetWindowLong  GetWindowLongW
  6607. #else
  6608. #define GetWindowLong  GetWindowLongA
  6609. #endif // !UNICODE
  6610.  
  6611. WINUSERAPI
  6612. LONG
  6613. WINAPI
  6614. SetWindowLongA(
  6615.     HWND hWnd,
  6616.     int nIndex,
  6617.     LONG dwNewLong);
  6618. WINUSERAPI
  6619. LONG
  6620. WINAPI
  6621. SetWindowLongW(
  6622.     HWND hWnd,
  6623.     int nIndex,
  6624.     LONG dwNewLong);
  6625. #ifdef UNICODE
  6626. #define SetWindowLong  SetWindowLongW
  6627. #else
  6628. #define SetWindowLong  SetWindowLongA
  6629. #endif // !UNICODE
  6630.  
  6631. WINUSERAPI
  6632. WORD
  6633. WINAPI
  6634. GetClassWord(
  6635.     HWND hWnd,
  6636.     int nIndex);
  6637.  
  6638. WINUSERAPI
  6639. WORD
  6640. WINAPI
  6641. SetClassWord(
  6642.     HWND hWnd,
  6643.     int nIndex,
  6644.     WORD wNewWord);
  6645.  
  6646. WINUSERAPI
  6647. DWORD
  6648. WINAPI
  6649. GetClassLongA(
  6650.     HWND hWnd,
  6651.     int nIndex);
  6652. WINUSERAPI
  6653. DWORD
  6654. WINAPI
  6655. GetClassLongW(
  6656.     HWND hWnd,
  6657.     int nIndex);
  6658. #ifdef UNICODE
  6659. #define GetClassLong  GetClassLongW
  6660. #else
  6661. #define GetClassLong  GetClassLongA
  6662. #endif // !UNICODE
  6663.  
  6664. WINUSERAPI
  6665. DWORD
  6666. WINAPI
  6667. SetClassLongA(
  6668.     HWND hWnd,
  6669.     int nIndex,
  6670.     LONG dwNewLong);
  6671. WINUSERAPI
  6672. DWORD
  6673. WINAPI
  6674. SetClassLongW(
  6675.     HWND hWnd,
  6676.     int nIndex,
  6677.     LONG dwNewLong);
  6678. #ifdef UNICODE
  6679. #define SetClassLong  SetClassLongW
  6680. #else
  6681. #define SetClassLong  SetClassLongA
  6682. #endif // !UNICODE
  6683.  
  6684. #endif /* !NOWINOFFSETS */
  6685.  
  6686. WINUSERAPI
  6687. HWND
  6688. WINAPI
  6689. GetDesktopWindow(
  6690.     VOID);
  6691.  
  6692.  
  6693. WINUSERAPI
  6694. HWND
  6695. WINAPI
  6696. GetParent(
  6697.     HWND hWnd);
  6698.  
  6699. WINUSERAPI
  6700. HWND
  6701. WINAPI
  6702. SetParent(
  6703.     HWND hWndChild,
  6704.     HWND hWndNewParent);
  6705.  
  6706. WINUSERAPI
  6707. BOOL
  6708. WINAPI
  6709. EnumChildWindows(
  6710.     HWND hWndParent,
  6711.     WNDENUMPROC lpEnumFunc,
  6712.     LPARAM lParam);
  6713.  
  6714. WINUSERAPI
  6715. HWND
  6716. WINAPI
  6717. FindWindowA(
  6718.     LPCSTR lpClassName ,
  6719.     LPCSTR lpWindowName);
  6720. WINUSERAPI
  6721. HWND
  6722. WINAPI
  6723. FindWindowW(
  6724.     LPCWSTR lpClassName ,
  6725.     LPCWSTR lpWindowName);
  6726. #ifdef UNICODE
  6727. #define FindWindow  FindWindowW
  6728. #else
  6729. #define FindWindow  FindWindowA
  6730. #endif // !UNICODE
  6731.  
  6732. #if(WINVER >= 0x0400)
  6733. WINUSERAPI HWND    WINAPI FindWindowExA(HWND, HWND, LPCSTR, LPCSTR);
  6734. WINUSERAPI HWND    WINAPI FindWindowExW(HWND, HWND, LPCWSTR, LPCWSTR);
  6735. #ifdef UNICODE
  6736. #define FindWindowEx  FindWindowExW
  6737. #else
  6738. #define FindWindowEx  FindWindowExA
  6739. #endif // !UNICODE
  6740.  
  6741. #endif /* WINVER >= 0x0400 */
  6742.  
  6743.  
  6744. WINUSERAPI
  6745. BOOL
  6746. WINAPI
  6747. EnumWindows(
  6748.     WNDENUMPROC lpEnumFunc,
  6749.     LPARAM lParam);
  6750.  
  6751. WINUSERAPI
  6752. BOOL
  6753. WINAPI
  6754. EnumThreadWindows(
  6755.     DWORD dwThreadId,
  6756.     WNDENUMPROC lpfn,
  6757.     LPARAM lParam);
  6758.  
  6759. #define EnumTaskWindows(hTask, lpfn, lParam) EnumThreadWindows((DWORD)hTask, lpfn, lParam)
  6760.  
  6761. WINUSERAPI
  6762. int
  6763. WINAPI
  6764. GetClassNameA(
  6765.     HWND hWnd,
  6766.     LPSTR lpClassName,
  6767.     int nMaxCount);
  6768. WINUSERAPI
  6769. int
  6770. WINAPI
  6771. GetClassNameW(
  6772.     HWND hWnd,
  6773.     LPWSTR lpClassName,
  6774.     int nMaxCount);
  6775. #ifdef UNICODE
  6776. #define GetClassName  GetClassNameW
  6777. #else
  6778. #define GetClassName  GetClassNameA
  6779. #endif // !UNICODE
  6780.  
  6781. WINUSERAPI
  6782. HWND
  6783. WINAPI
  6784. GetTopWindow(
  6785.     HWND hWnd);
  6786.  
  6787. #define GetNextWindow(hWnd, wCmd) GetWindow(hWnd, wCmd)
  6788. #define GetSysModalWindow() (NULL)
  6789. #define SetSysModalWindow(hWnd) (NULL)
  6790.  
  6791. WINUSERAPI
  6792. DWORD
  6793. WINAPI
  6794. GetWindowThreadProcessId(
  6795.     HWND hWnd,
  6796.     LPDWORD lpdwProcessId);
  6797.  
  6798. #define GetWindowTask(hWnd) \
  6799.         ((HANDLE)GetWindowThreadProcessId(hWnd, NULL))
  6800.  
  6801. WINUSERAPI
  6802. HWND
  6803. WINAPI
  6804. GetLastActivePopup(
  6805.     HWND hWnd);
  6806.  
  6807. /*
  6808.  * GetWindow() Constants
  6809.  */
  6810. #define GW_HWNDFIRST        0
  6811. #define GW_HWNDLAST         1
  6812. #define GW_HWNDNEXT         2
  6813. #define GW_HWNDPREV         3
  6814. #define GW_OWNER            4
  6815. #define GW_CHILD            5
  6816. #if (_WIN32_WINNT <= 0x0400)
  6817. #define GW_MAX              5
  6818. #else
  6819. #define GW_ENABLEDPOPUP     6
  6820. #define GW_MAX              6
  6821. #endif
  6822.  
  6823. WINUSERAPI
  6824. HWND
  6825. WINAPI
  6826. GetWindow(
  6827.     HWND hWnd,
  6828.     UINT uCmd);
  6829.  
  6830.  
  6831.  
  6832. #ifndef NOWH
  6833.  
  6834. #ifdef STRICT
  6835.  
  6836. WINUSERAPI
  6837. HHOOK
  6838. WINAPI
  6839. SetWindowsHookA(
  6840.     int nFilterType,
  6841.     HOOKPROC pfnFilterProc);
  6842. WINUSERAPI
  6843. HHOOK
  6844. WINAPI
  6845. SetWindowsHookW(
  6846.     int nFilterType,
  6847.     HOOKPROC pfnFilterProc);
  6848. #ifdef UNICODE
  6849. #define SetWindowsHook  SetWindowsHookW
  6850. #else
  6851. #define SetWindowsHook  SetWindowsHookA
  6852. #endif // !UNICODE
  6853.  
  6854. #else /* !STRICT */
  6855.  
  6856. WINUSERAPI
  6857. HOOKPROC
  6858. WINAPI
  6859. SetWindowsHookA(
  6860.     int nFilterType,
  6861.     HOOKPROC pfnFilterProc);
  6862. WINUSERAPI
  6863. HOOKPROC
  6864. WINAPI
  6865. SetWindowsHookW(
  6866.     int nFilterType,
  6867.     HOOKPROC pfnFilterProc);
  6868. #ifdef UNICODE
  6869. #define SetWindowsHook  SetWindowsHookW
  6870. #else
  6871. #define SetWindowsHook  SetWindowsHookA
  6872. #endif // !UNICODE
  6873.  
  6874. #endif /* !STRICT */
  6875.  
  6876. WINUSERAPI
  6877. BOOL
  6878. WINAPI
  6879. UnhookWindowsHook(
  6880.     int nCode,
  6881.     HOOKPROC pfnFilterProc);
  6882.  
  6883. WINUSERAPI
  6884. HHOOK
  6885. WINAPI
  6886. SetWindowsHookExA(
  6887.     int idHook,
  6888.     HOOKPROC lpfn,
  6889.     HINSTANCE hmod,
  6890.     DWORD dwThreadId);
  6891. WINUSERAPI
  6892. HHOOK
  6893. WINAPI
  6894. SetWindowsHookExW(
  6895.     int idHook,
  6896.     HOOKPROC lpfn,
  6897.     HINSTANCE hmod,
  6898.     DWORD dwThreadId);
  6899. #ifdef UNICODE
  6900. #define SetWindowsHookEx  SetWindowsHookExW
  6901. #else
  6902. #define SetWindowsHookEx  SetWindowsHookExA
  6903. #endif // !UNICODE
  6904.  
  6905. WINUSERAPI
  6906. BOOL
  6907. WINAPI
  6908. UnhookWindowsHookEx(
  6909.     HHOOK hhk);
  6910.  
  6911. WINUSERAPI
  6912. LRESULT
  6913. WINAPI
  6914. CallNextHookEx(
  6915.     HHOOK hhk,
  6916.     int nCode,
  6917.     WPARAM wParam,
  6918.     LPARAM lParam);
  6919.  
  6920. /*
  6921.  * Macros for source-level compatibility with old functions.
  6922.  */
  6923. #ifdef STRICT
  6924. #define DefHookProc(nCode, wParam, lParam, phhk)\
  6925.         CallNextHookEx(*phhk, nCode, wParam, lParam)
  6926. #else
  6927. #define DefHookProc(nCode, wParam, lParam, phhk)\
  6928.         CallNextHookEx((HHOOK)*phhk, nCode, wParam, lParam)
  6929. #endif /* STRICT */
  6930.  
  6931. #endif /* !NOWH */
  6932.  
  6933. #ifndef NOMENUS
  6934.  
  6935. // begin_r_winuser
  6936.  
  6937. /* ;win40  -- A lot of MF_* flags have been renamed as MFT_* and MFS_* flags */
  6938. /*
  6939.  * Menu flags for Add/Check/EnableMenuItem()
  6940.  */
  6941. #define MF_INSERT           0x00000000L
  6942. #define MF_CHANGE           0x00000080L
  6943. #define MF_APPEND           0x00000100L
  6944. #define MF_DELETE           0x00000200L
  6945. #define MF_REMOVE           0x00001000L
  6946.  
  6947. #define MF_BYCOMMAND        0x00000000L
  6948. #define MF_BYPOSITION       0x00000400L
  6949.  
  6950. #define MF_SEPARATOR        0x00000800L
  6951.  
  6952. #define MF_ENABLED          0x00000000L
  6953. #define MF_GRAYED           0x00000001L
  6954. #define MF_DISABLED         0x00000002L
  6955.  
  6956. #define MF_UNCHECKED        0x00000000L
  6957. #define MF_CHECKED          0x00000008L
  6958. #define MF_USECHECKBITMAPS  0x00000200L
  6959.  
  6960. #define MF_STRING           0x00000000L
  6961. #define MF_BITMAP           0x00000004L
  6962. #define MF_OWNERDRAW        0x00000100L
  6963.  
  6964. #define MF_POPUP            0x00000010L
  6965. #define MF_MENUBARBREAK     0x00000020L
  6966. #define MF_MENUBREAK        0x00000040L
  6967.  
  6968. #define MF_UNHILITE         0x00000000L
  6969. #define MF_HILITE           0x00000080L
  6970.  
  6971. #if(WINVER >= 0x0400)
  6972. #define MF_DEFAULT          0x00001000L
  6973. #endif /* WINVER >= 0x0400 */
  6974. #define MF_SYSMENU          0x00002000L
  6975. #define MF_HELP             0x00004000L
  6976. #if(WINVER >= 0x0400)
  6977. #define MF_RIGHTJUSTIFY     0x00004000L
  6978. #endif /* WINVER >= 0x0400 */
  6979.  
  6980. #define MF_MOUSESELECT      0x00008000L
  6981. #if(WINVER >= 0x0400)
  6982. #define MF_END              0x00000080L  /* Obsolete -- only used by old RES files */
  6983. #endif /* WINVER >= 0x0400 */
  6984.  
  6985.  
  6986. #if(WINVER >= 0x0400)
  6987. #define MFT_STRING          MF_STRING
  6988. #define MFT_BITMAP          MF_BITMAP
  6989. #define MFT_MENUBARBREAK    MF_MENUBARBREAK
  6990. #define MFT_MENUBREAK       MF_MENUBREAK
  6991. #define MFT_OWNERDRAW       MF_OWNERDRAW
  6992. #define MFT_RADIOCHECK      0x00000200L
  6993. #define MFT_SEPARATOR       MF_SEPARATOR
  6994. #define MFT_RIGHTORDER      0x00002000L
  6995. #define MFT_RIGHTJUSTIFY    MF_RIGHTJUSTIFY
  6996.  
  6997. /* Menu flags for Add/Check/EnableMenuItem() */
  6998. #define MFS_GRAYED          0x00000003L
  6999. #define MFS_DISABLED        MFS_GRAYED
  7000. #define MFS_CHECKED         MF_CHECKED
  7001. #define MFS_HILITE          MF_HILITE
  7002. #define MFS_ENABLED         MF_ENABLED
  7003. #define MFS_UNCHECKED       MF_UNCHECKED
  7004. #define MFS_UNHILITE        MF_UNHILITE
  7005. #define MFS_DEFAULT         MF_DEFAULT
  7006. #if(WINVER >= 0x0500)
  7007. #define MFS_MASK            0x0000108BL
  7008. #define MFS_HOTTRACKDRAWN   0x10000000L
  7009. #define MFS_CACHEDBMP       0x20000000L
  7010. #define MFS_BOTTOMGAPDROP   0x40000000L
  7011. #define MFS_TOPGAPDROP      0x80000000L
  7012. #define MFS_GAPDROP         0xC0000000L
  7013. #endif /* WINVER >= 0x0500 */
  7014.  
  7015. #endif /* WINVER >= 0x0400 */
  7016.  
  7017. // end_r_winuser
  7018.  
  7019. #if(WINVER >= 0x0400)
  7020.  
  7021. WINUSERAPI
  7022. BOOL
  7023. WINAPI
  7024. CheckMenuRadioItem(HMENU, UINT, UINT, UINT, UINT);
  7025. #endif /* WINVER >= 0x0400 */
  7026.  
  7027. /*
  7028.  * Menu item resource format
  7029.  */
  7030. typedef struct {
  7031.     WORD versionNumber;
  7032.     WORD offset;
  7033. } MENUITEMTEMPLATEHEADER, *PMENUITEMTEMPLATEHEADER;
  7034.  
  7035. typedef struct {        // version 0
  7036.     WORD mtOption;
  7037.     WORD mtID;
  7038.     WCHAR mtString[1];
  7039. } MENUITEMTEMPLATE, *PMENUITEMTEMPLATE;
  7040. #define MF_END             0x00000080L          // r_winuser
  7041.  
  7042. #endif /* !NOMENUS */
  7043.  
  7044. #ifndef NOSYSCOMMANDS
  7045.  
  7046. // begin_r_winuser
  7047. /*
  7048.  * System Menu Command Values
  7049.  */
  7050. #define SC_SIZE         0xF000
  7051. #define SC_MOVE         0xF010
  7052. #define SC_MINIMIZE     0xF020
  7053. #define SC_MAXIMIZE     0xF030
  7054. #define SC_NEXTWINDOW   0xF040
  7055. #define SC_PREVWINDOW   0xF050
  7056. #define SC_CLOSE        0xF060
  7057. #define SC_VSCROLL      0xF070
  7058. #define SC_HSCROLL      0xF080
  7059. #define SC_MOUSEMENU    0xF090
  7060. #define SC_KEYMENU      0xF100
  7061. #define SC_ARRANGE      0xF110
  7062. #define SC_RESTORE      0xF120
  7063. #define SC_TASKLIST     0xF130
  7064. #define SC_SCREENSAVE   0xF140
  7065. #define SC_HOTKEY       0xF150
  7066. #if(WINVER >= 0x0400)
  7067. #define SC_DEFAULT      0xF160
  7068. #define SC_MONITORPOWER 0xF170
  7069. #define SC_CONTEXTHELP  0xF180
  7070. #define SC_SEPARATOR    0xF00F
  7071. #endif /* WINVER >= 0x0400 */
  7072. /*
  7073.  * Obsolete names
  7074.  */
  7075. #define SC_ICON         SC_MINIMIZE
  7076. #define SC_ZOOM         SC_MAXIMIZE
  7077.  
  7078. // end_r_winuser
  7079. #endif /* !NOSYSCOMMANDS */
  7080.  
  7081. /*
  7082.  * Resource Loading Routines
  7083.  */
  7084.  
  7085. WINUSERAPI
  7086. HBITMAP
  7087. WINAPI
  7088. LoadBitmapA(
  7089.     HINSTANCE hInstance,
  7090.     LPCSTR lpBitmapName);
  7091. WINUSERAPI
  7092. HBITMAP
  7093. WINAPI
  7094. LoadBitmapW(
  7095.     HINSTANCE hInstance,
  7096.     LPCWSTR lpBitmapName);
  7097. #ifdef UNICODE
  7098. #define LoadBitmap  LoadBitmapW
  7099. #else
  7100. #define LoadBitmap  LoadBitmapA
  7101. #endif // !UNICODE
  7102.  
  7103. WINUSERAPI
  7104. HCURSOR
  7105. WINAPI
  7106. LoadCursorA(
  7107.     HINSTANCE hInstance,
  7108.     LPCSTR lpCursorName);
  7109. WINUSERAPI
  7110. HCURSOR
  7111. WINAPI
  7112. LoadCursorW(
  7113.     HINSTANCE hInstance,
  7114.     LPCWSTR lpCursorName);
  7115. #ifdef UNICODE
  7116. #define LoadCursor  LoadCursorW
  7117. #else
  7118. #define LoadCursor  LoadCursorA
  7119. #endif // !UNICODE
  7120.  
  7121. WINUSERAPI
  7122. HCURSOR
  7123. WINAPI
  7124. LoadCursorFromFileA(
  7125.     LPCSTR    lpFileName);
  7126. WINUSERAPI
  7127. HCURSOR
  7128. WINAPI
  7129. LoadCursorFromFileW(
  7130.     LPCWSTR    lpFileName);
  7131. #ifdef UNICODE
  7132. #define LoadCursorFromFile  LoadCursorFromFileW
  7133. #else
  7134. #define LoadCursorFromFile  LoadCursorFromFileA
  7135. #endif // !UNICODE
  7136.  
  7137. WINUSERAPI
  7138. HCURSOR
  7139. WINAPI
  7140. CreateCursor(
  7141.     HINSTANCE hInst,
  7142.     int xHotSpot,
  7143.     int yHotSpot,
  7144.     int nWidth,
  7145.     int nHeight,
  7146.     CONST VOID *pvANDPlane,
  7147.     CONST VOID *pvXORPlane);
  7148.  
  7149. WINUSERAPI
  7150. BOOL
  7151. WINAPI
  7152. DestroyCursor(
  7153.     HCURSOR hCursor);
  7154.  
  7155. #ifndef _MAC
  7156. #define CopyCursor(pcur) ((HCURSOR)CopyIcon((HICON)(pcur)))
  7157. #else
  7158. WINUSERAPI
  7159. HCURSOR
  7160. WINAPI
  7161. CopyCursor(
  7162.     HCURSOR hCursor);
  7163. #endif
  7164.  
  7165. /*
  7166.  * Standard Cursor IDs
  7167.  */
  7168. #define IDC_ARROW           MAKEINTRESOURCE(32512)
  7169. #define IDC_IBEAM           MAKEINTRESOURCE(32513)
  7170. #define IDC_WAIT            MAKEINTRESOURCE(32514)
  7171. #define IDC_CROSS           MAKEINTRESOURCE(32515)
  7172. #define IDC_UPARROW         MAKEINTRESOURCE(32516)
  7173. #define IDC_SIZE            MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
  7174. #define IDC_ICON            MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
  7175. #define IDC_SIZENWSE        MAKEINTRESOURCE(32642)
  7176. #define IDC_SIZENESW        MAKEINTRESOURCE(32643)
  7177. #define IDC_SIZEWE          MAKEINTRESOURCE(32644)
  7178. #define IDC_SIZENS          MAKEINTRESOURCE(32645)
  7179. #define IDC_SIZEALL         MAKEINTRESOURCE(32646)
  7180. #define IDC_NO              MAKEINTRESOURCE(32648) /* not in win3.1 */
  7181. #if(WINVER >= 0x0500)
  7182. #define IDC_HAND            MAKEINTRESOURCE(32649)
  7183. #endif /* WINVER >= 0x0500 */
  7184. #define IDC_APPSTARTING     MAKEINTRESOURCE(32650) /* not in win3.1 */
  7185. #if(WINVER >= 0x0400)
  7186. #define IDC_HELP            MAKEINTRESOURCE(32651)
  7187. #endif /* WINVER >= 0x0400 */
  7188.  
  7189. WINUSERAPI
  7190. BOOL
  7191. WINAPI
  7192. SetSystemCursor(
  7193.     HCURSOR hcur,
  7194.     DWORD   id);
  7195.  
  7196. typedef struct _ICONINFO {
  7197.     BOOL    fIcon;
  7198.     DWORD   xHotspot;
  7199.     DWORD   yHotspot;
  7200.     HBITMAP hbmMask;
  7201.     HBITMAP hbmColor;
  7202. } ICONINFO;
  7203. typedef ICONINFO *PICONINFO;
  7204.  
  7205. WINUSERAPI
  7206. HICON
  7207. WINAPI
  7208. LoadIconA(
  7209.     HINSTANCE hInstance,
  7210.     LPCSTR lpIconName);
  7211. WINUSERAPI
  7212. HICON
  7213. WINAPI
  7214. LoadIconW(
  7215.     HINSTANCE hInstance,
  7216.     LPCWSTR lpIconName);
  7217. #ifdef UNICODE
  7218. #define LoadIcon  LoadIconW
  7219. #else
  7220. #define LoadIcon  LoadIconA
  7221. #endif // !UNICODE
  7222.  
  7223.  
  7224. WINUSERAPI
  7225. HICON
  7226. WINAPI
  7227. CreateIcon(
  7228.     HINSTANCE hInstance,
  7229.     int nWidth,
  7230.     int nHeight,
  7231.     BYTE cPlanes,
  7232.     BYTE cBitsPixel,
  7233.     CONST BYTE *lpbANDbits,
  7234.     CONST BYTE *lpbXORbits);
  7235.  
  7236. WINUSERAPI
  7237. BOOL
  7238. WINAPI
  7239. DestroyIcon(
  7240.     HICON hIcon);
  7241.  
  7242. WINUSERAPI
  7243. int
  7244. WINAPI
  7245. LookupIconIdFromDirectory(
  7246.     PBYTE presbits,
  7247.     BOOL fIcon);
  7248.  
  7249. #if(WINVER >= 0x0400)
  7250. WINUSERAPI
  7251. int
  7252. WINAPI
  7253. LookupIconIdFromDirectoryEx(
  7254.     PBYTE presbits,
  7255.     BOOL  fIcon,
  7256.     int   cxDesired,
  7257.     int   cyDesired,
  7258.     UINT  Flags);
  7259. #endif /* WINVER >= 0x0400 */
  7260.  
  7261. WINUSERAPI
  7262. HICON
  7263. WINAPI
  7264. CreateIconFromResource(
  7265.     PBYTE presbits,
  7266.     DWORD dwResSize,
  7267.     BOOL fIcon,
  7268.     DWORD dwVer);
  7269.  
  7270. #if(WINVER >= 0x0400)
  7271. WINUSERAPI
  7272. HICON
  7273. WINAPI
  7274. CreateIconFromResourceEx(
  7275.     PBYTE presbits,
  7276.     DWORD dwResSize,
  7277.     BOOL  fIcon,
  7278.     DWORD dwVer,
  7279.     int   cxDesired,
  7280.     int   cyDesired,
  7281.     UINT  Flags);
  7282.  
  7283. /* Icon/Cursor header */
  7284. typedef struct tagCURSORSHAPE
  7285. {
  7286.     int     xHotSpot;
  7287.     int     yHotSpot;
  7288.     int     cx;
  7289.     int     cy;
  7290.     int     cbWidth;
  7291.     BYTE    Planes;
  7292.     BYTE    BitsPixel;
  7293. } CURSORSHAPE, FAR *LPCURSORSHAPE;
  7294. #endif /* WINVER >= 0x0400 */
  7295.  
  7296. #define IMAGE_BITMAP        0
  7297. #define IMAGE_ICON          1
  7298. #define IMAGE_CURSOR        2
  7299. #if(WINVER >= 0x0400)
  7300. #define IMAGE_ENHMETAFILE   3
  7301.  
  7302. #define LR_DEFAULTCOLOR     0x0000
  7303. #define LR_MONOCHROME       0x0001
  7304. #define LR_COLOR            0x0002
  7305. #define LR_COPYRETURNORG    0x0004
  7306. #define LR_COPYDELETEORG    0x0008
  7307. #define LR_LOADFROMFILE     0x0010
  7308. #define LR_LOADTRANSPARENT  0x0020
  7309. #define LR_DEFAULTSIZE      0x0040
  7310. #define LR_VGACOLOR         0x0080
  7311. #define LR_LOADMAP3DCOLORS  0x1000
  7312. #define LR_CREATEDIBSECTION 0x2000
  7313. #define LR_COPYFROMRESOURCE 0x4000
  7314. #define LR_SHARED           0x8000
  7315.  
  7316. WINUSERAPI
  7317. HANDLE
  7318. WINAPI
  7319. LoadImageA(
  7320.     HINSTANCE,
  7321.     LPCSTR,
  7322.     UINT,
  7323.     int,
  7324.     int,
  7325.     UINT);
  7326. WINUSERAPI
  7327. HANDLE
  7328. WINAPI
  7329. LoadImageW(
  7330.     HINSTANCE,
  7331.     LPCWSTR,
  7332.     UINT,
  7333.     int,
  7334.     int,
  7335.     UINT);
  7336. #ifdef UNICODE
  7337. #define LoadImage  LoadImageW
  7338. #else
  7339. #define LoadImage  LoadImageA
  7340. #endif // !UNICODE
  7341.  
  7342. WINUSERAPI
  7343. HANDLE
  7344. WINAPI
  7345. CopyImage(
  7346.     HANDLE,
  7347.     UINT,
  7348.     int,
  7349.     int,
  7350.     UINT);
  7351.  
  7352. #define DI_MASK         0x0001
  7353. #define DI_IMAGE        0x0002
  7354. #define DI_NORMAL       0x0003
  7355. #define DI_COMPAT       0x0004
  7356. #define DI_DEFAULTSIZE  0x0008
  7357.  
  7358. WINUSERAPI BOOL WINAPI DrawIconEx(HDC hdc, int xLeft, int yTop,
  7359.               HICON hIcon, int cxWidth, int cyWidth,
  7360.               UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
  7361. #endif /* WINVER >= 0x0400 */
  7362.  
  7363. WINUSERAPI
  7364. HICON
  7365. WINAPI
  7366. CreateIconIndirect(
  7367.     PICONINFO piconinfo);
  7368.  
  7369. WINUSERAPI
  7370. HICON
  7371. WINAPI
  7372. CopyIcon(
  7373.     HICON hIcon);
  7374.  
  7375. WINUSERAPI
  7376. BOOL
  7377. WINAPI
  7378. GetIconInfo(
  7379.     HICON hIcon,
  7380.     PICONINFO piconinfo);
  7381.  
  7382. #if(WINVER >= 0x0400)
  7383. #define RES_ICON    1
  7384. #define RES_CURSOR  2
  7385. #endif /* WINVER >= 0x0400 */
  7386.  
  7387. #ifdef OEMRESOURCE
  7388.  
  7389. // begin_r_winuser
  7390.  
  7391. /*
  7392.  * OEM Resource Ordinal Numbers
  7393.  */
  7394. #define OBM_CLOSE           32754
  7395. #define OBM_UPARROW         32753
  7396. #define OBM_DNARROW         32752
  7397. #define OBM_RGARROW         32751
  7398. #define OBM_LFARROW         32750
  7399. #define OBM_REDUCE          32749
  7400. #define OBM_ZOOM            32748
  7401. #define OBM_RESTORE         32747
  7402. #define OBM_REDUCED         32746
  7403. #define OBM_ZOOMD           32745
  7404. #define OBM_RESTORED        32744
  7405. #define OBM_UPARROWD        32743
  7406. #define OBM_DNARROWD        32742
  7407. #define OBM_RGARROWD        32741
  7408. #define OBM_LFARROWD        32740
  7409. #define OBM_MNARROW         32739
  7410. #define OBM_COMBO           32738
  7411. #define OBM_UPARROWI        32737
  7412. #define OBM_DNARROWI        32736
  7413. #define OBM_RGARROWI        32735
  7414. #define OBM_LFARROWI        32734
  7415.  
  7416. #define OBM_OLD_CLOSE       32767
  7417. #define OBM_SIZE            32766
  7418. #define OBM_OLD_UPARROW     32765
  7419. #define OBM_OLD_DNARROW     32764
  7420. #define OBM_OLD_RGARROW     32763
  7421. #define OBM_OLD_LFARROW     32762
  7422. #define OBM_BTSIZE          32761
  7423. #define OBM_CHECK           32760
  7424. #define OBM_CHECKBOXES      32759
  7425. #define OBM_BTNCORNERS      32758
  7426. #define OBM_OLD_REDUCE      32757
  7427. #define OBM_OLD_ZOOM        32756
  7428. #define OBM_OLD_RESTORE     32755
  7429.  
  7430.  
  7431. #define OCR_NORMAL          32512
  7432. #define OCR_IBEAM           32513
  7433. #define OCR_WAIT            32514
  7434. #define OCR_CROSS           32515
  7435. #define OCR_UP              32516
  7436. #define OCR_SIZE            32640   /* OBSOLETE: use OCR_SIZEALL */
  7437. #define OCR_ICON            32641   /* OBSOLETE: use OCR_NORMAL */
  7438. #define OCR_SIZENWSE        32642
  7439. #define OCR_SIZENESW        32643
  7440. #define OCR_SIZEWE          32644
  7441. #define OCR_SIZENS          32645
  7442. #define OCR_SIZEALL         32646
  7443. #define OCR_ICOCUR          32647   /* OBSOLETE: use OIC_WINLOGO */
  7444. #define OCR_NO              32648
  7445. #if(WINVER >= 0x0500)
  7446. #define OCR_HAND            32649
  7447. #endif /* WINVER >= 0x0500 */
  7448. #if(WINVER >= 0x0400)
  7449. #define OCR_APPSTARTING     32650
  7450. #endif /* WINVER >= 0x0400 */
  7451.  
  7452. #define OIC_SAMPLE          32512
  7453. #define OIC_HAND            32513
  7454. #define OIC_QUES            32514
  7455. #define OIC_BANG            32515
  7456. #define OIC_NOTE            32516
  7457. #if(WINVER >= 0x0400)
  7458. #define OIC_WINLOGO         32517
  7459. #define OIC_WARNING         OIC_BANG
  7460. #define OIC_ERROR           OIC_HAND
  7461. #define OIC_INFORMATION     OIC_NOTE
  7462. #endif /* WINVER >= 0x0400 */
  7463.  
  7464.  
  7465. // end_r_winuser
  7466.  
  7467. #endif /* OEMRESOURCE */
  7468.  
  7469. #define ORD_LANGDRIVER    1     /* The ordinal number for the entry point of
  7470.                                 ** language drivers.
  7471.                                 */
  7472.  
  7473. #ifndef NOICONS
  7474.  
  7475. // begin_r_winuser
  7476. /*
  7477.  * Standard Icon IDs
  7478.  */
  7479. #ifdef RC_INVOKED
  7480. #define IDI_APPLICATION     32512
  7481. #define IDI_HAND            32513
  7482. #define IDI_QUESTION        32514
  7483. #define IDI_EXCLAMATION     32515
  7484. #define IDI_ASTERISK        32516
  7485. #if(WINVER >= 0x0400)
  7486. #define IDI_WINLOGO         32517
  7487. #endif /* WINVER >= 0x0400 */
  7488. #else
  7489. #define IDI_APPLICATION     MAKEINTRESOURCE(32512)
  7490. #define IDI_HAND            MAKEINTRESOURCE(32513)
  7491. #define IDI_QUESTION        MAKEINTRESOURCE(32514)
  7492. #define IDI_EXCLAMATION     MAKEINTRESOURCE(32515)
  7493. #define IDI_ASTERISK        MAKEINTRESOURCE(32516)
  7494. #if(WINVER >= 0x0400)
  7495. #define IDI_WINLOGO         MAKEINTRESOURCE(32517)
  7496. #endif /* WINVER >= 0x0400 */
  7497. #endif /* RC_INVOKED */
  7498.  
  7499. #if(WINVER >= 0x0400)
  7500. #define IDI_WARNING     IDI_EXCLAMATION
  7501. #define IDI_ERROR       IDI_HAND
  7502. #define IDI_INFORMATION IDI_ASTERISK
  7503. #endif /* WINVER >= 0x0400 */
  7504.  
  7505. // end_r_winuser
  7506.  
  7507. #endif /* !NOICONS */
  7508.  
  7509. WINUSERAPI
  7510. int
  7511. WINAPI
  7512. LoadStringA(
  7513.     HINSTANCE hInstance,
  7514.     UINT uID,
  7515.     LPSTR lpBuffer,
  7516.     int nBufferMax);
  7517. WINUSERAPI
  7518. int
  7519. WINAPI
  7520. LoadStringW(
  7521.     HINSTANCE hInstance,
  7522.     UINT uID,
  7523.     LPWSTR lpBuffer,
  7524.     int nBufferMax);
  7525. #ifdef UNICODE
  7526. #define LoadString  LoadStringW
  7527. #else
  7528. #define LoadString  LoadStringA
  7529. #endif // !UNICODE
  7530.  
  7531. // begin_r_winuser
  7532.  
  7533. /*
  7534.  * Dialog Box Command IDs
  7535.  */
  7536. #define IDOK                1
  7537. #define IDCANCEL            2
  7538. #define IDABORT             3
  7539. #define IDRETRY             4
  7540. #define IDIGNORE            5
  7541. #define IDYES               6
  7542. #define IDNO                7
  7543. #if(WINVER >= 0x0400)
  7544. #define IDCLOSE         8
  7545. #define IDHELP          9
  7546. #endif /* WINVER >= 0x0400 */
  7547.  
  7548. // end_r_winuser
  7549.  
  7550. #ifndef NOCTLMGR
  7551.  
  7552. /*
  7553.  * Control Manager Structures and Definitions
  7554.  */
  7555.  
  7556. #ifndef NOWINSTYLES
  7557.  
  7558. // begin_r_winuser
  7559.  
  7560. /*
  7561.  * Edit Control Styles
  7562.  */
  7563. #define ES_LEFT             0x0000L
  7564. #define ES_CENTER           0x0001L
  7565. #define ES_RIGHT            0x0002L
  7566. #define ES_MULTILINE        0x0004L
  7567. #define ES_UPPERCASE        0x0008L
  7568. #define ES_LOWERCASE        0x0010L
  7569. #define ES_PASSWORD         0x0020L
  7570. #define ES_AUTOVSCROLL      0x0040L
  7571. #define ES_AUTOHSCROLL      0x0080L
  7572. #define ES_NOHIDESEL        0x0100L
  7573. #define ES_OEMCONVERT       0x0400L
  7574. #define ES_READONLY         0x0800L
  7575. #define ES_WANTRETURN       0x1000L
  7576. #if(WINVER >= 0x0400)
  7577. #define ES_NUMBER           0x2000L
  7578. #endif /* WINVER >= 0x0400 */
  7579.  
  7580. // end_r_winuser
  7581.  
  7582. #endif /* !NOWINSTYLES */
  7583.  
  7584. /*
  7585.  * Edit Control Notification Codes
  7586.  */
  7587. #define EN_SETFOCUS         0x0100
  7588. #define EN_KILLFOCUS        0x0200
  7589. #define EN_CHANGE           0x0300
  7590. #define EN_UPDATE           0x0400
  7591. #define EN_ERRSPACE         0x0500
  7592. #define EN_MAXTEXT          0x0501
  7593. #define EN_HSCROLL          0x0601
  7594. #define EN_VSCROLL          0x0602
  7595.  
  7596. #if(WINVER >= 0x0400)
  7597. /* Edit control EM_SETMARGIN parameters */
  7598. #define EC_LEFTMARGIN       0x0001
  7599. #define EC_RIGHTMARGIN      0x0002
  7600. #define EC_USEFONTINFO      0xffff
  7601. #endif /* WINVER >= 0x0400 */
  7602.  
  7603. #if(WINVER >= 0x0500)
  7604. /* wParam of EM_GET/SETIMESTATUS  */
  7605. #define EMSIS_COMPOSITIONSTRING        0x0001
  7606.  
  7607. /* lParam for EMSIS_COMPOSITIONSTRING  */
  7608. #define EIMES_GETCOMPSTRATONCE         0x0001
  7609. #define EIMES_CANCELCOMPSTRINFOCUS     0x0002
  7610. #define EIMES_COMPLETECOMPSTRKILLFOCUS 0x0004
  7611. #endif /* WINVER >= 0x0500 */
  7612.  
  7613. #ifndef NOWINMESSAGES
  7614.  
  7615. // begin_r_winuser
  7616.  
  7617. /*
  7618.  * Edit Control Messages
  7619.  */
  7620. #define EM_GETSEL               0x00B0
  7621. #define EM_SETSEL               0x00B1
  7622. #define EM_GETRECT              0x00B2
  7623. #define EM_SETRECT              0x00B3
  7624. #define EM_SETRECTNP            0x00B4
  7625. #define EM_SCROLL               0x00B5
  7626. #define EM_LINESCROLL           0x00B6
  7627. #define EM_SCROLLCARET          0x00B7
  7628. #define EM_GETMODIFY            0x00B8
  7629. #define EM_SETMODIFY            0x00B9
  7630. #define EM_GETLINECOUNT         0x00BA
  7631. #define EM_LINEINDEX            0x00BB
  7632. #define EM_SETHANDLE            0x00BC
  7633. #define EM_GETHANDLE            0x00BD
  7634. #define EM_GETTHUMB             0x00BE
  7635. #define EM_LINELENGTH           0x00C1
  7636. #define EM_REPLACESEL           0x00C2
  7637. #define EM_GETLINE              0x00C4
  7638. #define EM_LIMITTEXT            0x00C5
  7639. #define EM_CANUNDO              0x00C6
  7640. #define EM_UNDO                 0x00C7
  7641. #define EM_FMTLINES             0x00C8
  7642. #define EM_LINEFROMCHAR         0x00C9
  7643. #define EM_SETTABSTOPS          0x00CB
  7644. #define EM_SETPASSWORDCHAR      0x00CC
  7645. #define EM_EMPTYUNDOBUFFER      0x00CD
  7646. #define EM_GETFIRSTVISIBLELINE  0x00CE
  7647. #define EM_SETREADONLY          0x00CF
  7648. #define EM_SETWORDBREAKPROC     0x00D0
  7649. #define EM_GETWORDBREAKPROC     0x00D1
  7650. #define EM_GETPASSWORDCHAR      0x00D2
  7651. #if(WINVER >= 0x0400)
  7652. #define EM_SETMARGINS           0x00D3
  7653. #define EM_GETMARGINS           0x00D4
  7654. #define EM_SETLIMITTEXT         EM_LIMITTEXT   /* ;win40 Name change */
  7655. #define EM_GETLIMITTEXT         0x00D5
  7656. #define EM_POSFROMCHAR          0x00D6
  7657. #define EM_CHARFROMPOS          0x00D7
  7658. #endif /* WINVER >= 0x0400 */
  7659.  
  7660. #if(WINVER >= 0x0500)
  7661. #define EM_SETIMESTATUS         0x00D8
  7662. #define EM_GETIMESTATUS         0x00D9
  7663. #endif /* WINVER >= 0x0500 */
  7664.  
  7665.  
  7666. // end_r_winuser
  7667. #endif /* !NOWINMESSAGES */
  7668.  
  7669. /*
  7670.  * EDITWORDBREAKPROC code values
  7671.  */
  7672. #define WB_LEFT            0
  7673. #define WB_RIGHT           1
  7674. #define WB_ISDELIMITER     2
  7675.  
  7676. // begin_r_winuser
  7677.  
  7678. /*
  7679.  * Button Control Styles
  7680.  */
  7681. #define BS_PUSHBUTTON       0x00000000L
  7682. #define BS_DEFPUSHBUTTON    0x00000001L
  7683. #define BS_CHECKBOX         0x00000002L
  7684. #define BS_AUTOCHECKBOX     0x00000003L
  7685. #define BS_RADIOBUTTON      0x00000004L
  7686. #define BS_3STATE           0x00000005L
  7687. #define BS_AUTO3STATE       0x00000006L
  7688. #define BS_GROUPBOX         0x00000007L
  7689. #define BS_USERBUTTON       0x00000008L
  7690. #define BS_AUTORADIOBUTTON  0x00000009L
  7691. #define BS_OWNERDRAW        0x0000000BL
  7692. #define BS_LEFTTEXT         0x00000020L
  7693. #if(WINVER >= 0x0400)
  7694. #define BS_TEXT             0x00000000L
  7695. #define BS_ICON             0x00000040L
  7696. #define BS_BITMAP           0x00000080L
  7697. #define BS_LEFT             0x00000100L
  7698. #define BS_RIGHT            0x00000200L
  7699. #define BS_CENTER           0x00000300L
  7700. #define BS_TOP              0x00000400L
  7701. #define BS_BOTTOM           0x00000800L
  7702. #define BS_VCENTER          0x00000C00L
  7703. #define BS_PUSHLIKE         0x00001000L
  7704. #define BS_MULTILINE        0x00002000L
  7705. #define BS_NOTIFY           0x00004000L
  7706. #define BS_FLAT             0x00008000L
  7707. #define BS_RIGHTBUTTON      BS_LEFTTEXT
  7708. #endif /* WINVER >= 0x0400 */
  7709.  
  7710. /*
  7711.  * User Button Notification Codes
  7712.  */
  7713. #define BN_CLICKED          0
  7714. #define BN_PAINT            1
  7715. #define BN_HILITE           2
  7716. #define BN_UNHILITE         3
  7717. #define BN_DISABLE          4
  7718. #define BN_DOUBLECLICKED    5
  7719. #if(WINVER >= 0x0400)
  7720. #define BN_PUSHED           BN_HILITE
  7721. #define BN_UNPUSHED         BN_UNHILITE
  7722. #define BN_DBLCLK           BN_DOUBLECLICKED
  7723. #define BN_SETFOCUS         6
  7724. #define BN_KILLFOCUS        7
  7725. #endif /* WINVER >= 0x0400 */
  7726.  
  7727. /*
  7728.  * Button Control Messages
  7729.  */
  7730. #define BM_GETCHECK        0x00F0
  7731. #define BM_SETCHECK        0x00F1
  7732. #define BM_GETSTATE        0x00F2
  7733. #define BM_SETSTATE        0x00F3
  7734. #define BM_SETSTYLE        0x00F4
  7735. #if(WINVER >= 0x0400)
  7736. #define BM_CLICK           0x00F5
  7737. #define BM_GETIMAGE        0x00F6
  7738. #define BM_SETIMAGE        0x00F7
  7739.  
  7740. #define BST_UNCHECKED      0x0000
  7741. #define BST_CHECKED        0x0001
  7742. #define BST_INDETERMINATE  0x0002
  7743. #define BST_PUSHED         0x0004
  7744. #define BST_FOCUS          0x0008
  7745. #endif /* WINVER >= 0x0400 */
  7746.  
  7747. /*
  7748.  * Static Control Constants
  7749.  */
  7750. #define SS_LEFT             0x00000000L
  7751. #define SS_CENTER           0x00000001L
  7752. #define SS_RIGHT            0x00000002L
  7753. #define SS_ICON             0x00000003L
  7754. #define SS_BLACKRECT        0x00000004L
  7755. #define SS_GRAYRECT         0x00000005L
  7756. #define SS_WHITERECT        0x00000006L
  7757. #define SS_BLACKFRAME       0x00000007L
  7758. #define SS_GRAYFRAME        0x00000008L
  7759. #define SS_WHITEFRAME       0x00000009L
  7760. #define SS_USERITEM         0x0000000AL
  7761. #define SS_SIMPLE           0x0000000BL
  7762. #define SS_LEFTNOWORDWRAP   0x0000000CL
  7763. #if(WINVER >= 0x0400)
  7764. #define SS_OWNERDRAW        0x0000000DL
  7765. #define SS_BITMAP           0x0000000EL
  7766. #define SS_ENHMETAFILE      0x0000000FL
  7767. #define SS_ETCHEDHORZ       0x00000010L
  7768. #define SS_ETCHEDVERT       0x00000011L
  7769. #define SS_ETCHEDFRAME      0x00000012L
  7770. #define SS_TYPEMASK         0x0000001FL
  7771. #endif /* WINVER >= 0x0400 */
  7772. #define SS_NOPREFIX         0x00000080L /* Don't do "&" character translation */
  7773. #if(WINVER >= 0x0400)
  7774. #define SS_NOTIFY           0x00000100L
  7775. #define SS_CENTERIMAGE      0x00000200L
  7776. #define SS_RIGHTJUST        0x00000400L
  7777. #define SS_REALSIZEIMAGE    0x00000800L
  7778. #define SS_SUNKEN           0x00001000L
  7779. #define SS_ENDELLIPSIS      0x00004000L
  7780. #define SS_PATHELLIPSIS     0x00008000L
  7781. #define SS_WORDELLIPSIS     0x0000C000L
  7782. #define SS_ELLIPSISMASK     0x0000C000L
  7783. #endif /* WINVER >= 0x0400 */
  7784.  
  7785. // end_r_winuser
  7786.  
  7787. #ifndef NOWINMESSAGES
  7788. /*
  7789.  * Static Control Mesages
  7790.  */
  7791. #define STM_SETICON         0x0170
  7792. #define STM_GETICON         0x0171
  7793. #if(WINVER >= 0x0400)
  7794. #define STM_SETIMAGE        0x0172
  7795. #define STM_GETIMAGE        0x0173
  7796. #define STN_CLICKED         0
  7797. #define STN_DBLCLK          1
  7798. #define STN_ENABLE          2
  7799. #define STN_DISABLE         3
  7800. #endif /* WINVER >= 0x0400 */
  7801. #define STM_MSGMAX          0x0174
  7802. #endif /* !NOWINMESSAGES */
  7803.  
  7804. /*
  7805.  * Dialog window class
  7806.  */
  7807. #define WC_DIALOG       (MAKEINTATOM(0x8002))
  7808.  
  7809. /*
  7810.  * Get/SetWindowWord/Long offsets for use with WC_DIALOG windows
  7811.  */
  7812. #define DWL_MSGRESULT   0
  7813. #define DWL_DLGPROC     4
  7814. #define DWL_USER        8
  7815.  
  7816. /*
  7817.  * Dialog Manager Routines
  7818.  */
  7819.  
  7820. #ifndef NOMSG
  7821.  
  7822. WINUSERAPI
  7823. BOOL
  7824. WINAPI
  7825. IsDialogMessageA(
  7826.     HWND hDlg,
  7827.     LPMSG lpMsg);
  7828. WINUSERAPI
  7829. BOOL
  7830. WINAPI
  7831. IsDialogMessageW(
  7832.     HWND hDlg,
  7833.     LPMSG lpMsg);
  7834. #ifdef UNICODE
  7835. #define IsDialogMessage  IsDialogMessageW
  7836. #else
  7837. #define IsDialogMessage  IsDialogMessageA
  7838. #endif // !UNICODE
  7839.  
  7840. #endif /* !NOMSG */
  7841.  
  7842. WINUSERAPI
  7843. BOOL
  7844. WINAPI
  7845. MapDialogRect(
  7846.     HWND hDlg,
  7847.     LPRECT lpRect);
  7848.  
  7849. WINUSERAPI
  7850. int
  7851. WINAPI
  7852. DlgDirListA(
  7853.     HWND hDlg,
  7854.     LPSTR lpPathSpec,
  7855.     int nIDListBox,
  7856.     int nIDStaticPath,
  7857.     UINT uFileType);
  7858. WINUSERAPI
  7859. int
  7860. WINAPI
  7861. DlgDirListW(
  7862.     HWND hDlg,
  7863.     LPWSTR lpPathSpec,
  7864.     int nIDListBox,
  7865.     int nIDStaticPath,
  7866.     UINT uFileType);
  7867. #ifdef UNICODE
  7868. #define DlgDirList  DlgDirListW
  7869. #else
  7870. #define DlgDirList  DlgDirListA
  7871. #endif // !UNICODE
  7872.  
  7873. /*
  7874.  * DlgDirList, DlgDirListComboBox flags values
  7875.  */
  7876. #define DDL_READWRITE       0x0000
  7877. #define DDL_READONLY        0x0001
  7878. #define DDL_HIDDEN          0x0002
  7879. #define DDL_SYSTEM          0x0004
  7880. #define DDL_DIRECTORY       0x0010
  7881. #define DDL_ARCHIVE         0x0020
  7882.  
  7883. #define DDL_POSTMSGS        0x2000
  7884. #define DDL_DRIVES          0x4000
  7885. #define DDL_EXCLUSIVE       0x8000
  7886.  
  7887. WINUSERAPI
  7888. BOOL
  7889. WINAPI
  7890. DlgDirSelectExA(
  7891.     HWND hDlg,
  7892.     LPSTR lpString,
  7893.     int nCount,
  7894.     int nIDListBox);
  7895. WINUSERAPI
  7896. BOOL
  7897. WINAPI
  7898. DlgDirSelectExW(
  7899.     HWND hDlg,
  7900.     LPWSTR lpString,
  7901.     int nCount,
  7902.     int nIDListBox);
  7903. #ifdef UNICODE
  7904. #define DlgDirSelectEx  DlgDirSelectExW
  7905. #else
  7906. #define DlgDirSelectEx  DlgDirSelectExA
  7907. #endif // !UNICODE
  7908.  
  7909. WINUSERAPI
  7910. int
  7911. WINAPI
  7912. DlgDirListComboBoxA(
  7913.     HWND hDlg,
  7914.     LPSTR lpPathSpec,
  7915.     int nIDComboBox,
  7916.     int nIDStaticPath,
  7917.     UINT uFiletype);
  7918. WINUSERAPI
  7919. int
  7920. WINAPI
  7921. DlgDirListComboBoxW(
  7922.     HWND hDlg,
  7923.     LPWSTR lpPathSpec,
  7924.     int nIDComboBox,
  7925.     int nIDStaticPath,
  7926.     UINT uFiletype);
  7927. #ifdef UNICODE
  7928. #define DlgDirListComboBox  DlgDirListComboBoxW
  7929. #else
  7930. #define DlgDirListComboBox  DlgDirListComboBoxA
  7931. #endif // !UNICODE
  7932.  
  7933. WINUSERAPI
  7934. BOOL
  7935. WINAPI
  7936. DlgDirSelectComboBoxExA(
  7937.     HWND hDlg,
  7938.     LPSTR lpString,
  7939.     int nCount,
  7940.     int nIDComboBox);
  7941. WINUSERAPI
  7942. BOOL
  7943. WINAPI
  7944. DlgDirSelectComboBoxExW(
  7945.     HWND hDlg,
  7946.     LPWSTR lpString,
  7947.     int nCount,
  7948.     int nIDComboBox);
  7949. #ifdef UNICODE
  7950. #define DlgDirSelectComboBoxEx  DlgDirSelectComboBoxExW
  7951. #else
  7952. #define DlgDirSelectComboBoxEx  DlgDirSelectComboBoxExA
  7953. #endif // !UNICODE
  7954.  
  7955.  
  7956. // begin_r_winuser
  7957.  
  7958. /*
  7959.  * Dialog Styles
  7960.  */
  7961. #define DS_ABSALIGN         0x01L
  7962. #define DS_SYSMODAL         0x02L
  7963. #define DS_LOCALEDIT        0x20L   /* Edit items get Local storage. */
  7964. #define DS_SETFONT          0x40L   /* User specified font for Dlg controls */
  7965. #define DS_MODALFRAME       0x80L   /* Can be combined with WS_CAPTION  */
  7966. #define DS_NOIDLEMSG        0x100L  /* WM_ENTERIDLE message will not be sent */
  7967. #define DS_SETFOREGROUND    0x200L  /* not in win3.1 */
  7968.  
  7969.  
  7970. #if(WINVER >= 0x0400)
  7971. #define DS_3DLOOK           0x0004L
  7972. #define DS_FIXEDSYS         0x0008L
  7973. #define DS_NOFAILCREATE     0x0010L
  7974. #define DS_CONTROL          0x0400L
  7975. #define DS_CENTER           0x0800L
  7976. #define DS_CENTERMOUSE      0x1000L
  7977. #define DS_CONTEXTHELP      0x2000L
  7978.  
  7979. #endif /* WINVER >= 0x0400 */
  7980.  
  7981. // end_r_winuser
  7982.  
  7983. #define DM_GETDEFID         (WM_USER+0)
  7984. #define DM_SETDEFID         (WM_USER+1)
  7985.  
  7986. #if(WINVER >= 0x0400)
  7987. #define DM_REPOSITION       (WM_USER+2)
  7988. #endif /* WINVER >= 0x0400 */
  7989. /*
  7990.  * Returned in HIWORD() of DM_GETDEFID result if msg is supported
  7991.  */
  7992. #define DC_HASDEFID         0x534B
  7993.  
  7994. /*
  7995.  * Dialog Codes
  7996.  */
  7997. #define DLGC_WANTARROWS     0x0001      /* Control wants arrow keys         */
  7998. #define DLGC_WANTTAB        0x0002      /* Control wants tab keys           */
  7999. #define DLGC_WANTALLKEYS    0x0004      /* Control wants all keys           */
  8000. #define DLGC_WANTMESSAGE    0x0004      /* Pass message to control          */
  8001. #define DLGC_HASSETSEL      0x0008      /* Understands EM_SETSEL message    */
  8002. #define DLGC_DEFPUSHBUTTON  0x0010      /* Default pushbutton               */
  8003. #define DLGC_UNDEFPUSHBUTTON 0x0020     /* Non-default pushbutton           */
  8004. #define DLGC_RADIOBUTTON    0x0040      /* Radio button                     */
  8005. #define DLGC_WANTCHARS      0x0080      /* Want WM_CHAR messages            */
  8006. #define DLGC_STATIC         0x0100      /* Static item: don't include       */
  8007. #define DLGC_BUTTON         0x2000      /* Button item: can be checked      */
  8008.  
  8009. #define LB_CTLCODE          0L
  8010.  
  8011. /*
  8012.  * Listbox Return Values
  8013.  */
  8014. #define LB_OKAY             0
  8015. #define LB_ERR              (-1)
  8016. #define LB_ERRSPACE         (-2)
  8017.  
  8018. /*
  8019. **  The idStaticPath parameter to DlgDirList can have the following values
  8020. **  ORed if the list box should show other details of the files along with
  8021. **  the name of the files;
  8022. */
  8023.                                   /* all other details also will be returned */
  8024.  
  8025.  
  8026. /*
  8027.  * Listbox Notification Codes
  8028.  */
  8029. #define LBN_ERRSPACE        (-2)
  8030. #define LBN_SELCHANGE       1
  8031. #define LBN_DBLCLK          2
  8032. #define LBN_SELCANCEL       3
  8033. #define LBN_SETFOCUS        4
  8034. #define LBN_KILLFOCUS       5
  8035.  
  8036.  
  8037.  
  8038. #ifndef NOWINMESSAGES
  8039.  
  8040. /*
  8041.  * Listbox messages
  8042.  */
  8043. #define LB_ADDSTRING            0x0180
  8044. #define LB_INSERTSTRING         0x0181
  8045. #define LB_DELETESTRING         0x0182
  8046. #define LB_SELITEMRANGEEX       0x0183
  8047. #define LB_RESETCONTENT         0x0184
  8048. #define LB_SETSEL               0x0185
  8049. #define LB_SETCURSEL            0x0186
  8050. #define LB_GETSEL               0x0187
  8051. #define LB_GETCURSEL            0x0188
  8052. #define LB_GETTEXT              0x0189
  8053. #define LB_GETTEXTLEN           0x018A
  8054. #define LB_GETCOUNT             0x018B
  8055. #define LB_SELECTSTRING         0x018C
  8056. #define LB_DIR                  0x018D
  8057. #define LB_GETTOPINDEX          0x018E
  8058. #define LB_FINDSTRING           0x018F
  8059. #define LB_GETSELCOUNT          0x0190
  8060. #define LB_GETSELITEMS          0x0191
  8061. #define LB_SETTABSTOPS          0x0192
  8062. #define LB_GETHORIZONTALEXTENT  0x0193
  8063. #define LB_SETHORIZONTALEXTENT  0x0194
  8064. #define LB_SETCOLUMNWIDTH       0x0195
  8065. #define LB_ADDFILE              0x0196
  8066. #define LB_SETTOPINDEX          0x0197
  8067. #define LB_GETITEMRECT          0x0198
  8068. #define LB_GETITEMDATA          0x0199
  8069. #define LB_SETITEMDATA          0x019A
  8070. #define LB_SELITEMRANGE         0x019B
  8071. #define LB_SETANCHORINDEX       0x019C
  8072. #define LB_GETANCHORINDEX       0x019D
  8073. #define LB_SETCARETINDEX        0x019E
  8074. #define LB_GETCARETINDEX        0x019F
  8075. #define LB_SETITEMHEIGHT        0x01A0
  8076. #define LB_GETITEMHEIGHT        0x01A1
  8077. #define LB_FINDSTRINGEXACT      0x01A2
  8078. #define LB_SETLOCALE            0x01A5
  8079. #define LB_GETLOCALE            0x01A6
  8080. #define LB_SETCOUNT             0x01A7
  8081. #if(WINVER >= 0x0400)
  8082. #define LB_INITSTORAGE          0x01A8
  8083. #define LB_ITEMFROMPOINT        0x01A9
  8084. #endif /* WINVER >= 0x0400 */
  8085. #if(WINVER >= 0x0400)
  8086. #define LB_MSGMAX               0x01B0
  8087. #else
  8088. #define LB_MSGMAX               0x01A8
  8089. #endif
  8090.  
  8091. #endif /* !NOWINMESSAGES */
  8092.  
  8093. #ifndef NOWINSTYLES
  8094.  
  8095. // begin_r_winuser
  8096.  
  8097. /*
  8098.  * Listbox Styles
  8099.  */
  8100. #define LBS_NOTIFY            0x0001L
  8101. #define LBS_SORT              0x0002L
  8102. #define LBS_NOREDRAW          0x0004L
  8103. #define LBS_MULTIPLESEL       0x0008L
  8104. #define LBS_OWNERDRAWFIXED    0x0010L
  8105. #define LBS_OWNERDRAWVARIABLE 0x0020L
  8106. #define LBS_HASSTRINGS        0x0040L
  8107. #define LBS_USETABSTOPS       0x0080L
  8108. #define LBS_NOINTEGRALHEIGHT  0x0100L
  8109. #define LBS_MULTICOLUMN       0x0200L
  8110. #define LBS_WANTKEYBOARDINPUT 0x0400L
  8111. #define LBS_EXTENDEDSEL       0x0800L
  8112. #define LBS_DISABLENOSCROLL   0x1000L
  8113. #define LBS_NODATA            0x2000L
  8114. #if(WINVER >= 0x0400)
  8115. #define LBS_NOSEL             0x4000L
  8116. #endif /* WINVER >= 0x0400 */
  8117. #define LBS_STANDARD          (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
  8118.  
  8119. // end_r_winuser
  8120.  
  8121. #endif /* !NOWINSTYLES */
  8122.  
  8123.  
  8124. /*
  8125.  * Combo Box return Values
  8126.  */
  8127. #define CB_OKAY             0
  8128. #define CB_ERR              (-1)
  8129. #define CB_ERRSPACE         (-2)
  8130.  
  8131.  
  8132. /*
  8133.  * Combo Box Notification Codes
  8134.  */
  8135. #define CBN_ERRSPACE        (-1)
  8136. #define CBN_SELCHANGE       1
  8137. #define CBN_DBLCLK          2
  8138. #define CBN_SETFOCUS        3
  8139. #define CBN_KILLFOCUS       4
  8140. #define CBN_EDITCHANGE      5
  8141. #define CBN_EDITUPDATE      6
  8142. #define CBN_DROPDOWN        7
  8143. #define CBN_CLOSEUP         8
  8144. #define CBN_SELENDOK        9
  8145. #define CBN_SELENDCANCEL    10
  8146.  
  8147. #ifndef NOWINSTYLES
  8148. // begin_r_winuser
  8149.  
  8150. /*
  8151.  * Combo Box styles
  8152.  */
  8153. #define CBS_SIMPLE            0x0001L
  8154. #define CBS_DROPDOWN          0x0002L
  8155. #define CBS_DROPDOWNLIST      0x0003L
  8156. #define CBS_OWNERDRAWFIXED    0x0010L
  8157. #define CBS_OWNERDRAWVARIABLE 0x0020L
  8158. #define CBS_AUTOHSCROLL       0x0040L
  8159. #define CBS_OEMCONVERT        0x0080L
  8160. #define CBS_SORT              0x0100L
  8161. #define CBS_HASSTRINGS        0x0200L
  8162. #define CBS_NOINTEGRALHEIGHT  0x0400L
  8163. #define CBS_DISABLENOSCROLL   0x0800L
  8164. #if(WINVER >= 0x0400)
  8165. #define CBS_UPPERCASE           0x2000L
  8166. #define CBS_LOWERCASE           0x4000L
  8167. #endif /* WINVER >= 0x0400 */
  8168.  
  8169. // end_r_winuser
  8170. #endif  /* !NOWINSTYLES */
  8171.  
  8172.  
  8173. /*
  8174.  * Combo Box messages
  8175.  */
  8176. #ifndef NOWINMESSAGES
  8177. #define CB_GETEDITSEL               0x0140
  8178. #define CB_LIMITTEXT                0x0141
  8179. #define CB_SETEDITSEL               0x0142
  8180. #define CB_ADDSTRING                0x0143
  8181. #define CB_DELETESTRING             0x0144
  8182. #define CB_DIR                      0x0145
  8183. #define CB_GETCOUNT                 0x0146
  8184. #define CB_GETCURSEL                0x0147
  8185. #define CB_GETLBTEXT                0x0148
  8186. #define CB_GETLBTEXTLEN             0x0149
  8187. #define CB_INSERTSTRING             0x014A
  8188. #define CB_RESETCONTENT             0x014B
  8189. #define CB_FINDSTRING               0x014C
  8190. #define CB_SELECTSTRING             0x014D
  8191. #define CB_SETCURSEL                0x014E
  8192. #define CB_SHOWDROPDOWN             0x014F
  8193. #define CB_GETITEMDATA              0x0150
  8194. #define CB_SETITEMDATA              0x0151
  8195. #define CB_GETDROPPEDCONTROLRECT    0x0152
  8196. #define CB_SETITEMHEIGHT            0x0153
  8197. #define CB_GETITEMHEIGHT            0x0154
  8198. #define CB_SETEXTENDEDUI            0x0155
  8199. #define CB_GETEXTENDEDUI            0x0156
  8200. #define CB_GETDROPPEDSTATE          0x0157
  8201. #define CB_FINDSTRINGEXACT          0x0158
  8202. #define CB_SETLOCALE                0x0159
  8203. #define CB_GETLOCALE                0x015A
  8204. #if(WINVER >= 0x0400)
  8205. #define CB_GETTOPINDEX              0x015b
  8206. #define CB_SETTOPINDEX              0x015c
  8207. #define CB_GETHORIZONTALEXTENT      0x015d
  8208. #define CB_SETHORIZONTALEXTENT      0x015e
  8209. #define CB_GETDROPPEDWIDTH          0x015f
  8210. #define CB_SETDROPPEDWIDTH          0x0160
  8211. #define CB_INITSTORAGE              0x0161
  8212. #endif /* WINVER >= 0x0400 */
  8213. #if(WINVER >= 0x0400)
  8214. #define CB_MSGMAX                   0x0162
  8215. #else
  8216. #define CB_MSGMAX                   0x015B
  8217. #endif
  8218. #endif  /* !NOWINMESSAGES */
  8219.  
  8220.  
  8221.  
  8222. #ifndef NOWINSTYLES
  8223.  
  8224. // begin_r_winuser
  8225.  
  8226. /*
  8227.  * Scroll Bar Styles
  8228.  */
  8229. #define SBS_HORZ                    0x0000L
  8230. #define SBS_VERT                    0x0001L
  8231. #define SBS_TOPALIGN                0x0002L
  8232. #define SBS_LEFTALIGN               0x0002L
  8233. #define SBS_BOTTOMALIGN             0x0004L
  8234. #define SBS_RIGHTALIGN              0x0004L
  8235. #define SBS_SIZEBOXTOPLEFTALIGN     0x0002L
  8236. #define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
  8237. #define SBS_SIZEBOX                 0x0008L
  8238. #if(WINVER >= 0x0400)
  8239. #define SBS_SIZEGRIP                0x0010L
  8240. #endif /* WINVER >= 0x0400 */
  8241.  
  8242. // end_r_winuser
  8243.  
  8244. #endif /* !NOWINSTYLES */
  8245.  
  8246. /*
  8247.  * Scroll bar messages
  8248.  */
  8249. #ifndef NOWINMESSAGES
  8250. #define SBM_SETPOS                  0x00E0 /*not in win3.1 */
  8251. #define SBM_GETPOS                  0x00E1 /*not in win3.1 */
  8252. #define SBM_SETRANGE                0x00E2 /*not in win3.1 */
  8253. #define SBM_SETRANGEREDRAW          0x00E6 /*not in win3.1 */
  8254. #define SBM_GETRANGE                0x00E3 /*not in win3.1 */
  8255. #define SBM_ENABLE_ARROWS           0x00E4 /*not in win3.1 */
  8256. #if(WINVER >= 0x0400)
  8257. #define SBM_SETSCROLLINFO           0x00E9
  8258. #define SBM_GETSCROLLINFO           0x00EA
  8259.  
  8260. #define SIF_RANGE           0x0001
  8261. #define SIF_PAGE            0x0002
  8262. #define SIF_POS             0x0004
  8263. #define SIF_DISABLENOSCROLL 0x0008
  8264. #define SIF_TRACKPOS        0x0010
  8265. #define SIF_ALL             (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
  8266.  
  8267. typedef struct tagSCROLLINFO
  8268. {
  8269.     UINT    cbSize;
  8270.     UINT    fMask;
  8271.     int     nMin;
  8272.     int     nMax;
  8273.     UINT    nPage;
  8274.     int     nPos;
  8275.     int     nTrackPos;
  8276. }   SCROLLINFO, FAR *LPSCROLLINFO;
  8277. typedef SCROLLINFO CONST FAR *LPCSCROLLINFO;
  8278.  
  8279. WINUSERAPI int     WINAPI SetScrollInfo(HWND, int, LPCSCROLLINFO, BOOL);
  8280. WINUSERAPI BOOL    WINAPI GetScrollInfo(HWND, int, LPSCROLLINFO);
  8281. #endif /* WINVER >= 0x0400 */
  8282. #endif /* !NOWINMESSAGES */
  8283. #endif /* !NOCTLMGR */
  8284.  
  8285. #ifndef NOMDI
  8286.  
  8287. /*
  8288.  * MDI client style bits
  8289.  */
  8290. #define MDIS_ALLCHILDSTYLES    0x0001
  8291.  
  8292. /*
  8293.  * wParam Flags for WM_MDITILE and WM_MDICASCADE messages.
  8294.  */
  8295. #define MDITILE_VERTICAL       0x0000 /*not in win3.1 */
  8296. #define MDITILE_HORIZONTAL     0x0001 /*not in win3.1 */
  8297. #define MDITILE_SKIPDISABLED   0x0002 /*not in win3.1 */
  8298.  
  8299. typedef struct tagMDICREATESTRUCTA {
  8300.     LPCSTR   szClass;
  8301.     LPCSTR   szTitle;
  8302.     HANDLE hOwner;
  8303.     int x;
  8304.     int y;
  8305.     int cx;
  8306.     int cy;
  8307.     DWORD style;
  8308.     LPARAM lParam;        /* app-defined stuff */
  8309. } MDICREATESTRUCTA, *LPMDICREATESTRUCTA;
  8310. typedef struct tagMDICREATESTRUCTW {
  8311.     LPCWSTR  szClass;
  8312.     LPCWSTR  szTitle;
  8313.     HANDLE hOwner;
  8314.     int x;
  8315.     int y;
  8316.     int cx;
  8317.     int cy;
  8318.     DWORD style;
  8319.     LPARAM lParam;        /* app-defined stuff */
  8320. } MDICREATESTRUCTW, *LPMDICREATESTRUCTW;
  8321. #ifdef UNICODE
  8322. typedef MDICREATESTRUCTW MDICREATESTRUCT;
  8323. typedef LPMDICREATESTRUCTW LPMDICREATESTRUCT;
  8324. #else
  8325. typedef MDICREATESTRUCTA MDICREATESTRUCT;
  8326. typedef LPMDICREATESTRUCTA LPMDICREATESTRUCT;
  8327. #endif // UNICODE
  8328.  
  8329. typedef struct tagCLIENTCREATESTRUCT {
  8330.     HANDLE hWindowMenu;
  8331.     UINT idFirstChild;
  8332. } CLIENTCREATESTRUCT, *LPCLIENTCREATESTRUCT;
  8333.  
  8334. WINUSERAPI
  8335. LRESULT
  8336. WINAPI
  8337. DefFrameProcA(
  8338.     HWND hWnd,
  8339.     HWND hWndMDIClient ,
  8340.     UINT uMsg,
  8341.     WPARAM wParam,
  8342.     LPARAM lParam);
  8343. WINUSERAPI
  8344. LRESULT
  8345. WINAPI
  8346. DefFrameProcW(
  8347.     HWND hWnd,
  8348.     HWND hWndMDIClient ,
  8349.     UINT uMsg,
  8350.     WPARAM wParam,
  8351.     LPARAM lParam);
  8352. #ifdef UNICODE
  8353. #define DefFrameProc  DefFrameProcW
  8354. #else
  8355. #define DefFrameProc  DefFrameProcA
  8356. #endif // !UNICODE
  8357.  
  8358. WINUSERAPI
  8359. #ifndef _MAC
  8360. LRESULT
  8361. WINAPI
  8362. #else
  8363. LRESULT
  8364. CALLBACK
  8365. #endif
  8366. DefMDIChildProcA(
  8367.     HWND hWnd,
  8368.     UINT uMsg,
  8369.     WPARAM wParam,
  8370.     LPARAM lParam);
  8371. WINUSERAPI
  8372. #ifndef _MAC
  8373. LRESULT
  8374. WINAPI
  8375. #else
  8376. LRESULT
  8377. CALLBACK
  8378. #endif
  8379. DefMDIChildProcW(
  8380.     HWND hWnd,
  8381.     UINT uMsg,
  8382.     WPARAM wParam,
  8383.     LPARAM lParam);
  8384. #ifdef UNICODE
  8385. #define DefMDIChildProc  DefMDIChildProcW
  8386. #else
  8387. #define DefMDIChildProc  DefMDIChildProcA
  8388. #endif // !UNICODE
  8389.  
  8390. #ifndef NOMSG
  8391.  
  8392. WINUSERAPI
  8393. BOOL
  8394. WINAPI
  8395. TranslateMDISysAccel(
  8396.     HWND hWndClient,
  8397.     LPMSG lpMsg);
  8398.  
  8399. #endif /* !NOMSG */
  8400.  
  8401. WINUSERAPI
  8402. UINT
  8403. WINAPI
  8404. ArrangeIconicWindows(
  8405.     HWND hWnd);
  8406.  
  8407. WINUSERAPI
  8408. HWND
  8409. WINAPI
  8410. CreateMDIWindowA(
  8411.     LPSTR lpClassName,
  8412.     LPSTR lpWindowName,
  8413.     DWORD dwStyle,
  8414.     int X,
  8415.     int Y,
  8416.     int nWidth,
  8417.     int nHeight,
  8418.     HWND hWndParent,
  8419.     HINSTANCE hInstance,
  8420.     LPARAM lParam
  8421.     );
  8422. WINUSERAPI
  8423. HWND
  8424. WINAPI
  8425. CreateMDIWindowW(
  8426.     LPWSTR lpClassName,
  8427.     LPWSTR lpWindowName,
  8428.     DWORD dwStyle,
  8429.     int X,
  8430.     int Y,
  8431.     int nWidth,
  8432.     int nHeight,
  8433.     HWND hWndParent,
  8434.     HINSTANCE hInstance,
  8435.     LPARAM lParam
  8436.     );
  8437. #ifdef UNICODE
  8438. #define CreateMDIWindow  CreateMDIWindowW
  8439. #else
  8440. #define CreateMDIWindow  CreateMDIWindowA
  8441. #endif // !UNICODE
  8442.  
  8443. #if(WINVER >= 0x0400)
  8444. WINUSERAPI WORD    WINAPI TileWindows(HWND hwndParent, UINT wHow, CONST RECT * lpRect, UINT cKids, const HWND FAR * lpKids);
  8445. WINUSERAPI WORD    WINAPI CascadeWindows(HWND hwndParent, UINT wHow, CONST RECT * lpRect, UINT cKids,  const HWND FAR * lpKids);
  8446. #endif /* WINVER >= 0x0400 */
  8447. #endif /* !NOMDI */
  8448.  
  8449. #endif /* !NOUSER */
  8450.  
  8451. /****** Help support ********************************************************/
  8452.  
  8453. #ifndef NOHELP
  8454.  
  8455. typedef DWORD HELPPOLY;
  8456. typedef struct tagMULTIKEYHELPA {
  8457. #ifndef _MAC
  8458.     DWORD  mkSize;
  8459. #else
  8460.     WORD   mkSize;
  8461. #endif
  8462.     CHAR   mkKeylist;
  8463.     CHAR   szKeyphrase[1];
  8464. } MULTIKEYHELPA, *PMULTIKEYHELPA, *LPMULTIKEYHELPA;
  8465. typedef struct tagMULTIKEYHELPW {
  8466. #ifndef _MAC
  8467.     DWORD  mkSize;
  8468. #else
  8469.     WORD   mkSize;
  8470. #endif
  8471.     WCHAR  mkKeylist;
  8472.     WCHAR  szKeyphrase[1];
  8473. } MULTIKEYHELPW, *PMULTIKEYHELPW, *LPMULTIKEYHELPW;
  8474. #ifdef UNICODE
  8475. typedef MULTIKEYHELPW MULTIKEYHELP;
  8476. typedef PMULTIKEYHELPW PMULTIKEYHELP;
  8477. typedef LPMULTIKEYHELPW LPMULTIKEYHELP;
  8478. #else
  8479. typedef MULTIKEYHELPA MULTIKEYHELP;
  8480. typedef PMULTIKEYHELPA PMULTIKEYHELP;
  8481. typedef LPMULTIKEYHELPA LPMULTIKEYHELP;
  8482. #endif // UNICODE
  8483.  
  8484. typedef struct tagHELPWININFOA {
  8485.     int  wStructSize;
  8486.     int  x;
  8487.     int  y;
  8488.     int  dx;
  8489.     int  dy;
  8490.     int  wMax;
  8491.     CHAR   rgchMember[2];
  8492. } HELPWININFOA, *PHELPWININFOA, *LPHELPWININFOA;
  8493. typedef struct tagHELPWININFOW {
  8494.     int  wStructSize;
  8495.     int  x;
  8496.     int  y;
  8497.     int  dx;
  8498.     int  dy;
  8499.     int  wMax;
  8500.     WCHAR  rgchMember[2];
  8501. } HELPWININFOW, *PHELPWININFOW, *LPHELPWININFOW;
  8502. #ifdef UNICODE
  8503. typedef HELPWININFOW HELPWININFO;
  8504. typedef PHELPWININFOW PHELPWININFO;
  8505. typedef LPHELPWININFOW LPHELPWININFO;
  8506. #else
  8507. typedef HELPWININFOA HELPWININFO;
  8508. typedef PHELPWININFOA PHELPWININFO;
  8509. typedef LPHELPWININFOA LPHELPWININFO;
  8510. #endif // UNICODE
  8511.  
  8512. // begin_r_winuser
  8513.  
  8514. /*
  8515.  * Commands to pass to WinHelp()
  8516.  */
  8517. #define HELP_CONTEXT      0x0001L  /* Display topic in ulTopic */
  8518. #define HELP_QUIT         0x0002L  /* Terminate help */
  8519. #define HELP_INDEX        0x0003L  /* Display index */
  8520. #define HELP_CONTENTS     0x0003L
  8521. #define HELP_HELPONHELP   0x0004L  /* Display help on using help */
  8522. #define HELP_SETINDEX     0x0005L  /* Set current Index for multi index help */
  8523. #define HELP_SETCONTENTS  0x0005L
  8524. #define HELP_CONTEXTPOPUP 0x0008L
  8525. #define HELP_FORCEFILE    0x0009L
  8526. #define HELP_KEY          0x0101L  /* Display topic for keyword in offabData */
  8527. #define HELP_COMMAND      0x0102L
  8528. #define HELP_PARTIALKEY   0x0105L
  8529. #define HELP_MULTIKEY     0x0201L
  8530. #define HELP_SETWINPOS    0x0203L
  8531. #if(WINVER >= 0x0400)
  8532. #define HELP_CONTEXTMENU  0x000a
  8533. #define HELP_FINDER       0x000b
  8534. #define HELP_WM_HELP      0x000c
  8535. #define HELP_SETPOPUP_POS 0x000d
  8536.  
  8537. #define HELP_TCARD              0x8000
  8538. #define HELP_TCARD_DATA         0x0010
  8539. #define HELP_TCARD_OTHER_CALLER 0x0011
  8540.  
  8541. // These are in winhelp.h in Win95.
  8542. #define IDH_NO_HELP                     28440
  8543. #define IDH_MISSING_CONTEXT             28441 // Control doesn't have matching help context
  8544. #define IDH_GENERIC_HELP_BUTTON         28442 // Property sheet help button
  8545. #define IDH_OK                          28443
  8546. #define IDH_CANCEL                      28444
  8547. #define IDH_HELP                        28445
  8548.  
  8549. #endif /* WINVER >= 0x0400 */
  8550.  
  8551. // end_r_winuser
  8552.  
  8553.  
  8554. WINUSERAPI
  8555. BOOL
  8556. WINAPI
  8557. WinHelpA(
  8558.     HWND hWndMain,
  8559.     LPCSTR lpszHelp,
  8560.     UINT uCommand,
  8561.     DWORD dwData
  8562.     );
  8563. WINUSERAPI
  8564. BOOL
  8565. WINAPI
  8566. WinHelpW(
  8567.     HWND hWndMain,
  8568.     LPCWSTR lpszHelp,
  8569.     UINT uCommand,
  8570.     DWORD dwData
  8571.     );
  8572. #ifdef UNICODE
  8573. #define WinHelp  WinHelpW
  8574. #else
  8575. #define WinHelp  WinHelpA
  8576. #endif // !UNICODE
  8577.  
  8578. #endif /* !NOHELP */
  8579.  
  8580. #if(WINVER >= 0x0500)
  8581. #define GR_GDIOBJECTS     0       /* Count of GDI objects */
  8582. #define GR_USEROBJECTS    1       /* Count of USER objects */
  8583.  
  8584. DWORD GetGuiResources(HANDLE hProcess, DWORD uiFlags);
  8585. #endif /* WINVER >= 0x0500 */
  8586.  
  8587. #ifndef NOSYSPARAMSINFO
  8588.  
  8589. /*
  8590.  * Parameter for SystemParametersInfo()
  8591.  */
  8592.  
  8593. #define SPI_GETBEEP                 1
  8594. #define SPI_SETBEEP                 2
  8595. #define SPI_GETMOUSE                3
  8596. #define SPI_SETMOUSE                4
  8597. #define SPI_GETBORDER               5
  8598. #define SPI_SETBORDER               6
  8599. #define SPI_GETKEYBOARDSPEED       10
  8600. #define SPI_SETKEYBOARDSPEED       11
  8601. #define SPI_LANGDRIVER             12
  8602. #define SPI_ICONHORIZONTALSPACING  13
  8603. #define SPI_GETSCREENSAVETIMEOUT   14
  8604. #define SPI_SETSCREENSAVETIMEOUT   15
  8605. #define SPI_GETSCREENSAVEACTIVE    16
  8606. #define SPI_SETSCREENSAVEACTIVE    17
  8607. #define SPI_GETGRIDGRANULARITY     18
  8608. #define SPI_SETGRIDGRANULARITY     19
  8609. #define SPI_SETDESKWALLPAPER       20
  8610. #define SPI_SETDESKPATTERN         21
  8611. #define SPI_GETKEYBOARDDELAY       22
  8612. #define SPI_SETKEYBOARDDELAY       23
  8613. #define SPI_ICONVERTICALSPACING    24
  8614. #define SPI_GETICONTITLEWRAP       25
  8615. #define SPI_SETICONTITLEWRAP       26
  8616. #define SPI_GETMENUDROPALIGNMENT   27
  8617. #define SPI_SETMENUDROPALIGNMENT   28
  8618. #define SPI_SETDOUBLECLKWIDTH      29
  8619. #define SPI_SETDOUBLECLKHEIGHT     30
  8620. #define SPI_GETICONTITLELOGFONT    31
  8621. #define SPI_SETDOUBLECLICKTIME     32
  8622. #define SPI_SETMOUSEBUTTONSWAP     33
  8623. #define SPI_SETICONTITLELOGFONT    34
  8624. #define SPI_GETFASTTASKSWITCH      35
  8625. #define SPI_SETFASTTASKSWITCH      36
  8626. #if(WINVER >= 0x0400)
  8627. #define SPI_SETDRAGFULLWINDOWS     37
  8628. #define SPI_GETDRAGFULLWINDOWS     38
  8629. #define SPI_GETNONCLIENTMETRICS    41
  8630. #define SPI_SETNONCLIENTMETRICS    42
  8631. #define SPI_GETMINIMIZEDMETRICS    43
  8632. #define SPI_SETMINIMIZEDMETRICS    44
  8633. #define SPI_GETICONMETRICS         45
  8634. #define SPI_SETICONMETRICS         46
  8635. #define SPI_SETWORKAREA            47
  8636. #define SPI_GETWORKAREA            48
  8637. #define SPI_SETPENWINDOWS          49
  8638.  
  8639. #define SPI_GETHIGHCONTRAST        66
  8640. #define SPI_SETHIGHCONTRAST        67
  8641. #define SPI_GETKEYBOARDPREF        68
  8642. #define SPI_SETKEYBOARDPREF        69
  8643. #define SPI_GETSCREENREADER        70
  8644. #define SPI_SETSCREENREADER        71
  8645. #define SPI_GETANIMATION           72
  8646. #define SPI_SETANIMATION           73
  8647. #define SPI_GETFONTSMOOTHING       74
  8648. #define SPI_SETFONTSMOOTHING       75
  8649. #define SPI_SETDRAGWIDTH           76
  8650. #define SPI_SETDRAGHEIGHT          77
  8651. #define SPI_SETHANDHELD            78
  8652. #define SPI_GETLOWPOWERTIMEOUT     79
  8653. #define SPI_GETPOWEROFFTIMEOUT     80
  8654. #define SPI_SETLOWPOWERTIMEOUT     81
  8655. #define SPI_SETPOWEROFFTIMEOUT     82
  8656. #define SPI_GETLOWPOWERACTIVE      83
  8657. #define SPI_GETPOWEROFFACTIVE      84
  8658. #define SPI_SETLOWPOWERACTIVE      85
  8659. #define SPI_SETPOWEROFFACTIVE      86
  8660. #define SPI_SETCURSORS             87
  8661. #define SPI_SETICONS               88
  8662. #define SPI_GETDEFAULTINPUTLANG    89
  8663. #define SPI_SETDEFAULTINPUTLANG    90
  8664. #define SPI_SETLANGTOGGLE          91
  8665. #define SPI_GETWINDOWSEXTENSION    92
  8666. #define SPI_SETMOUSETRAILS         93
  8667. #define SPI_GETMOUSETRAILS         94
  8668. #define SPI_SETSCREENSAVERRUNNING  97
  8669. #define SPI_SCREENSAVERRUNNING     SPI_SETSCREENSAVERRUNNING
  8670. #endif /* WINVER >= 0x0400 */
  8671. #define SPI_GETFILTERKEYS          50
  8672. #define SPI_SETFILTERKEYS          51
  8673. #define SPI_GETTOGGLEKEYS          52
  8674. #define SPI_SETTOGGLEKEYS          53
  8675. #define SPI_GETMOUSEKEYS           54
  8676. #define SPI_SETMOUSEKEYS           55
  8677. #define SPI_GETSHOWSOUNDS          56
  8678. #define SPI_SETSHOWSOUNDS          57
  8679. #define SPI_GETSTICKYKEYS          58
  8680. #define SPI_SETSTICKYKEYS          59
  8681. #define SPI_GETACCESSTIMEOUT       60
  8682. #define SPI_SETACCESSTIMEOUT       61
  8683. #if(WINVER >= 0x0400)
  8684. #define SPI_GETSERIALKEYS          62
  8685. #define SPI_SETSERIALKEYS          63
  8686. #endif /* WINVER >= 0x0400 */
  8687. #define SPI_GETSOUNDSENTRY         64
  8688. #define SPI_SETSOUNDSENTRY         65
  8689.  
  8690. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
  8691. #define SPI_GETMOUSEHOVERWIDTH     98
  8692. #define SPI_SETMOUSEHOVERWIDTH     99
  8693. #define SPI_GETMOUSEHOVERHEIGHT   100
  8694. #define SPI_SETMOUSEHOVERHEIGHT   101
  8695. #define SPI_GETMOUSEHOVERTIME     102
  8696. #define SPI_SETMOUSEHOVERTIME     103
  8697. #define SPI_GETWHEELSCROLLLINES   104
  8698. #define SPI_SETWHEELSCROLLLINES   105
  8699.  
  8700. #define SPI_GETSHOWIMEUI          110
  8701. #define SPI_SETSHOWIMEUI          111
  8702. #endif
  8703.  
  8704.  
  8705. #if(WINVER >= 0x0500)
  8706. #define SPI_GETMOUSESPEED         112
  8707. #define SPI_SETMOUSESPEED         113
  8708. #define SPI_GETSCREENSAVERRUNNING 114
  8709. #endif /* WINVER >= 0x0500 */
  8710.  
  8711. #if(WINVER >= 0x0500)
  8712. #define SPI_GETACTIVEWINDOWTRACKING         0x1000
  8713. #define SPI_SETACTIVEWINDOWTRACKING         0x1001
  8714. #define SPI_GETMENUANIMATION                0x1002
  8715. #define SPI_SETMENUANIMATION                0x1003
  8716. #define SPI_GETCOMBOBOXANIMATION            0x1004
  8717. #define SPI_SETCOMBOBOXANIMATION            0x1005
  8718. #define SPI_GETLISTBOXSMOOTHSCROLLING       0x1006
  8719. #define SPI_SETLISTBOXSMOOTHSCROLLING       0x1007
  8720. #define SPI_GETGRADIENTCAPTIONS             0x1008
  8721. #define SPI_SETGRADIENTCAPTIONS             0x1009
  8722. #define SPI_GETMENUUNDERLINES               0x100A
  8723. #define SPI_SETMENUUNDERLINES               0x100B
  8724. #define SPI_GETACTIVEWNDTRKZORDER           0x100C
  8725. #define SPI_SETACTIVEWNDTRKZORDER           0x100D
  8726. #define SPI_GETHOTTRACKING                  0x100E
  8727. #define SPI_SETHOTTRACKING                  0x100F
  8728. #define SPI_GETFOREGROUNDLOCKTIMEOUT        0x2000
  8729. #define SPI_SETFOREGROUNDLOCKTIMEOUT        0x2001
  8730. #define SPI_GETACTIVEWNDTRKTIMEOUT          0x2002
  8731. #define SPI_SETACTIVEWNDTRKTIMEOUT          0x2003
  8732. #define SPI_GETFOREGROUNDFLASHCOUNT         0x2004
  8733. #define SPI_SETFOREGROUNDFLASHCOUNT         0x2005
  8734. #endif /* WINVER >= 0x0500 */
  8735.  
  8736. /*
  8737.  * Flags
  8738.  */
  8739. #define SPIF_UPDATEINIFILE    0x0001
  8740. #define SPIF_SENDWININICHANGE 0x0002
  8741. #define SPIF_SENDCHANGE       SPIF_SENDWININICHANGE
  8742.  
  8743.  
  8744. #define METRICS_USEDEFAULT -1
  8745. #ifdef _WINGDI_
  8746. #ifndef NOGDI
  8747. typedef struct tagNONCLIENTMETRICSA
  8748. {
  8749.     UINT    cbSize;
  8750.     int     iBorderWidth;
  8751.     int     iScrollWidth;
  8752.     int     iScrollHeight;
  8753.     int     iCaptionWidth;
  8754.     int     iCaptionHeight;
  8755.     LOGFONTA lfCaptionFont;
  8756.     int     iSmCaptionWidth;
  8757.     int     iSmCaptionHeight;
  8758.     LOGFONTA lfSmCaptionFont;
  8759.     int     iMenuWidth;
  8760.     int     iMenuHeight;
  8761.     LOGFONTA lfMenuFont;
  8762.     LOGFONTA lfStatusFont;
  8763.     LOGFONTA lfMessageFont;
  8764. }   NONCLIENTMETRICSA, *PNONCLIENTMETRICSA, FAR* LPNONCLIENTMETRICSA;
  8765. typedef struct tagNONCLIENTMETRICSW
  8766. {
  8767.     UINT    cbSize;
  8768.     int     iBorderWidth;
  8769.     int     iScrollWidth;
  8770.     int     iScrollHeight;
  8771.     int     iCaptionWidth;
  8772.     int     iCaptionHeight;
  8773.     LOGFONTW lfCaptionFont;
  8774.     int     iSmCaptionWidth;
  8775.     int     iSmCaptionHeight;
  8776.     LOGFONTW lfSmCaptionFont;
  8777.     int     iMenuWidth;
  8778.     int     iMenuHeight;
  8779.     LOGFONTW lfMenuFont;
  8780.     LOGFONTW lfStatusFont;
  8781.     LOGFONTW lfMessageFont;
  8782. }   NONCLIENTMETRICSW, *PNONCLIENTMETRICSW, FAR* LPNONCLIENTMETRICSW;
  8783. #ifdef UNICODE
  8784. typedef NONCLIENTMETRICSW NONCLIENTMETRICS;
  8785. typedef PNONCLIENTMETRICSW PNONCLIENTMETRICS;
  8786. typedef LPNONCLIENTMETRICSW LPNONCLIENTMETRICS;
  8787. #else
  8788. typedef NONCLIENTMETRICSA NONCLIENTMETRICS;
  8789. typedef PNONCLIENTMETRICSA PNONCLIENTMETRICS;
  8790. typedef LPNONCLIENTMETRICSA LPNONCLIENTMETRICS;
  8791. #endif // UNICODE
  8792. #endif /* NOGDI */
  8793. #endif /* _WINGDI_ */
  8794.  
  8795. #define ARW_BOTTOMLEFT              0x0000L
  8796. #define ARW_BOTTOMRIGHT             0x0001L
  8797. #define ARW_TOPLEFT                 0x0002L
  8798. #define ARW_TOPRIGHT                0x0003L
  8799. #define ARW_STARTMASK               0x0003L
  8800. #define ARW_STARTRIGHT              0x0001L
  8801. #define ARW_STARTTOP                0x0002L
  8802.  
  8803. #define ARW_LEFT                    0x0000L
  8804. #define ARW_RIGHT                   0x0000L
  8805. #define ARW_UP                      0x0004L
  8806. #define ARW_DOWN                    0x0004L
  8807. #define ARW_HIDE                    0x0008L
  8808.  
  8809. typedef struct tagMINIMIZEDMETRICS
  8810. {
  8811.     UINT    cbSize;
  8812.     int     iWidth;
  8813.     int     iHorzGap;
  8814.     int     iVertGap;
  8815.     int     iArrange;
  8816. }   MINIMIZEDMETRICS, *PMINIMIZEDMETRICS, *LPMINIMIZEDMETRICS;
  8817.  
  8818. #ifdef _WINGDI_
  8819. #ifndef NOGDI
  8820. typedef struct tagICONMETRICSA
  8821. {
  8822.     UINT    cbSize;
  8823.     int     iHorzSpacing;
  8824.     int     iVertSpacing;
  8825.     int     iTitleWrap;
  8826.     LOGFONTA lfFont;
  8827. }   ICONMETRICSA, *PICONMETRICSA, *LPICONMETRICSA;
  8828. typedef struct tagICONMETRICSW
  8829. {
  8830.     UINT    cbSize;
  8831.     int     iHorzSpacing;
  8832.     int     iVertSpacing;
  8833.     int     iTitleWrap;
  8834.     LOGFONTW lfFont;
  8835. }   ICONMETRICSW, *PICONMETRICSW, *LPICONMETRICSW;
  8836. #ifdef UNICODE
  8837. typedef ICONMETRICSW ICONMETRICS;
  8838. typedef PICONMETRICSW PICONMETRICS;
  8839. typedef LPICONMETRICSW LPICONMETRICS;
  8840. #else
  8841. typedef ICONMETRICSA ICONMETRICS;
  8842. typedef PICONMETRICSA PICONMETRICS;
  8843. typedef LPICONMETRICSA LPICONMETRICS;
  8844. #endif // UNICODE
  8845. #endif /* NOGDI */
  8846. #endif /* _WINGDI_ */
  8847.  
  8848. typedef struct tagANIMATIONINFO
  8849. {
  8850.     UINT    cbSize;
  8851.     int     iMinAnimate;
  8852. }   ANIMATIONINFO, *LPANIMATIONINFO;
  8853.  
  8854. typedef struct tagSERIALKEYSA
  8855. {
  8856.     UINT    cbSize;
  8857.     DWORD   dwFlags;
  8858.     LPSTR     lpszActivePort;
  8859.     LPSTR     lpszPort;
  8860.     UINT    iBaudRate;
  8861.     UINT    iPortState;
  8862.     UINT    iActive;
  8863. }   SERIALKEYSA, *LPSERIALKEYSA;
  8864. typedef struct tagSERIALKEYSW
  8865. {
  8866.     UINT    cbSize;
  8867.     DWORD   dwFlags;
  8868.     LPWSTR    lpszActivePort;
  8869.     LPWSTR    lpszPort;
  8870.     UINT    iBaudRate;
  8871.     UINT    iPortState;
  8872.     UINT    iActive;
  8873. }   SERIALKEYSW, *LPSERIALKEYSW;
  8874. #ifdef UNICODE
  8875. typedef SERIALKEYSW SERIALKEYS;
  8876. typedef LPSERIALKEYSW LPSERIALKEYS;
  8877. #else
  8878. typedef SERIALKEYSA SERIALKEYS;
  8879. typedef LPSERIALKEYSA LPSERIALKEYS;
  8880. #endif // UNICODE
  8881.  
  8882. /* flags for SERIALKEYS dwFlags field */
  8883. #define SERKF_SERIALKEYSON  0x00000001
  8884. #define SERKF_AVAILABLE     0x00000002
  8885. #define SERKF_INDICATOR     0x00000004
  8886.  
  8887.  
  8888. typedef struct tagHIGHCONTRASTA
  8889. {
  8890.     UINT    cbSize;
  8891.     DWORD   dwFlags;
  8892.     LPSTR   lpszDefaultScheme;
  8893. }   HIGHCONTRASTA, *LPHIGHCONTRASTA;
  8894. typedef struct tagHIGHCONTRASTW
  8895. {
  8896.     UINT    cbSize;
  8897.     DWORD   dwFlags;
  8898.     LPWSTR  lpszDefaultScheme;
  8899. }   HIGHCONTRASTW, *LPHIGHCONTRASTW;
  8900. #ifdef UNICODE
  8901. typedef HIGHCONTRASTW HIGHCONTRAST;
  8902. typedef LPHIGHCONTRASTW LPHIGHCONTRAST;
  8903. #else
  8904. typedef HIGHCONTRASTA HIGHCONTRAST;
  8905. typedef LPHIGHCONTRASTA LPHIGHCONTRAST;
  8906. #endif // UNICODE
  8907.  
  8908. /* flags for HIGHCONTRAST dwFlags field */
  8909. #define HCF_HIGHCONTRASTON  0x00000001
  8910. #define HCF_AVAILABLE       0x00000002
  8911. #define HCF_HOTKEYACTIVE    0x00000004
  8912. #define HCF_CONFIRMHOTKEY   0x00000008
  8913. #define HCF_HOTKEYSOUND     0x00000010
  8914. #define HCF_INDICATOR       0x00000020
  8915. #define HCF_HOTKEYAVAILABLE 0x00000040
  8916.  
  8917. /* Flags for ChangeDisplaySettings */
  8918. #define CDS_UPDATEREGISTRY  0x00000001
  8919. #define CDS_TEST            0x00000002
  8920. #define CDS_FULLSCREEN      0x00000004
  8921. #define CDS_GLOBAL          0x00000008
  8922. #define CDS_SET_PRIMARY     0x00000010
  8923. #define CDS_RESET           0x40000000
  8924. #define CDS_SETRECT         0x20000000
  8925. #define CDS_NORESET         0x10000000
  8926.  
  8927. /* Return values for ChangeDisplaySettings */
  8928. #define DISP_CHANGE_SUCCESSFUL       0
  8929. #define DISP_CHANGE_RESTART          1
  8930. #define DISP_CHANGE_FAILED          -1
  8931. #define DISP_CHANGE_BADMODE         -2
  8932. #define DISP_CHANGE_NOTUPDATED      -3
  8933. #define DISP_CHANGE_BADFLAGS        -4
  8934. #define DISP_CHANGE_BADPARAM        -5
  8935.  
  8936. #ifdef _WINGDI_
  8937. #ifndef NOGDI
  8938.  
  8939. WINUSERAPI
  8940. LONG
  8941. WINAPI
  8942. ChangeDisplaySettingsA(
  8943.     LPDEVMODEA  lpDevMode,
  8944.     DWORD       dwFlags);
  8945. WINUSERAPI
  8946. LONG
  8947. WINAPI
  8948. ChangeDisplaySettingsW(
  8949.     LPDEVMODEW  lpDevMode,
  8950.     DWORD       dwFlags);
  8951. #ifdef UNICODE
  8952. #define ChangeDisplaySettings  ChangeDisplaySettingsW
  8953. #else
  8954. #define ChangeDisplaySettings  ChangeDisplaySettingsA
  8955. #endif // !UNICODE
  8956.  
  8957. WINUSERAPI
  8958. LONG
  8959. WINAPI
  8960. ChangeDisplaySettingsExA(
  8961.     LPCSTR    lpszDeviceName,
  8962.     LPDEVMODEA  lpDevMode,
  8963.     HWND        hwnd,
  8964.     DWORD       dwflags,
  8965.     LPVOID      lParam);
  8966. WINUSERAPI
  8967. LONG
  8968. WINAPI
  8969. ChangeDisplaySettingsExW(
  8970.     LPCWSTR    lpszDeviceName,
  8971.     LPDEVMODEW  lpDevMode,
  8972.     HWND        hwnd,
  8973.     DWORD       dwflags,
  8974.     LPVOID      lParam);
  8975. #ifdef UNICODE
  8976. #define ChangeDisplaySettingsEx  ChangeDisplaySettingsExW
  8977. #else
  8978. #define ChangeDisplaySettingsEx  ChangeDisplaySettingsExA
  8979. #endif // !UNICODE
  8980.  
  8981. #define ENUM_CURRENT_SETTINGS       ((DWORD)-1)
  8982. #define ENUM_REGISTRY_SETTINGS      ((DWORD)-2)
  8983.  
  8984. WINUSERAPI
  8985. BOOL
  8986. WINAPI
  8987. EnumDisplaySettingsA(
  8988.     LPCSTR lpszDeviceName,
  8989.     DWORD iModeNum,
  8990.     LPDEVMODEA lpDevMode);
  8991. WINUSERAPI
  8992. BOOL
  8993. WINAPI
  8994. EnumDisplaySettingsW(
  8995.     LPCWSTR lpszDeviceName,
  8996.     DWORD iModeNum,
  8997.     LPDEVMODEW lpDevMode);
  8998. #ifdef UNICODE
  8999. #define EnumDisplaySettings  EnumDisplaySettingsW
  9000. #else
  9001. #define EnumDisplaySettings  EnumDisplaySettingsA
  9002. #endif // !UNICODE
  9003.  
  9004.  
  9005. #if(WINVER >= 0x0500)
  9006. WINUSERAPI
  9007. BOOL
  9008. WINAPI
  9009. EnumDisplayDevicesA(
  9010.     PVOID Unused,
  9011.     DWORD iDevNum,
  9012.     PDISPLAY_DEVICEA lpDisplayDevice,
  9013.     DWORD dwFlags);
  9014. WINUSERAPI
  9015. BOOL
  9016. WINAPI
  9017. EnumDisplayDevicesW(
  9018.     PVOID Unused,
  9019.     DWORD iDevNum,
  9020.     PDISPLAY_DEVICEW lpDisplayDevice,
  9021.     DWORD dwFlags);
  9022. #ifdef UNICODE
  9023. #define EnumDisplayDevices  EnumDisplayDevicesW
  9024. #else
  9025. #define EnumDisplayDevices  EnumDisplayDevicesA
  9026. #endif // !UNICODE
  9027. #endif /* WINVER >= 0x0500 */
  9028.  
  9029. #endif /* NOGDI */
  9030. #endif /* _WINGDI_ */
  9031.  
  9032.  
  9033. WINUSERAPI
  9034. BOOL
  9035. WINAPI
  9036. SystemParametersInfoA(
  9037.     UINT uiAction,
  9038.     UINT uiParam,
  9039.     PVOID pvParam,
  9040.     UINT fWinIni);
  9041. WINUSERAPI
  9042. BOOL
  9043. WINAPI
  9044. SystemParametersInfoW(
  9045.     UINT uiAction,
  9046.     UINT uiParam,
  9047.     PVOID pvParam,
  9048.     UINT fWinIni);
  9049. #ifdef UNICODE
  9050. #define SystemParametersInfo  SystemParametersInfoW
  9051. #else
  9052. #define SystemParametersInfo  SystemParametersInfoA
  9053. #endif // !UNICODE
  9054.  
  9055. #endif  /* !NOSYSPARAMSINFO  */
  9056.  
  9057. /*
  9058.  * Accessibility support
  9059.  */
  9060. typedef struct tagFILTERKEYS
  9061. {
  9062.     UINT  cbSize;
  9063.     DWORD dwFlags;
  9064.     DWORD iWaitMSec;            // Acceptance Delay
  9065.     DWORD iDelayMSec;           // Delay Until Repeat
  9066.     DWORD iRepeatMSec;          // Repeat Rate
  9067.     DWORD iBounceMSec;          // Debounce Time
  9068. } FILTERKEYS, *LPFILTERKEYS;
  9069.  
  9070. /*
  9071.  * FILTERKEYS dwFlags field
  9072.  */
  9073. #define FKF_FILTERKEYSON    0x00000001
  9074. #define FKF_AVAILABLE       0x00000002
  9075. #define FKF_HOTKEYACTIVE    0x00000004
  9076. #define FKF_CONFIRMHOTKEY   0x00000008
  9077. #define FKF_HOTKEYSOUND     0x00000010
  9078. #define FKF_INDICATOR       0x00000020
  9079. #define FKF_CLICKON         0x00000040
  9080.  
  9081. typedef struct tagSTICKYKEYS
  9082. {
  9083.     UINT  cbSize;
  9084.     DWORD dwFlags;
  9085. } STICKYKEYS, *LPSTICKYKEYS;
  9086.  
  9087. /*
  9088.  * STICKYKEYS dwFlags field
  9089.  */
  9090. #define SKF_STICKYKEYSON    0x00000001
  9091. #define SKF_AVAILABLE       0x00000002
  9092. #define SKF_HOTKEYACTIVE    0x00000004
  9093. #define SKF_CONFIRMHOTKEY   0x00000008
  9094. #define SKF_HOTKEYSOUND     0x00000010
  9095. #define SKF_INDICATOR       0x00000020
  9096. #define SKF_AUDIBLEFEEDBACK 0x00000040
  9097. #define SKF_TRISTATE        0x00000080
  9098. #define SKF_TWOKEYSOFF      0x00000100
  9099. #if(_WIN32_WINNT >= 0x0500)
  9100. #define SKF_LALTLATCHED       0x10000000
  9101. #define SKF_LCTLLATCHED       0x04000000
  9102. #define SKF_LSHIFTLATCHED     0x01000000
  9103. #define SKF_RALTLATCHED       0x20000000
  9104. #define SKF_RCTLLATCHED       0x08000000
  9105. #define SKF_RSHIFTLATCHED     0x02000000
  9106. #define SKF_LWINLATCHED       0x40000000
  9107. #define SKF_RWINLATCHED       0x80000000
  9108. #define SKF_LALTLOCKED        0x00100000
  9109. #define SKF_LCTLLOCKED        0x00040000
  9110. #define SKF_LSHIFTLOCKED      0x00010000
  9111. #define SKF_RALTLOCKED        0x00200000
  9112. #define SKF_RCTLLOCKED        0x00080000
  9113. #define SKF_RSHIFTLOCKED      0x00020000
  9114. #define SKF_LWINLOCKED        0x00400000
  9115. #define SKF_RWINLOCKED        0x00800000
  9116. #endif /* _WIN32_WINNT >= 0x0500 */
  9117.  
  9118. typedef struct tagMOUSEKEYS
  9119. {
  9120.     UINT cbSize;
  9121.     DWORD dwFlags;
  9122.     DWORD iMaxSpeed;
  9123.     DWORD iTimeToMaxSpeed;
  9124.     DWORD iCtrlSpeed;
  9125.     DWORD dwReserved1;
  9126.     DWORD dwReserved2;
  9127. } MOUSEKEYS, *LPMOUSEKEYS;
  9128.  
  9129. /*
  9130.  * MOUSEKEYS dwFlags field
  9131.  */
  9132. #define MKF_MOUSEKEYSON     0x00000001
  9133. #define MKF_AVAILABLE       0x00000002
  9134. #define MKF_HOTKEYACTIVE    0x00000004
  9135. #define MKF_CONFIRMHOTKEY   0x00000008
  9136. #define MKF_HOTKEYSOUND     0x00000010
  9137. #define MKF_INDICATOR       0x00000020
  9138. #define MKF_MODIFIERS       0x00000040
  9139. #define MKF_REPLACENUMBERS  0x00000080
  9140. #if(_WIN32_WINNT >= 0x0500)
  9141. #define MKF_LEFTBUTTONSEL   0x10000000
  9142. #define MKF_RIGHTBUTTONSEL  0x20000000
  9143. #define MKF_LEFTBUTTONDOWN  0x01000000
  9144. #define MKF_RIGHTBUTTONDOWN 0x02000000
  9145. #define MKF_MOUSEMODE       0x80000000
  9146. #endif /* _WIN32_WINNT >= 0x0500 */
  9147.  
  9148. typedef struct tagACCESSTIMEOUT
  9149. {
  9150.     UINT  cbSize;
  9151.     DWORD dwFlags;
  9152.     DWORD iTimeOutMSec;
  9153. } ACCESSTIMEOUT, *LPACCESSTIMEOUT;
  9154.  
  9155. /*
  9156.  * ACCESSTIMEOUT dwFlags field
  9157.  */
  9158. #define ATF_TIMEOUTON       0x00000001
  9159. #define ATF_ONOFFFEEDBACK   0x00000002
  9160.  
  9161. /* values for SOUNDSENTRY iFSGrafEffect field */
  9162. #define SSGF_NONE       0
  9163. #define SSGF_DISPLAY    3
  9164.  
  9165. /* values for SOUNDSENTRY iFSTextEffect field */
  9166. #define SSTF_NONE       0
  9167. #define SSTF_CHARS      1
  9168. #define SSTF_BORDER     2
  9169. #define SSTF_DISPLAY    3
  9170.  
  9171. /* values for SOUNDSENTRY iWindowsEffect field */
  9172. #define SSWF_NONE     0
  9173. #define SSWF_TITLE    1
  9174. #define SSWF_WINDOW   2
  9175. #define SSWF_DISPLAY  3
  9176. #define SSWF_CUSTOM   4
  9177.  
  9178. typedef struct tagSOUNDSENTRYA
  9179. {
  9180.     UINT cbSize;
  9181.     DWORD dwFlags;
  9182.     DWORD iFSTextEffect;
  9183.     DWORD iFSTextEffectMSec;
  9184.     DWORD iFSTextEffectColorBits;
  9185.     DWORD iFSGrafEffect;
  9186.     DWORD iFSGrafEffectMSec;
  9187.     DWORD iFSGrafEffectColor;
  9188.     DWORD iWindowsEffect;
  9189.     DWORD iWindowsEffectMSec;
  9190.     LPSTR   lpszWindowsEffectDLL;
  9191.     DWORD iWindowsEffectOrdinal;
  9192. } SOUNDSENTRYA, *LPSOUNDSENTRYA;
  9193. typedef struct tagSOUNDSENTRYW
  9194. {
  9195.     UINT cbSize;
  9196.     DWORD dwFlags;
  9197.     DWORD iFSTextEffect;
  9198.     DWORD iFSTextEffectMSec;
  9199.     DWORD iFSTextEffectColorBits;
  9200.     DWORD iFSGrafEffect;
  9201.     DWORD iFSGrafEffectMSec;
  9202.     DWORD iFSGrafEffectColor;
  9203.     DWORD iWindowsEffect;
  9204.     DWORD iWindowsEffectMSec;
  9205.     LPWSTR  lpszWindowsEffectDLL;
  9206.     DWORD iWindowsEffectOrdinal;
  9207. } SOUNDSENTRYW, *LPSOUNDSENTRYW;
  9208. #ifdef UNICODE
  9209. typedef SOUNDSENTRYW SOUNDSENTRY;
  9210. typedef LPSOUNDSENTRYW LPSOUNDSENTRY;
  9211. #else
  9212. typedef SOUNDSENTRYA SOUNDSENTRY;
  9213. typedef LPSOUNDSENTRYA LPSOUNDSENTRY;
  9214. #endif // UNICODE
  9215.  
  9216. /*
  9217.  * SOUNDSENTRY dwFlags field
  9218.  */
  9219. #define SSF_SOUNDSENTRYON   0x00000001
  9220. #define SSF_AVAILABLE       0x00000002
  9221. #define SSF_INDICATOR       0x00000004
  9222.  
  9223. typedef struct tagTOGGLEKEYS
  9224. {
  9225.     UINT cbSize;
  9226.     DWORD dwFlags;
  9227. } TOGGLEKEYS, *LPTOGGLEKEYS;
  9228.  
  9229. /*
  9230.  * TOGGLEKEYS dwFlags field
  9231.  */
  9232. #define TKF_TOGGLEKEYSON    0x00000001
  9233. #define TKF_AVAILABLE       0x00000002
  9234. #define TKF_HOTKEYACTIVE    0x00000004
  9235. #define TKF_CONFIRMHOTKEY   0x00000008
  9236. #define TKF_HOTKEYSOUND     0x00000010
  9237. #define TKF_INDICATOR       0x00000020
  9238.  
  9239. /*
  9240.  * Set debug level
  9241.  */
  9242.  
  9243. WINUSERAPI
  9244. VOID
  9245. WINAPI
  9246. SetDebugErrorLevel(
  9247.     DWORD dwLevel
  9248.     );
  9249.  
  9250. /*
  9251.  * SetLastErrorEx() types.
  9252.  */
  9253.  
  9254. #define SLE_ERROR       0x00000001
  9255. #define SLE_MINORERROR  0x00000002
  9256. #define SLE_WARNING     0x00000003
  9257.  
  9258. WINUSERAPI
  9259. VOID
  9260. WINAPI
  9261. SetLastErrorEx(
  9262.     DWORD dwErrCode,
  9263.     DWORD dwType
  9264.     );
  9265.  
  9266.  
  9267. #if(WINVER >= 0x0500)
  9268. /*
  9269.  * Multimonitor API.
  9270.  */
  9271.  
  9272. #define MONITOR_DEFAULTTONULL       0x00000000
  9273. #define MONITOR_DEFAULTTOPRIMARY    0x00000001
  9274. #define MONITOR_DEFAULTTONEAREST    0x00000002
  9275.  
  9276. WINUSERAPI
  9277. HMONITOR
  9278. WINAPI
  9279. MonitorFromPoint(POINT pt, DWORD dwFlags);
  9280.  
  9281. WINUSERAPI
  9282. HMONITOR
  9283. WINAPI
  9284. MonitorFromRect(LPCRECT lprc, DWORD dwFlags);
  9285.  
  9286. WINUSERAPI
  9287. HMONITOR
  9288. WINAPI
  9289. MonitorFromWindow(HWND hwnd, DWORD dwFlags);
  9290.  
  9291. #define MONITORINFOF_PRIMARY        0x00000001
  9292.  
  9293. #ifndef CCHDEVICENAME
  9294. #define CCHDEVICENAME 32
  9295. #endif
  9296.  
  9297. typedef struct tagMONITORINFO
  9298. {
  9299.     DWORD   cbSize;
  9300.     RECT    rcMonitor;
  9301.     RECT    rcWork;
  9302.     DWORD   dwFlags;
  9303. } MONITORINFO, *LPMONITORINFO;
  9304.  
  9305. #ifdef __cplusplus
  9306. typedef struct tagMONITORINFOEXA : public tagMONITORINFO
  9307. {
  9308.     CHAR        szDevice[CCHDEVICENAME];
  9309. } MONITORINFOEXA, *LPMONITORINFOEXA;
  9310. typedef struct tagMONITORINFOEXW : public tagMONITORINFO
  9311. {
  9312.     WCHAR       szDevice[CCHDEVICENAME];
  9313. } MONITORINFOEXW, *LPMONITORINFOEXW;
  9314. #ifdef UNICODE
  9315. typedef MONITORINFOEXW MONITORINFOEX;
  9316. typedef LPMONITORINFOEXW LPMONITORINFOEX;
  9317. #else
  9318. typedef MONITORINFOEXA MONITORINFOEX;
  9319. typedef LPMONITORINFOEXA LPMONITORINFOEX;
  9320. #endif // UNICODE
  9321. #else // ndef __cplusplus
  9322. typedef struct tagMONITORINFOEXA
  9323. {
  9324.     MONITORINFO;
  9325.     CHAR        szDevice[CCHDEVICENAME];
  9326. } MONITORINFOEXA, *LPMONITORINFOEXA;
  9327. typedef struct tagMONITORINFOEXW
  9328. {
  9329.     MONITORINFO;
  9330.     WCHAR       szDevice[CCHDEVICENAME];
  9331. } MONITORINFOEXW, *LPMONITORINFOEXW;
  9332. #ifdef UNICODE
  9333. typedef MONITORINFOEXW MONITORINFOEX;
  9334. typedef LPMONITORINFOEXW LPMONITORINFOEX;
  9335. #else
  9336. typedef MONITORINFOEXA MONITORINFOEX;
  9337. typedef LPMONITORINFOEXA LPMONITORINFOEX;
  9338. #endif // UNICODE
  9339. #endif
  9340.  
  9341. WINUSERAPI BOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpmi);
  9342. WINUSERAPI BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpmi);
  9343. #ifdef UNICODE
  9344. #define GetMonitorInfo  GetMonitorInfoW
  9345. #else
  9346. #define GetMonitorInfo  GetMonitorInfoA
  9347. #endif // !UNICODE
  9348.  
  9349. typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);
  9350.  
  9351. WINUSERAPI
  9352. BOOL
  9353. WINAPI
  9354. EnumDisplayMonitors(
  9355.     HDC             hdc,
  9356.     LPCRECT         lprcClip,
  9357.     MONITORENUMPROC lpfnEnum,
  9358.     LPARAM          dwData);
  9359.  
  9360.  
  9361. #ifndef NOWINABLE
  9362.  
  9363. /*
  9364.  * WinEvents - Active Accessibility hooks
  9365.  */
  9366.  
  9367. WINUSERAPI VOID WINAPI
  9368. NotifyWinEvent(
  9369.     DWORD event,
  9370.     HWND  hwnd,
  9371.     LONG  idObject,
  9372.     LONG  idChild);
  9373.  
  9374. typedef VOID (CALLBACK* WINEVENTPROC)(
  9375.     HWINEVENTHOOK hWinEventHook,
  9376.     DWORD         event,
  9377.     HWND          hwnd,
  9378.     LONG          idObject,
  9379.     LONG          idChild,
  9380.     DWORD         idEventThread,
  9381.     DWORD         dwmsEventTime);
  9382.  
  9383. /*
  9384.  * idObject values for WinEventProc and NotifyWinEvent
  9385.  */
  9386.  
  9387. /*
  9388.  * hwnd + idObject can be used with OLEACC.DLL's OleGetObjectFromWindow()
  9389.  * to get an interface pointer to the container.  indexChild is the item
  9390.  * within the container in question.  Setup a VARIANT with vt VT_I4 and
  9391.  * lVal the indexChild and pass that in to all methods.  Then you
  9392.  * are raring to go.
  9393.  */
  9394.  
  9395.  
  9396. /*
  9397.  * Common object IDs (cookies, only for sending WM_GETOBJECT to get at the
  9398.  * thing in question).  Positive IDs are reserved for apps (app specific),
  9399.  * negative IDs are system things and are global, 0 means "just little old
  9400.  * me".
  9401.  */
  9402. #define     CHILDID_SELF        0
  9403. #define     INDEXID_OBJECT      0
  9404. #define     INDEXID_CONTAINER   0
  9405.  
  9406. /*
  9407.  * Reserved IDs for system objects
  9408.  */
  9409. #define     OBJID_WINDOW        0x00000000
  9410. #define     OBJID_SYSMENU       0xFFFFFFFF
  9411. #define     OBJID_TITLEBAR      0xFFFFFFFE
  9412. #define     OBJID_MENU          0xFFFFFFFD
  9413. #define     OBJID_CLIENT        0xFFFFFFFC
  9414. #define     OBJID_VSCROLL       0xFFFFFFFB
  9415. #define     OBJID_HSCROLL       0xFFFFFFFA
  9416. #define     OBJID_SIZEGRIP      0xFFFFFFF9
  9417. #define     OBJID_CARET         0xFFFFFFF8
  9418. #define     OBJID_CURSOR        0xFFFFFFF7
  9419. #define     OBJID_ALERT         0xFFFFFFF6
  9420. #define     OBJID_SOUND         0xFFFFFFF5
  9421.  
  9422. /*
  9423.  * EVENT DEFINITION
  9424.  */
  9425. #define EVENT_MIN           0x00000001
  9426. #define EVENT_MAX           0x7FFFFFFF
  9427.  
  9428.  
  9429. /*
  9430.  *  EVENT_SYSTEM_SOUND
  9431.  *  Sent when a sound is played.  Currently nothing is generating this, we
  9432.  *  this event when a system sound (for menus, etc) is played.  Apps
  9433.  *  generate this, if accessible, when a private sound is played.  For
  9434.  *  example, if Mail plays a "New Mail" sound.
  9435.  *
  9436.  *  System Sounds:
  9437.  *  (Generated by PlaySoundEvent in USER itself)
  9438.  *      hwnd            is NULL
  9439.  *      idObject        is OBJID_SOUND
  9440.  *      idChild         is sound child ID if one
  9441.  *  App Sounds:
  9442.  *  (PlaySoundEvent won't generate notification; up to app)
  9443.  *      hwnd + idObject gets interface pointer to Sound object
  9444.  *      idChild identifies the sound in question
  9445.  *  are going to be cleaning up the SOUNDSENTRY feature in the control panel
  9446.  *  and will use this at that time.  Applications implementing WinEvents
  9447.  *  are perfectly welcome to use it.  Clients of IAccessible* will simply
  9448.  *  turn around and get back a non-visual object that describes the sound.
  9449.  */
  9450. #define EVENT_SYSTEM_SOUND              0x0001
  9451.  
  9452. /*
  9453.  * EVENT_SYSTEM_ALERT
  9454.  * System Alerts:
  9455.  * (Generated by MessageBox() calls for example)
  9456.  *      hwnd            is hwndMessageBox
  9457.  *      idObject        is OBJID_ALERT
  9458.  * App Alerts:
  9459.  * (Generated whenever)
  9460.  *      hwnd+idObject gets interface pointer to Alert
  9461.  */
  9462. #define EVENT_SYSTEM_ALERT              0x0002
  9463.  
  9464. /*
  9465.  * EVENT_SYSTEM_FOREGROUND
  9466.  * Sent when the foreground (active) window changes, even if it is changing
  9467.  * to another window in the same thread as the previous one.
  9468.  *      hwnd            is hwndNewForeground
  9469.  *      idObject        is OBJID_WINDOW
  9470.  *      idChild    is INDEXID_OBJECT
  9471.  */
  9472. #define EVENT_SYSTEM_FOREGROUND         0x0003
  9473.  
  9474. /*
  9475.  * Menu
  9476.  *      hwnd            is window (top level window or popup menu window)
  9477.  *      idObject        is ID of control (OBJID_MENU, OBJID_SYSMENU, OBJID_SELF for popup)
  9478.  *      idChild         is CHILDID_SELF
  9479.  *
  9480.  * EVENT_SYSTEM_MENUSTART
  9481.  * EVENT_SYSTEM_MENUEND
  9482.  * For MENUSTART, hwnd+idObject+idChild refers to the control with the menu bar,
  9483.  *  or the control bringing up the context menu.
  9484.  *
  9485.  * Sent when entering into and leaving from menu mode (system, app bar, and
  9486.  * track popups).
  9487.  */
  9488. #define EVENT_SYSTEM_MENUSTART          0x0004
  9489. #define EVENT_SYSTEM_MENUEND            0x0005
  9490.  
  9491. /*
  9492.  * EVENT_SYSTEM_MENUPOPUPSTART
  9493.  * EVENT_SYSTEM_MENUPOPUPEND
  9494.  * Sent when a menu popup comes up and just before it is taken down.  Note
  9495.  * that for a call to TrackPopupMenu(), a client will see EVENT_SYSTEM_MENUSTART
  9496.  * followed almost immediately by EVENT_SYSTEM_MENUPOPUPSTART for the popup
  9497.  * being shown.
  9498.  *
  9499.  * For MENUPOPUP, hwnd+idObject+idChild refers to the NEW popup coming up, not the
  9500.  * parent item which is hierarchical.  You can get the parent menu/popup by
  9501.  * asking for the accParent object.
  9502.  */
  9503. #define EVENT_SYSTEM_MENUPOPUPSTART     0x0006
  9504. #define EVENT_SYSTEM_MENUPOPUPEND       0x0007
  9505.  
  9506.  
  9507. /*
  9508.  * EVENT_SYSTEM_CAPTURESTART
  9509.  * EVENT_SYSTEM_CAPTUREEND
  9510.  * Sent when a window takes the capture and releases the capture.
  9511.  */
  9512. #define EVENT_SYSTEM_CAPTURESTART       0x0008
  9513. #define EVENT_SYSTEM_CAPTUREEND         0x0009
  9514.  
  9515. /*
  9516.  * Move Size
  9517.  * EVENT_SYSTEM_MOVESIZESTART
  9518.  * EVENT_SYSTEM_MOVESIZEEND
  9519.  * Sent when a window enters and leaves move-size dragging mode.
  9520.  */
  9521. #define EVENT_SYSTEM_MOVESIZESTART      0x000A
  9522. #define EVENT_SYSTEM_MOVESIZEEND        0x000B
  9523.  
  9524. /*
  9525.  * Context Help
  9526.  * EVENT_SYSTEM_CONTEXTHELPSTART
  9527.  * EVENT_SYSTEM_CONTEXTHELPEND
  9528.  * Sent when a window enters and leaves context sensitive help mode.
  9529.  */
  9530. #define EVENT_SYSTEM_CONTEXTHELPSTART   0x000C
  9531. #define EVENT_SYSTEM_CONTEXTHELPEND     0x000D
  9532.  
  9533. /*
  9534.  * Drag & Drop
  9535.  * EVENT_SYSTEM_DRAGDROPSTART
  9536.  * EVENT_SYSTEM_DRAGDROPEND
  9537.  * Send the START notification just before going into drag&drop loop.  Send
  9538.  * the END notification just after canceling out.
  9539.  * Note that it is up to apps and OLE to generate this, since the system
  9540.  * doesn't know.  Like EVENT_SYSTEM_SOUND, it will be a while before this
  9541.  * is prevalent.
  9542.  */
  9543. #define EVENT_SYSTEM_DRAGDROPSTART      0x000E
  9544. #define EVENT_SYSTEM_DRAGDROPEND        0x000F
  9545.  
  9546. /*
  9547.  * Dialog
  9548.  * Send the START notification right after the dialog is completely
  9549.  *  initialized and visible.  Send the END right before the dialog
  9550.  *  is hidden and goes away.
  9551.  * EVENT_SYSTEM_DIALOGSTART
  9552.  * EVENT_SYSTEM_DIALOGEND
  9553.  */
  9554. #define EVENT_SYSTEM_DIALOGSTART        0x0010
  9555. #define EVENT_SYSTEM_DIALOGEND          0x0011
  9556.  
  9557. /*
  9558.  * EVENT_SYSTEM_SCROLLING
  9559.  * EVENT_SYSTEM_SCROLLINGSTART
  9560.  * EVENT_SYSTEM_SCROLLINGEND
  9561.  * Sent when beginning and ending the tracking of a scrollbar in a window,
  9562.  * and also for scrollbar controls.
  9563.  */
  9564. #define EVENT_SYSTEM_SCROLLINGSTART     0x0012
  9565. #define EVENT_SYSTEM_SCROLLINGEND       0x0013
  9566.  
  9567. /*
  9568.  * Alt-Tab Window
  9569.  * Send the START notification right after the switch window is initialized
  9570.  * and visible.  Send the END right before it is hidden and goes away.
  9571.  * EVENT_SYSTEM_SWITCHSTART
  9572.  * EVENT_SYSTEM_SWITCHEND
  9573.  */
  9574. #define EVENT_SYSTEM_SWITCHSTART        0x0014
  9575. #define EVENT_SYSTEM_SWITCHEND          0x0015
  9576.  
  9577. /*
  9578.  * EVENT_SYSTEM_MINIMIZESTART
  9579.  * EVENT_SYSTEM_MINIMIZEEND
  9580.  * Sent when a window minimizes and just before it restores.
  9581.  */
  9582. #define EVENT_SYSTEM_MINIMIZESTART      0x0016
  9583. #define EVENT_SYSTEM_MINIMIZEEND        0x0017
  9584.  
  9585.  
  9586.  
  9587. /*
  9588.  * Object events
  9589.  *
  9590.  * The system AND apps generate these.  The system generates these for
  9591.  * real windows.  Apps generate these for objects within their window which
  9592.  * act like a separate control, e.g. an item in a list view.
  9593.  *
  9594.  * When the system generate them, dwParam2 is always WMOBJID_SELF.  When
  9595.  * apps generate them, apps put the has-meaning-to-the-app-only ID value
  9596.  * in dwParam2.
  9597.  * For all events, if you want detailed accessibility information, callers
  9598.  * should
  9599.  *      * Call AccessibleObjectFromWindow() with the hwnd, idObject parameters
  9600.  *          of the event, and IID_IAccessible as the REFIID, to get back an
  9601.  *          IAccessible* to talk to
  9602.  *      * Initialize and fill in a VARIANT as VT_I4 with lVal the idChild
  9603.  *          parameter of the event.
  9604.  *      * If idChild isn't zero, call get_accChild() in the container to see
  9605.  *          if the child is an object in its own right.  If so, you will get
  9606.  *          back an IDispatch* object for the child.  You should release the
  9607.  *          parent, and call QueryInterface() on the child object to get its
  9608.  *          IAccessible*.  Then you talk directly to the child.  Otherwise,
  9609.  *          if get_accChild() returns you nothing, you should continue to
  9610.  *          use the child VARIANT.  You will ask the container for the properties
  9611.  *          of the child identified by the VARIANT.  In other words, the
  9612.  *          child in this case is accessible but not a full-blown object.
  9613.  *          Like a button on a titlebar which is 'small' and has no children.
  9614.  */
  9615.  
  9616. /*
  9617.  * For all EVENT_OBJECT events,
  9618.  *      hwnd is the dude to Send the WM_GETOBJECT message to (unless NULL,
  9619.  *          see above for system things)
  9620.  *      idObject is the ID of the object that can resolve any queries a
  9621.  *          client might have.  It's a way to deal with windowless controls,
  9622.  *          controls that are just drawn on the screen in some larger parent
  9623.  *          window (like SDM), or standard frame elements of a window.
  9624.  *      idChild is the piece inside of the object that is affected.  This
  9625.  *          allows clients to access things that are too small to have full
  9626.  *          blown objects in their own right.  Like the thumb of a scrollbar.
  9627.  *          The hwnd/idObject pair gets you to the container, the dude you
  9628.  *          probably want to talk to most of the time anyway.  The idChild
  9629.  *          can then be passed into the acc properties to get the name/value
  9630.  *          of it as needed.
  9631.  *
  9632.  * Example #1:
  9633.  *      System propagating a listbox selection change
  9634.  *      EVENT_OBJECT_SELECTION
  9635.  *          hwnd == listbox hwnd
  9636.  *          idObject == OBJID_WINDOW
  9637.  *          idChild == new selected item, or CHILDID_SELF if
  9638.  *              nothing now selected within container.
  9639.  *      Word '97 propagating a listbox selection change
  9640.  *          hwnd == SDM window
  9641.  *          idObject == SDM ID to get at listbox 'control'
  9642.  *          idChild == new selected item, or CHILDID_SELF if
  9643.  *              nothing
  9644.  *
  9645.  * Example #2:
  9646.  *      System propagating a menu item selection on the menu bar
  9647.  *      EVENT_OBJECT_SELECTION
  9648.  *          hwnd == top level window
  9649.  *          idObject == OBJID_MENU
  9650.  *          idChild == ID of child menu bar item selected
  9651.  *
  9652.  * Example #3:
  9653.  *      System propagating a dropdown coming off of said menu bar item
  9654.  *      EVENT_OBJECT_CREATE
  9655.  *          hwnd == popup item
  9656.  *          idObject == OBJID_WINDOW
  9657.  *          idChild == CHILDID_SELF
  9658.  *
  9659.  * Example #4:
  9660.  *
  9661.  * For EVENT_OBJECT_REORDER, the object referred to by hwnd/idObject is the
  9662.  * PARENT container in which the zorder is occurring.  This is because if
  9663.  * one child is zordering, all of them are changing their relative zorder.
  9664.  */
  9665. #define EVENT_OBJECT_CREATE                 0x8000  // hwnd + ID + idChild is created item
  9666. #define EVENT_OBJECT_DESTROY                0x8001  // hwnd + ID + idChild is destroyed item
  9667. #define EVENT_OBJECT_SHOW                   0x8002  // hwnd + ID + idChild is shown item
  9668. #define EVENT_OBJECT_HIDE                   0x8003  // hwnd + ID + idChild is hidden item
  9669. #define EVENT_OBJECT_REORDER                0x8004  // hwnd + ID + idChild is parent of zordering children
  9670. /*
  9671.  * NOTE:
  9672.  * Minimize the number of notifications!
  9673.  *
  9674.  * When you are hiding a parent object, obviously all child objects are no
  9675.  * longer visible on screen.  They still have the same "visible" status,
  9676.  * but are not truly visible.  Hence do not send HIDE notifications for the
  9677.  * children also.  One implies all.  The same goes for SHOW.
  9678.  */
  9679.  
  9680.  
  9681. #define EVENT_OBJECT_FOCUS                  0x8005  // hwnd + ID + idChild is focused item
  9682. #define EVENT_OBJECT_SELECTION              0x8006  // hwnd + ID + idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex
  9683. #define EVENT_OBJECT_SELECTIONADD           0x8007  // hwnd + ID + idChild is item added
  9684. #define EVENT_OBJECT_SELECTIONREMOVE        0x8008  // hwnd + ID + idChild is item removed
  9685. #define EVENT_OBJECT_SELECTIONWITHIN        0x8009  // hwnd + ID + idChild is parent of changed selected items
  9686.  
  9687. /*
  9688.  * NOTES:
  9689.  * There is only one "focused" child item in a parent.  This is the place
  9690.  * keystrokes are going at a given moment.  Hence only send a notification
  9691.  * about where the NEW focus is going.  A NEW item getting the focus already
  9692.  * implies that the OLD item is losing it.
  9693.  *
  9694.  * SELECTION however can be multiple.  Hence the different SELECTION
  9695.  * notifications.  Here's when to use each:
  9696.  *
  9697.  * (1) Send a SELECTION notification in the simple single selection
  9698.  *     case (like the focus) when the item with the selection is
  9699.  *     merely moving to a different item within a container.  hwnd + ID
  9700.  *     is the container control, idChildItem is the new child with the
  9701.  *     selection.
  9702.  *
  9703.  * (2) Send a SELECTIONADD notification when a new item has simply been added
  9704.  *     to the selection within a container.  This is appropriate when the
  9705.  *     number of newly selected items is very small.  hwnd + ID is the
  9706.  *     container control, idChildItem is the new child added to the selection.
  9707.  *
  9708.  * (3) Send a SELECTIONREMOVE notification when a new item has simply been
  9709.  *     removed from the selection within a container.  This is appropriate
  9710.  *     when the number of newly selected items is very small, just like
  9711.  *     SELECTIONADD.  hwnd + ID is the container control, idChildItem is the
  9712.  *     new child removed from the selection.
  9713.  *
  9714.  * (4) Send a SELECTIONWITHIN notification when the selected items within a
  9715.  *     control have changed substantially.  Rather than propagate a large
  9716.  *     number of changes to reflect removal for some items, addition of
  9717.  *     others, just tell somebody who cares that a lot happened.  It will
  9718.  *     be faster an easier for somebody watching to just turn around and
  9719.  *     query the container control what the new bunch of selected items
  9720.  *     are.
  9721.  */
  9722.  
  9723. #define EVENT_OBJECT_STATECHANGE            0x800A  // hwnd + ID + idChild is item w/ state change
  9724. /*
  9725.  * Examples of when to send an EVENT_OBJECT_STATECHANGE include
  9726.  *      * It is being enabled/disabled (USER does for windows)
  9727.  *      * It is being pressed/released (USER does for buttons)
  9728.  *      * It is being checked/unchecked (USER does for radio/check buttons)
  9729.  */
  9730. #define EVENT_OBJECT_LOCATIONCHANGE         0x800B  // hwnd + ID + idChild is moved/sized item
  9731.  
  9732. /*
  9733.  * Note:
  9734.  * A LOCATIONCHANGE is not sent for every child object when the parent
  9735.  * changes shape/moves.  Send one notification for the topmost object
  9736.  * that is changing.  For example, if the user resizes a top level window,
  9737.  * USER will generate a LOCATIONCHANGE for it, but not for the menu bar,
  9738.  * title bar, scrollbars, etc.  that are also changing shape/moving.
  9739.  *
  9740.  * In other words, it only generates LOCATIONCHANGE notifications for
  9741.  * real windows that are moving/sizing.  It will not generate a LOCATIONCHANGE
  9742.  * for every non-floating child window when the parent moves (the children are
  9743.  * logically moving also on screen, but not relative to the parent).
  9744.  *
  9745.  * Now, if the app itself resizes child windows as a result of being
  9746.  * sized, USER will generate LOCATIONCHANGEs for those dudes also because
  9747.  * it doesn't know better.
  9748.  *
  9749.  * Note also that USER will generate LOCATIONCHANGE notifications for two
  9750.  * non-window sys objects:
  9751.  *      (1) System caret
  9752.  *      (2) Cursor
  9753.  */
  9754.  
  9755. #define EVENT_OBJECT_NAMECHANGE             0x800C  // hwnd + ID + idChild is item w/ name change
  9756. #define EVENT_OBJECT_DESCRIPTIONCHANGE      0x800D  // hwnd + ID + idChild is item w/ desc change
  9757. #define EVENT_OBJECT_VALUECHANGE            0x800E  // hwnd + ID + idChild is item w/ value change
  9758. #define EVENT_OBJECT_PARENTCHANGE           0x800F  // hwnd + ID + idChild is item w/ new parent
  9759. #define EVENT_OBJECT_HELPCHANGE             0x8010  // hwnd + ID + idChild is item w/ help change
  9760. #define EVENT_OBJECT_DEFACTIONCHANGE        0x8011  // hwnd + ID + idChild is item w/ def action change
  9761. #define EVENT_OBJECT_ACCELERATORCHANGE      0x8012  // hwnd + ID + idChild is item w/ keybd accel change
  9762.  
  9763. /*
  9764.  * Child IDs
  9765.  */
  9766.  
  9767. /*
  9768.  * System Sounds (idChild of system SOUND notification)
  9769.  */
  9770. #define SOUND_SYSTEM_STARTUP            1
  9771. #define SOUND_SYSTEM_SHUTDOWN           2
  9772. #define SOUND_SYSTEM_BEEP               3
  9773. #define SOUND_SYSTEM_ERROR              4
  9774. #define SOUND_SYSTEM_QUESTION           5
  9775. #define SOUND_SYSTEM_WARNING            6
  9776. #define SOUND_SYSTEM_INFORMATION        7
  9777. #define SOUND_SYSTEM_MAXIMIZE           8
  9778. #define SOUND_SYSTEM_MINIMIZE           9
  9779. #define SOUND_SYSTEM_RESTOREUP          10
  9780. #define SOUND_SYSTEM_RESTOREDOWN        11
  9781. #define SOUND_SYSTEM_APPSTART           12
  9782. #define SOUND_SYSTEM_FAULT              13
  9783. #define SOUND_SYSTEM_APPEND             14
  9784. #define SOUND_SYSTEM_MENUCOMMAND        15
  9785. #define SOUND_SYSTEM_MENUPOPUP          16
  9786. #define CSOUND_SYSTEM                   16
  9787.  
  9788. /*
  9789.  * System Alerts (indexChild of system ALERT notification)
  9790.  */
  9791. #define ALERT_SYSTEM_INFORMATIONAL      1       // MB_INFORMATION
  9792. #define ALERT_SYSTEM_WARNING            2       // MB_WARNING
  9793. #define ALERT_SYSTEM_ERROR              3       // MB_ERROR
  9794. #define ALERT_SYSTEM_QUERY              4       // MB_QUESTION
  9795. #define ALERT_SYSTEM_CRITICAL           5       // HardSysErrBox
  9796. #define CALERT_SYSTEM                   6
  9797.  
  9798. WINUSERAPI HWINEVENTHOOK WINAPI
  9799. SetWinEventHook(
  9800.     DWORD        eventMin,
  9801.     DWORD        eventMax,
  9802.     HMODULE      hmodWinEventProc,
  9803.     WINEVENTPROC pfnWinEventProc,
  9804.     DWORD        idProcess,
  9805.     DWORD        idThread,
  9806.     DWORD        dwFlags);
  9807.  
  9808. WINUSERAPI BOOL WINAPI
  9809. UnhookWinEvent(HWINEVENTHOOK hWinEventHook);
  9810.  
  9811. /*
  9812.  * dwFlags for SetWinEventHook
  9813.  */
  9814. #define WINEVENT_OUTOFCONTEXT   0x0000  // Events are ASYNC
  9815. #define WINEVENT_SKIPOWNTHREAD  0x0001  // Don't call back for events on installer's thread
  9816. #define WINEVENT_SKIPOWNPROCESS 0x0002  // Don't call back for events on installer's process
  9817. #define WINEVENT_INCONTEXT      0x0004  // Events are SYNC, this causes your dll to be injected into every process
  9818.  
  9819. typedef struct tagGUITHREADINFO
  9820. {
  9821.     DWORD   cbSize;
  9822.     DWORD   flags;
  9823.     HWND    hwndActive;
  9824.     HWND    hwndFocus;
  9825.     HWND    hwndCapture;
  9826.     HWND    hwndMenuOwner;
  9827.     HWND    hwndMoveSize;
  9828.     HWND    hwndCaret;
  9829.     RECT    rcCaret;
  9830. } GUITHREADINFO, *PGUITHREADINFO;
  9831.  
  9832. #define GUI_CARETBLINKING   0x00000001
  9833. #define GUI_INMOVESIZE      0x00000002
  9834. #define GUI_INMENUMODE      0x00000004
  9835. #define GUI_SYSTEMMENUMODE  0x00000008
  9836. #define GUI_POPUPMENUMODE   0x00000010
  9837.  
  9838. WINUSERAPI BOOL WINAPI
  9839. GetGUIThreadInfo(
  9840.     DWORD          idThread,
  9841.     PGUITHREADINFO pgui);
  9842.  
  9843. WINUSERAPI UINT WINAPI
  9844. GetWindowModuleFileNameA(
  9845.     HWND   hwnd,
  9846.     LPSTR pszFileName,
  9847.     UINT   cchFileNameMax);
  9848. WINUSERAPI UINT WINAPI
  9849. GetWindowModuleFileNameW(
  9850.     HWND   hwnd,
  9851.     LPWSTR pszFileName,
  9852.     UINT   cchFileNameMax);
  9853. #ifdef UNICODE
  9854. #define GetWindowModuleFileName  GetWindowModuleFileNameW
  9855. #else
  9856. #define GetWindowModuleFileName  GetWindowModuleFileNameA
  9857. #endif // !UNICODE
  9858.  
  9859.  
  9860. #define STATE_SYSTEM_UNAVAILABLE        0x00000001  // Disabled
  9861. #define STATE_SYSTEM_SELECTED           0x00000002
  9862. #define STATE_SYSTEM_FOCUSED            0x00000004
  9863. #define STATE_SYSTEM_PRESSED            0x00000008
  9864. #define STATE_SYSTEM_CHECKED            0x00000010
  9865. #define STATE_SYSTEM_MIXED              0x00000020  // 3-state checkbox or toolbar button
  9866. #define STATE_SYSTEM_READONLY           0x00000040
  9867. #define STATE_SYSTEM_HOTTRACKED         0x00000080
  9868. #define STATE_SYSTEM_DEFAULT            0x00000100
  9869. #define STATE_SYSTEM_EXPANDED           0x00000200
  9870. #define STATE_SYSTEM_COLLAPSED          0x00000400
  9871. #define STATE_SYSTEM_BUSY               0x00000800
  9872. #define STATE_SYSTEM_FLOATING           0x00001000  // Children "owned" not "contained" by parent
  9873. #define STATE_SYSTEM_MARQUEED           0x00002000
  9874. #define STATE_SYSTEM_ANIMATED           0x00004000
  9875. #define STATE_SYSTEM_INVISIBLE          0x00008000
  9876. #define STATE_SYSTEM_OFFSCREEN          0x00010000
  9877. #define STATE_SYSTEM_SIZEABLE           0x00020000
  9878. #define STATE_SYSTEM_MOVEABLE           0x00040000
  9879. #define STATE_SYSTEM_SELFVOICING        0x00080000
  9880. #define STATE_SYSTEM_FOCUSABLE          0x00100000
  9881. #define STATE_SYSTEM_SELECTABLE         0x00200000
  9882. #define STATE_SYSTEM_LINKED             0x00400000
  9883. #define STATE_SYSTEM_TRAVERSED          0x00800000
  9884. #define STATE_SYSTEM_MULTISELECTABLE    0x01000000  // Supports multiple selection
  9885. #define STATE_SYSTEM_EXTSELECTABLE      0x02000000  // Supports extended selection
  9886. #define STATE_SYSTEM_ALERT_LOW          0x04000000  // This information is of low priority
  9887. #define STATE_SYSTEM_ALERT_MEDIUM       0x08000000  // This information is of medium priority
  9888. #define STATE_SYSTEM_ALERT_HIGH         0x10000000  // This information is of high priority
  9889. #define STATE_SYSTEM_VALID              0x1FFFFFFF
  9890.  
  9891. #define CCHILDREN_TITLEBAR              5
  9892. #define CCHILDREN_SCROLLBAR             5
  9893.  
  9894. /*
  9895.  * Information about the global cursor.
  9896.  */
  9897. typedef struct tagCURSORINFO
  9898. {
  9899.     DWORD   cbSize;
  9900.     DWORD   flags;
  9901.     HCURSOR hCursor;
  9902.     POINT   ptScreenPos;
  9903. } CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
  9904.  
  9905. #define CURSOR_SHOWING     0x00000001
  9906.  
  9907. BOOL WINAPI
  9908. GetCursorInfo(
  9909.     PCURSORINFO pci
  9910. );
  9911.  
  9912. /*
  9913.  * Window information snapshot
  9914.  */
  9915. typedef struct tagWINDOWINFO
  9916. {
  9917.     DWORD cbSize;
  9918.     RECT  rcWindow;
  9919.     RECT  rcClient;
  9920.     DWORD dwStyle;
  9921.     DWORD dwExStyle;
  9922.     DWORD dwOtherStuff;
  9923.     UINT  cxWindowBorders;
  9924.     UINT  cyWindowBorders;
  9925.     ATOM  atomWindowType;
  9926.     WORD  wCreatorVersion;
  9927. } WINDOWINFO, *PWINDOWINFO, *LPWINDOWINFO;
  9928.  
  9929. #define WS_ACTIVECAPTION    0x0001
  9930.  
  9931. BOOL WINAPI
  9932. GetWindowInfo(
  9933.     HWND hwnd,
  9934.     PWINDOWINFO pwi
  9935. );
  9936.  
  9937. /*
  9938.  * Titlebar information.
  9939.  */
  9940. typedef struct tagTITLEBARINFO
  9941. {
  9942.     DWORD cbSize;
  9943.     RECT  rcTitleBar;
  9944.     DWORD rgstate[CCHILDREN_TITLEBAR+1];
  9945. } TITLEBARINFO, *PTITLEBARINFO, *LPTITLEBARINFO;
  9946.  
  9947. BOOL WINAPI
  9948. GetTitleBarInfo(
  9949.     HWND hwnd,
  9950.     PTITLEBARINFO pti
  9951. );
  9952.  
  9953. /*
  9954.  * Menubar information
  9955.  */
  9956. typedef struct tagMENUBARINFO
  9957. {
  9958.     DWORD cbSize;
  9959.     RECT  rcBar;          // rect of bar, popup, item
  9960.     HMENU hMenu;          // real menu handle of bar, popup
  9961.     HWND  hwndMenu;       // hwnd of item submenu if one
  9962.     BOOL  fBarFocused:1;  // bar, popup has the focus
  9963.     BOOL  fFocused:1;     // item has the focus
  9964. } MENUBARINFO, *PMENUBARINFO, *LPMENUBARINFO;
  9965.  
  9966. BOOL WINAPI
  9967. GetMenuBarInfo(
  9968.     HWND hwnd,
  9969.     LONG idObject,
  9970.     LONG idItem,
  9971.     PMENUBARINFO pmbi
  9972. );
  9973.  
  9974. /*
  9975.  * Scrollbar information
  9976.  */
  9977. typedef struct tagSCROLLBARINFO
  9978. {
  9979.     DWORD cbSize;
  9980.     RECT  rcScrollBar;
  9981.     int   dxyLineButton;
  9982.     int   xyThumbTop;
  9983.     int   xyThumbBottom;
  9984.     int   bogus;
  9985.     DWORD rgstate[CCHILDREN_SCROLLBAR+1];
  9986. } SCROLLBARINFO, *PSCROLLBARINFO, *LPSCROLLBARINFO;
  9987.  
  9988. BOOL
  9989. WINAPI
  9990. GetScrollBarInfo(
  9991.     HWND hwnd,
  9992.     LONG idObject,
  9993.     PSCROLLBARINFO psbi
  9994. );
  9995.  
  9996. /*
  9997.  * Combobox information
  9998.  */
  9999. typedef struct tagCOMBOBOXINFO
  10000. {
  10001.     DWORD cbSize;
  10002.     RECT  rcItem;
  10003.     RECT  rcButton;
  10004.     DWORD stateButton;
  10005.     HWND  hwndCombo;
  10006.     HWND  hwndItem;
  10007.     HWND  hwndList;
  10008. } COMBOBOXINFO, *PCOMBOBOXINFO, *LPCOMBOBOXINFO;
  10009.  
  10010. BOOL
  10011. WINAPI
  10012. GetComboBoxInfo(
  10013.     HWND hwndCombo,
  10014.     PCOMBOBOXINFO pcbi
  10015. );
  10016.  
  10017. /*
  10018.  * The "real" ancestor window
  10019.  */
  10020. #define     GA_MIC          1
  10021. #define     GA_PARENT       1
  10022. #define     GA_ROOT         2
  10023. #define     GA_ROOTOWNER    3
  10024. #define     GA_MAC          4
  10025.  
  10026. HWND
  10027. WINAPI
  10028. GetAncestor(
  10029.     HWND hwnd,
  10030.     UINT gaFlags
  10031. );
  10032.  
  10033.  
  10034. /*
  10035.  * This gets the REAL child window at the point.  If it is in the dead
  10036.  * space of a group box, it will try a sibling behind it.  But static
  10037.  * fields will get returned.  In other words, it is kind of a cross between
  10038.  * ChildWindowFromPointEx and WindowFromPoint.
  10039.  */
  10040. HWND
  10041. WINAPI
  10042. RealChildWindowFromPoint(
  10043.     HWND hwndParent,
  10044.     POINT ptParentClientCoords
  10045. );
  10046.  
  10047.  
  10048. /*
  10049.  * This gets the name of the window TYPE, not class.  This allows us to
  10050.  * recognize ThunderButton32 et al.
  10051.  */
  10052. UINT
  10053. WINAPI
  10054. RealGetWindowClassA(
  10055.     HWND  hwnd,
  10056.     LPTSTR pszType,
  10057.     UINT  cchType
  10058. );
  10059. /*
  10060.  * This gets the name of the window TYPE, not class.  This allows us to
  10061.  * recognize ThunderButton32 et al.
  10062.  */
  10063. UINT
  10064. WINAPI
  10065. RealGetWindowClassW(
  10066.     HWND  hwnd,
  10067.     LPTSTR pszType,
  10068.     UINT  cchType
  10069. );
  10070. #ifdef UNICODE
  10071. #define RealGetWindowClass  RealGetWindowClassW
  10072. #else
  10073. #define RealGetWindowClass  RealGetWindowClassA
  10074. #endif // !UNICODE
  10075.  
  10076. /*
  10077.  * Alt-Tab Switch window information.
  10078.  */
  10079. typedef struct tagALTTABINFO
  10080. {
  10081.     DWORD cbSize;
  10082.     int   cItems;
  10083.     int   cColumns;
  10084.     int   cRows;
  10085.     int   iColFocus;
  10086.     int   iRowFocus;
  10087.     int   cxItem;
  10088.     int   cyItem;
  10089.     POINT ptStart;
  10090. } ALTTABINFO, *PALTTABINFO, *LPALTTABINFO;
  10091.  
  10092. BOOL
  10093. WINAPI
  10094. GetAltTabInfoA(
  10095.     HWND hwnd,
  10096.     int iItem,
  10097.     PALTTABINFO pati,
  10098.     LPTSTR pszItemText,
  10099.     UINT cchItemText
  10100. );
  10101. BOOL
  10102. WINAPI
  10103. GetAltTabInfoW(
  10104.     HWND hwnd,
  10105.     int iItem,
  10106.     PALTTABINFO pati,
  10107.     LPTSTR pszItemText,
  10108.     UINT cchItemText
  10109. );
  10110. #ifdef UNICODE
  10111. #define GetAltTabInfo  GetAltTabInfoW
  10112. #else
  10113. #define GetAltTabInfo  GetAltTabInfoA
  10114. #endif // !UNICODE
  10115.  
  10116. /*
  10117.  * Listbox information.
  10118.  * Returns the number of items per row.
  10119.  */
  10120. DWORD
  10121. WINAPI
  10122. GetListBoxInfo(
  10123.     HWND hwnd
  10124. );
  10125.  
  10126. #endif /* NOWINABLE */
  10127. #endif /* WINVER >= 0x0500 */
  10128.  
  10129.  
  10130. #if(_WIN32_WINNT >= 0x0500)
  10131. WINUSERAPI
  10132. BOOL
  10133. WINAPI
  10134. LockWorkStation(
  10135.     VOID);
  10136. #endif /* _WIN32_WINNT >= 0x0500 */
  10137.  
  10138. #if(_WIN32_WINNT >= 0x0500)
  10139.  
  10140. BOOL UserHandleGrantAccess(
  10141.     HANDLE hUserHandle,
  10142.     HANDLE hJob);
  10143.  
  10144. #endif /* _WIN32_WINNT >= 0x0500 */
  10145.  
  10146. #ifdef __cplusplus
  10147. }
  10148. #endif  /* __cplusplus */
  10149.  
  10150. #pragma option pop /*P_O_Pop*/
  10151. #endif /* !_WINUSER_ */
  10152.  
  10153.