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