home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / msysjour / vol04 / 01b / macsl / pmwin.h < prev    next >
C/C++ Source or Header  |  1988-09-15  |  75KB  |  2,551 lines

  1. /***************************************************************************\
  2. *
  3. * Module Name: PMWIN.H
  4. *
  5. * OS/2 Presentation Manager Window Manager include file
  6. *
  7. * Copyright (c) 1987  Microsoft Corporation
  8. * Copyright (c) 1987  IBM Corporation
  9. *
  10. *****************************************************************************
  11. *
  12. * If INCL_WIN is defined, all subcomponents are included.
  13. *
  14. * Subcomponents marked with "+" are partially included by default:
  15. *
  16. *   #define:                To include:
  17. *
  18. * + INCL_WINCOMMON          Common Window Management
  19. * + INCL_WINWINDOWMGR       General window management
  20. * + INCL_WINMESSAGEMGR      Message management (requires INCL_WINCOMMON or
  21. *                                                        !INCL_NOCOMMON)
  22. * + INCL_WININPUT           Mouse and keyboard input
  23. * + INCL_WINDIALOGS         Dialog boxes
  24. * + INCL_WINSTATICS         Static controls
  25. * + INCL_WINBUTTONS         Button controls
  26. * + INCL_WINENTRYFIELDS     Entry Fields
  27. * + INCL_WINLISTBOXES       List box controls
  28. * + INCL_WINMENUS           Menu controls
  29. * + INCL_WINSCROLLBARS      Scroll bar controls
  30. * + INCL_WINFRAMEMGR        Frame manager
  31. *   INCL_WINFRAMECTLS       Frame controls (title bars & size border)
  32. *   INCL_WINRECTANGLES      Rectangle routines
  33. *   INCL_WINSYS             System values (and colors)
  34. *   INCL_WINTIMER           Timer routines
  35. * + INCL_WINACCELERATORS    Keyboard accelerators
  36. *   INCL_WINTRACKRECT       WinTrackRect() function
  37. *   INCL_WINCLIPBOARD       Clipboard manager
  38. * + INCL_WINCURSORS         Text cursors
  39. * + INCL_WINPOINTERS        Mouse pointers
  40. *   INCL_WINHOOKS           Hook manager
  41. * + INCL_WINSWITCHLIST      Shell Switch List API
  42. *   INCL_WINPROGRAMLIST     Shell Program List API
  43. *   INCL_WINSHELLDATA       Shell Data (?)
  44. *   INCL_WINCOUNTRY         Country support
  45. *   INCL_WINHEAP            Heap Manager
  46. *   INCL_WINATOM            Atom Manager
  47. *   INCL_WINCATCHTHROW      WinCatch/WinThrow support
  48. *   INCL_WINERRORS          Error code definitions
  49. *
  50. * NOTE: if INCL_ERRORS is defined, INCL_WINERRORS is automatically defined.
  51. *
  52. \***************************************************************************/
  53.  
  54. #define INCL_WININCLUDED
  55.  
  56.  
  57. #ifdef INCL_WIN
  58.  
  59. #define INCL_WINCOMMON
  60. #define INCL_WINWINDOWMGR
  61. #define INCL_WINMESSAGEMGR
  62. #define INCL_WININPUT
  63. #define INCL_WINDIALOGS
  64. #define INCL_WINSTATICS
  65. #define INCL_WINBUTTONS
  66. #define INCL_WINENTRYFIELDS
  67. #define INCL_WINLISTBOXES
  68. #define INCL_WINMENUS
  69. #define INCL_WINSCROLLBARS
  70. #define INCL_WINFRAMEMGR
  71. #define INCL_WINFRAMECTLS
  72. #define INCL_WINRECTANGLES
  73. #define INCL_WINSYS
  74. #define INCL_WINTIMER
  75. #define INCL_WINACCELERATORS
  76. #define INCL_WINTRACKRECT
  77. #define INCL_WINCLIPBOARD
  78. #define INCL_WINCURSORS
  79. #define INCL_WINPOINTERS
  80. #define INCL_WINHOOKS
  81. #define INCL_WINSWITCHLIST
  82. #define INCL_WINPROGRAMLIST
  83. #define INCL_WINSHELLDATA
  84. #define INCL_WINCOUNTRY
  85. #define INCL_WINHEAP
  86. #define INCL_WINATOM
  87. #define INCL_WINCATCHTHROW
  88. #define INCL_WINERRORS
  89.  
  90. #else
  91. #ifdef RC_INVOKED
  92. #define INCL_WININPUT
  93. #define INCL_WINDIALOGS
  94. #define INCL_WINSTATICS
  95. #define INCL_WINBUTTONS
  96. #define INCL_WINENTRYFIELDS
  97. #define INCL_WINLISTBOXES
  98. #define INCL_WINMENUS
  99. #define INCL_WINSCROLLBARS
  100. #define INCL_WINFRAMEMGR
  101. #define INCL_WINFRAMECTLS
  102. #define INCL_WINACCELERATORS
  103. #define INCL_WINPOINTERS
  104. #define INCL_WINMESSAGEMGR
  105. #endif /* RC_INVOKED */
  106.  
  107. #endif /* INCL_WIN */
  108.  
  109.  
  110. #ifdef INCL_ERRORS
  111.  
  112. #define INCL_WINERRORS
  113.  
  114. #endif  /* INCL_ERRORS */
  115.  
  116. /***************************************************************************/
  117.  
  118. /*** General Window Management */
  119.  
  120. #if 1
  121. typedef VOID FAR *MPARAM;      /* mp */
  122. typedef MPARAM FAR *PMPARAM;   /* pmp */
  123. typedef VOID FAR *MRESULT;     /* mres */
  124. typedef MRESULT FAR *PMRESULT; /* pmres */
  125.  
  126. /* Macros to make an MPARAM from standard types. */
  127. #define MPFROMP(p)                 ((MPARAM)(VOID FAR *)(p))
  128. #define MPFROMHWND(hwnd)           ((MPARAM)(HWND)(hwnd))
  129. #define MPFROMCHAR(ch)             ((MPARAM)(USHORT)(ch))
  130. #define MPFROMSHORT(s)             ((MPARAM)(USHORT)(s))
  131. #define MPFROM2SHORT(s1, s2)       ((MPARAM)MAKELONG(s1, s2))
  132. #define MPFROMSH2CH(s, uch1, uch2) ((MPARAM)MAKELONG(s, MAKESHORT(uch1, uch2)))
  133. #define MPFROMLONG(l)              ((MPARAM)(ULONG)(l))
  134.  
  135. /* Macros to extract standard types from an MPARAM */
  136. #define PVOIDFROMMP(mp)            ((VOID FAR *)(mp))
  137. #define HWNDFROMMP(mp)             ((HWND)(mp))
  138. #define CHAR1FROMMP(mp)            ((UCHAR)(mp))
  139. #define CHAR2FROMMP(mp)            ((UCHAR)((ULONG)mp >> 8))
  140. #define CHAR3FROMMP(mp)            ((UCHAR)((ULONG)mp >> 16))
  141. #define CHAR4FROMMP(mp)            ((UCHAR)((ULONG)mp >> 24))
  142. #define SHORT1FROMMP(mp)           ((USHORT)(ULONG)(mp))
  143. #define SHORT2FROMMP(mp)           ((USHORT)((ULONG)mp >> 16))
  144. #define LONGFROMMP(mp)             ((ULONG)(mp))
  145.  
  146. /* Macros to make an MRESULT from standard types. */
  147. #define MRFROMP(p)                 ((MRESULT)(VOID FAR *)(p))
  148. #define MRFROMSHORT(s)             ((MRESULT)(USHORT)(s))
  149. #define MRFROM2SHORT(s1, s2)       ((MRESULT)MAKELONG(s1, s2))
  150. #define MRFROMLONG(l)              ((MRESULT)(ULONG)(l))
  151.  
  152. /* Macros to extract standard types from an MRESULT */
  153. #define PVOIDFROMMR(mr)            ((VOID FAR *)(mr))
  154. #define SHORT1FROMMR(mr)           ((USHORT)((ULONG)mr))
  155. #define SHORT2FROMMR(mr)           ((USHORT)((ULONG)mr >> 16))
  156. #define LONGFROMMR(mr)             ((ULONG)(mr))
  157.  
  158. typedef MRESULT (PASCAL FAR *PFNWP)( /* HWND, USHORT, MPARAM, MPARAM */ );
  159.  
  160. #ifndef INCL_SAADEFS
  161. #define HWND_DESKTOP        (HWND)1
  162. #define HWND_OBJECT         (HWND)2
  163. #endif /* INCL_SAADEFS */
  164.  
  165. #define HWND_TOP            (HWND)3
  166. #define HWND_BOTTOM         (HWND)4
  167.  
  168. #ifndef INCL_SAADEFS
  169. #define HWND_THREADCAPTURE  (HWND)5
  170. #endif /* INCL_SAADEFS */
  171.  
  172.  
  173. /* Standard Window Styles */
  174.  
  175. #define WS_VISIBLE          0x80000000L
  176. #define WS_DISABLED         0x40000000L
  177. #define WS_CLIPCHILDREN     0x20000000L
  178. #define WS_CLIPSIBLINGS     0x10000000L
  179. #define WS_PARENTCLIP       0x08000000L
  180. #define WS_SAVEBITS         0x04000000L
  181. #define WS_SYNCPAINT        0x02000000L
  182. #define WS_MINIMIZED        0x01000000L
  183. #define WS_MAXIMIZED        0x00800000L
  184.  
  185. /* Dialog manager styles */
  186.  
  187. #define WS_GROUP            0x00010000L
  188. #define WS_TABSTOP          0x00020000L
  189.  
  190.  
  191. /* Class styles */
  192.  
  193. #ifndef INCL_SAADEFS
  194. #define CS_MOVENOTIFY       0x00000001L
  195. #define CS_SIZEREDRAW       0x00000004L
  196. #define CS_HITTEST          0x00000008L
  197. #define CS_PUBLIC           0x00000010L
  198. #define CS_FRAME            0x00000020L
  199. #define CS_CLIPCHILDREN     0x20000000L
  200. #define CS_CLIPSIBLINGS     0x10000000L
  201. #define CS_PARENTCLIP       0x08000000L
  202. #define CS_SAVEBITS         0x04000000L
  203. #define CS_SYNCPAINT        0x02000000L
  204.  
  205.  
  206. BOOL    APIENTRY WinRegisterClass(HAB hab, PSZ pszClassName, PFNWP pfnWndProc,
  207.                                   ULONG flStyle, USHORT cbWindowData);
  208. #endif /* INCL_SAADEFS */
  209.  
  210. MRESULT APIENTRY WinDefWindowProc(HWND hwnd, USHORT msg, MPARAM mp1,
  211.                                   MPARAM mp2);
  212. BOOL    APIENTRY WinDestroyWindow(HWND hwnd);
  213. BOOL    APIENTRY WinShowWindow(HWND hwnd, BOOL fShow);
  214. BOOL    APIENTRY WinQueryWindowRect(HWND hwnd, PRECTL prclDest);
  215.  
  216. #ifndef INCL_SAADEFS
  217. HPS   APIENTRY WinBeginPaint(HWND hwnd, HPS hps, PRECTL prclPaint);
  218. BOOL  APIENTRY WinEndPaint(HPS hps);
  219. HPS   APIENTRY WinGetPS(HWND hwnd);
  220. HPS   APIENTRY WinGetClipPS(HWND hwnd, HWND hwndClip, USHORT fs);
  221. BOOL  APIENTRY WinReleasePS(HPS hps);
  222. #endif /* INCL_SAADEFS */
  223.  
  224. HDC   APIENTRY WinOpenWindowDC(HWND hwnd);
  225.  
  226. SHORT APIENTRY WinScrollWindow(HWND hwnd, SHORT dx, SHORT dy,
  227.                                PRECTL prclScroll, PRECTL prclClip,
  228.                                HRGN hrgnUpdate, PRECTL prclUpdate,
  229.                                USHORT rgfsw);
  230.  
  231. /* WinGetClipPS() flags */
  232.  
  233. #ifndef INCL_SAADEFS
  234. #define PSF_LOCKWINDOWUPDATE    0x0001
  235. #define PSF_CLIPUPWARDS         0x0002
  236. #define PSF_CLIPDOWNWARDS       0x0004
  237. #define PSF_CLIPSIBLINGS        0x0008
  238. #define PSF_CLIPCHILDREN        0x0010
  239. #define PSF_PARENTCLIP          0x0020
  240.  
  241. #endif /* INCL_SAADEFS */
  242.  
  243. /* WinScrollWindow() flags */
  244.  
  245. #define SW_SCROLLCHILDREN   0x0001
  246. #define SW_INVALIDATERGN    0x0002
  247.  
  248.  
  249.  
  250. #ifndef INCL_SAADEFS
  251. BOOL  APIENTRY WinFillRect(HPS hps, PRECTL prcl, LONG lColor);
  252. #endif /* INCL_SAADEFS */
  253.  
  254. /*  End of Window Manager COMMON section */
  255. #endif /* not INCL_NOCOMMON */
  256.  
  257. HWND    APIENTRY WinCreateWindow(HWND hwndParent, PSZ pszClass, PSZ pszName,
  258.                                  ULONG flStyle, SHORT x, SHORT y, SHORT cx,
  259.                                  SHORT cy, HWND hwndOwner,
  260.                                  HWND hwndInsertBehind, USHORT id,
  261.                                  PVOID pCtlData, PVOID pPresParams);
  262. BOOL    APIENTRY WinEnableWindow(HWND hwnd, BOOL fEnable);
  263. BOOL    APIENTRY WinIsWindowEnabled(HWND hwnd);
  264. BOOL    APIENTRY WinEnableWindowUpdate(HWND hwnd, BOOL fEnable);
  265. BOOL    APIENTRY WinIsWindowVisible(HWND hwnd);
  266. SHORT   APIENTRY WinQueryWindowText(HWND hwnd, SHORT cchBufferMax,
  267.                                     PSZ pszBuffer);
  268. BOOL    APIENTRY WinSetWindowText(HWND hwnd, PSZ pszText);
  269. SHORT   APIENTRY WinQueryWindowTextLength(HWND hwnd);
  270. HWND    APIENTRY WinWindowFromID(HWND hwndParent, USHORT id);
  271.  
  272. #ifndef INCL_SAADEFS
  273. SHORT   APIENTRY WinMultWindowFromIDs(HWND hwndParent, PHWND prghwnd,
  274.                                       USHORT idFirst, USHORT idLast);
  275. BOOL    APIENTRY WinIsWindow(HAB hab, HWND hwnd);
  276. HWND    APIENTRY WinQueryWindow(HWND hwnd, SHORT cmd, BOOL fLock);
  277.  
  278. /* WinQueryWindow() codes */
  279.  
  280. #define QW_NEXT     0
  281. #define QW_PREV     1
  282. #define QW_TOP      2
  283. #define QW_BOTTOM   3
  284. #define QW_OWNER    4
  285. #define QW_PARENT   5
  286. #define QW_NEXTTOP  6
  287. #define QW_PREVTOP  7
  288.  
  289. #endif /* INCL_SAADEFS */
  290.  
  291. BOOL   APIENTRY WinSetParent(HWND hwnd, HWND hwndNewParent, BOOL fRedraw);
  292.  
  293. #ifndef INCL_SAADEFS
  294. BOOL   APIENTRY WinIsChild(HWND hwnd, HWND hwndParent);
  295. BOOL   APIENTRY WinSetOwner(HWND hwnd, HWND hwndNewOwner);
  296. BOOL   APIENTRY WinQueryWindowProcess(HWND hwnd, PPID ppid, PTID ptid);
  297. #endif /* INCL_SAADEFS */
  298.  
  299. HWND   APIENTRY WinQueryObjectWindow(HWND hwndDesktop);
  300. HWND   APIENTRY WinQueryDesktopWindow(HAB hab, HDC hdc);
  301.  
  302. /*** Window positioning functions */
  303.  
  304. /* WinSetMultWindowPos() structure */
  305.  
  306. typedef struct _SWP {     /* swp */
  307. #ifdef PM_MACINTOSH
  308.     HWND   hwnd;
  309.     HWND   hwndInsertBehind;
  310.     SHORT  x;
  311.     SHORT  y;
  312.     SHORT  cx;
  313.     SHORT  cy;
  314.     USHORT fs;
  315. #else
  316.     USHORT fs;
  317.     SHORT  cy;
  318.     SHORT  cx;
  319.     SHORT  y;
  320.     SHORT  x;
  321.     HWND   hwndInsertBehind;
  322.     HWND   hwnd;
  323. #endif
  324. } SWP;
  325. typedef SWP FAR *PSWP;
  326.  
  327. BOOL   APIENTRY WinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, SHORT x,
  328.                                 SHORT y, SHORT cx, SHORT cy, USHORT fs);
  329. BOOL   APIENTRY WinQueryWindowPos(HWND hwnd, PSWP pswp);
  330. BOOL   APIENTRY WinSetMultWindowPos(HAB hab, PSWP pswp, SHORT cswp);
  331.  
  332. /* WinSetWindowPos() flags */
  333.  
  334. #define SWP_SIZE        0x0001
  335. #define SWP_MOVE        0x0002
  336. #define SWP_ZORDER      0x0004
  337. #define SWP_SHOW        0x0008
  338. #define SWP_HIDE        0x0010
  339. #define SWP_NOREDRAW    0x0020
  340. #define SWP_NOADJUST    0x0040
  341. #define SWP_ACTIVATE    0x0080
  342. #define SWP_DEACTIVATE  0x0100
  343. #define SWP_MINIMIZE    0x0400
  344. #define SWP_MAXIMIZE    0x0800
  345. #define SWP_RESTORE     0x1000
  346.  
  347.  
  348. /* Window painting */
  349.  
  350. BOOL  APIENTRY WinUpdateWindow(HWND hwnd);
  351.  
  352. #ifndef INCL_SAADEFS
  353.  
  354. BOOL  APIENTRY WinInvalidateRect(HWND hwnd, PRECTL pwrc, BOOL fIncludeChildren);
  355. BOOL  APIENTRY WinInvalidateRegion(HWND hwnd, HRGN hrgn,
  356.                                    BOOL fIncludeChildren);
  357.  
  358.  
  359. /* Drawing helpers */
  360.  
  361. BOOL  APIENTRY WinInvertRect(HPS hps, PRECTL prcl);
  362. BOOL  APIENTRY WinDrawBitmap(HPS hpsDst, HBITMAP hbm, PRECTL pwrcSrc,
  363.                              PPOINTL pptlDst, LONG clrFore, LONG clrBack,
  364.            USHORT fs);
  365.  
  366. /* WinDrawBitmap() flags */
  367.  
  368. #define DBM_NORMAL      0x0000
  369. #define DBM_INVERT      0x0001
  370. #define DBM_HALFTONE    0x0002
  371. #define DBM_STRETCH     0x0004
  372. #define DBM_IMAGEATTRS  0x0008
  373.  
  374.  
  375. SHORT APIENTRY WinDrawText(HPS hps, SHORT cchText, PSZ pchText, PRECTL prcl,
  376.          LONG clrFore, LONG clrBack, USHORT rgfCmd);
  377. /*
  378.  * WinDrawText() codes:
  379.  * From DT_LEFT to DT_EXTERNALLEADING, the codes are designed to be OR'ed with
  380.  * SS_TEXT to create variations of the basic text static item.
  381.  */
  382. #define DT_LEFT             0x0000
  383. #define DT_EXTERNALLEADING  0x0080
  384. #define DT_CENTER           0x0100
  385. #define DT_RIGHT            0x0200
  386. #define DT_TOP              0x0000
  387. #define DT_VCENTER          0x0400
  388. #define DT_BOTTOM           0x0800
  389. #define DT_HALFTONE         0x1000
  390. #define DT_MNEMONIC         0x2000
  391. #define DT_WORDBREAK        0x4000
  392. #define DT_ERASERECT        0x8000
  393. #define DT_QUERYEXTENT      0x0002
  394. #define DT_TEXTATTRS      0x0040
  395.  
  396.  
  397. BOOL APIENTRY WinDrawBorder(HPS hps, PRECTL prcl, SHORT cx, SHORT cy,
  398.           LONG clrFore, LONG clrBack, USHORT rgfCmd);
  399.  
  400. /* WinDrawBorder() flags */
  401.  
  402. #define DB_PATCOPY          0x0000
  403. #define DB_PATINVERT        0x0001
  404. #define DB_DESTINVERT       0x0002
  405. #define DB_AREAMIXMODE      0x0003
  406.  
  407. #define DB_ROP              0x0007
  408. #define DB_INTERIOR         0x0008
  409. #define DB_AREAATTRS      0x0010
  410. #define DB_STANDARD         0x0100
  411. #define DB_DLGBORDER        0x0200
  412.  
  413.  
  414. /** Resource loading functions */
  415.  
  416. SHORT   APIENTRY WinLoadString(HAB hab, HMODULE hmod, USHORT id, SHORT cchMax,
  417.                                PSZ pchBuffer);
  418. SHORT   APIENTRY WinLoadMessage(HAB hab, HMODULE hmod, USHORT id, SHORT cchMax,
  419.                                 PSZ pchBuffer);
  420.  
  421. #endif /* INCL_SAADEFS */
  422.  
  423.  
  424. /* WinInitialize/WinTerminate Interface declarations */
  425.  
  426. typedef struct _QVERSDATA {   /* qver */
  427.     USHORT environment;
  428.     USHORT version;
  429. } QVERSDATA;
  430.  
  431. #define QV_OS2          0x0000
  432. #define QV_CMS          0x0001
  433. #define QV_TSO          0x0002
  434. #define QV_TSOBATCH     0x0003
  435.  
  436.  
  437. ULONG  APIENTRY WinQueryVersion(HAB hab);
  438. HAB    APIENTRY WinInitialize(USHORT);
  439. BOOL   APIENTRY WinTerminate(HAB hab);
  440.  
  441.  
  442.  
  443.  
  444. /**** Window Manager Subsection */
  445.  
  446. #ifdef INCL_WINWINDOWMGR
  447.  
  448. /**** Window Manager COMMON Subsection */
  449. BOOL APIENTRY WinSetActiveWindow(HWND hwndDesktop, HWND hwnd);
  450.  
  451. #endif /* Window Manager COMMON subsection */
  452.  
  453. #ifdef INCL_WINWINDOWMGR
  454. /* WM_CREATE structure */
  455.  
  456. typedef struct _CREATESTRUCT {    /* crst */
  457. #ifdef PM_MACINTOSH
  458.     HWND   hwndParent;
  459.     PSZ    pszClass;
  460.     PSZ    pszText;
  461.     ULONG  flStyle;
  462.     SHORT  x;
  463.     SHORT  y;
  464.     SHORT  cx;
  465.     SHORT  cy;
  466.     HWND   hwndOwner;
  467.     HWND   hwndInsertBehind;
  468.     USHORT id;
  469.     PVOID  pCtlData;
  470.     PVOID  pPresParams;
  471. #else
  472.     PVOID  pPresParams;
  473.     PVOID  pCtlData;
  474.     USHORT id;
  475.     HWND   hwndInsertBehind;
  476.     HWND   hwndOwner;
  477.     SHORT  cy;
  478.     SHORT  cx;
  479.     SHORT  y;
  480.     SHORT  x;
  481.     ULONG  flStyle;
  482.     PSZ    pszText;
  483.     PSZ    pszClass;
  484.     HWND   hwndParent;
  485. #endif
  486. } CREATESTRUCT;
  487. typedef CREATESTRUCT FAR *PCREATESTRUCT;
  488.  
  489. /* WinQueryClassInfo() structure */
  490.  
  491. typedef struct _CLASSINFO {     /* clsi */
  492.     ULONG   flClassStyle;
  493.     PFNWP   pfnWindowProc;
  494.     USHORT  cbWindowData;
  495. } CLASSINFO;
  496. typedef CLASSINFO FAR *PCLASSINFO;
  497.  
  498. #ifndef INCL_SAADEFS
  499. PFNWP  APIENTRY WinSubclassWindow(HWND hwnd, PFNWP pfnwp);
  500. #endif /* INCL_SAADEFS */
  501.  
  502. SHORT  APIENTRY WinQueryClassName(HWND hwnd, SHORT cchMax, PSZ pch);
  503. BOOL   APIENTRY WinQueryClassInfo(HAB hab, PSZ pszClassName,
  504.                                   PCLASSINFO pClassInfo);
  505.  
  506. HWND   APIENTRY WinQueryActiveWindow(HWND hwndDesktop, BOOL fLock);
  507.  
  508. #ifndef INCL_SAADEFS
  509. BOOL   APIENTRY WinIsThreadActive(HAB hab);
  510.  
  511. HWND   APIENTRY WinQuerySysModalWindow(HWND hwndDesktop, BOOL fLock);
  512. BOOL   APIENTRY WinSetSysModalWindow(HWND hwndDesktop, HWND hwnd);
  513.  
  514. HWND   APIENTRY WinLockWindow(HWND hwnd, BOOL fLock);
  515. #endif /* INCL_SAADEFS */
  516.  
  517. USHORT APIENTRY WinRegisterWindowDestroy(HWND hwnd, BOOL fRegister);
  518.  
  519. #ifndef INCL_SAADEFS
  520. SHORT  APIENTRY WinQueryWindowLockCount(HWND hwnd);
  521. #endif /* INCL_SAADEFS */
  522.  
  523. #ifndef INCL_SAADEFS
  524. USHORT APIENTRY WinQueryWindowUShort(HWND hwnd, SHORT index);
  525. BOOL   APIENTRY WinSetWindowUShort(HWND hwnd, SHORT index, USHORT us);
  526. ULONG  APIENTRY WinQueryWindowULong(HWND hwnd, SHORT index);
  527. BOOL   APIENTRY WinSetWindowULong(HWND hwnd, SHORT index, ULONG ul);
  528. PVOID  APIENTRY WinQueryWindowPtr(HWND hwnd, SHORT index);
  529. BOOL   APIENTRY WinSetWindowPtr(HWND hwnd, SHORT index, PVOID p);
  530. BOOL   APIENTRY WinSetWindowBits(HWND hwnd, SHORT index, ULONG flData, ULONG flMask);
  531.  
  532. /* Standard WinQueryWindowUShort/ULong() indexes */
  533.  
  534. #define QWS_USER    0
  535. #define QWS_ID      (-1)
  536. #define QWS_MIN     (-1)
  537.  
  538. #define QWL_USER    0
  539. #define QWL_STYLE   (-2)
  540. #define QWP_PFNWP   (-3)
  541. #define QWL_HMQ     (-4)
  542. #define QWL_MIN     (-4)
  543.  
  544. /* WC_FRAME WinQueryWindowUShort/ULong() indexes */
  545.  
  546. #define QWL_HHEAP       0x0004
  547. #define QWL_HWNDFOCUSSAVE 0x0018
  548.  
  549. #define QWS_FLAGS       0x0008
  550. #define QWS_RESULT      0x000a
  551. #define QWS_XRESTORE    0x000c
  552. #define QWS_YRESTORE    0x000e
  553. #define QWS_CXRESTORE   0x0010
  554. #define QWS_CYRESTORE   0x0012
  555. #define QWS_XMINIMIZE   0x0014
  556. #define QWS_YMINIMIZE   0x0016
  557.  
  558.  
  559. /* Window enumeration */
  560.  
  561. typedef LHANDLE HENUM;  /* henum */
  562.  
  563. HENUM APIENTRY WinBeginEnumWindows(HWND hwnd);
  564. HWND  APIENTRY WinGetNextWindow(HENUM henum);
  565. BOOL  APIENTRY WinEndEnumWindows(HENUM henum);
  566.  
  567. HWND  APIENTRY WinWindowFromPoint(HWND hwnd, PPOINTL pptl, BOOL fChildren,
  568.                                   BOOL fLock);
  569. BOOL  APIENTRY WinMapWindowPoints(HWND hwndFrom, HWND hwndTo, PPOINTL prgptl,
  570.                                   SHORT cwpt);
  571.  
  572. /* More window painting stuff */
  573.  
  574. BOOL  APIENTRY WinValidateRect(HWND hwnd, PRECTL prcl, BOOL fIncludeChildren);
  575. BOOL  APIENTRY WinValidateRegion(HWND hwnd, HRGN hrgn, BOOL fIncludeChildren);
  576. HWND  APIENTRY WinWindowFromDC(HDC hdc);
  577. HDC   APIENTRY WinQueryWindowDC(HWND hwnd);
  578. HPS   APIENTRY WinGetScreenPS(HWND hwndDesktop);
  579. BOOL  APIENTRY WinQueryUpdateRect(HWND hwnd, PRECTL prcl);
  580. SHORT APIENTRY WinQueryUpdateRegion(HWND hwnd, HRGN hrgn);
  581. SHORT APIENTRY WinExcludeUpdateRegion(HPS hps, HWND hwnd);
  582. BOOL  APIENTRY WinLockWindowUpdate(HWND hwndDesktop, HWND hwndLockUpdate);
  583. SHORT APIENTRY WinLockVisRegions(HWND hwndDesktop, BOOL fLock);
  584. #endif /* INCL_SAADEFS */
  585.  
  586. #endif /* INCL_WINWINDOWMGR */
  587.  
  588. #ifdef INCL_WINMESSAGEMGR
  589.  
  590. /* QMSG structure */
  591.  
  592. typedef struct _QMSG {  /* qmsg */
  593.     HWND hwnd;
  594.     USHORT msg;
  595.     MPARAM mp1;
  596.     MPARAM mp2;
  597.     ULONG time;
  598.     POINTL ptl;
  599. } QMSG;
  600. typedef QMSG FAR *PQMSG;
  601.  
  602. typedef LHANDLE HMQ;    /* hmq */
  603.  
  604.  
  605. /* Standard Window Messages */
  606.  
  607. #define WM_NULL             0x0000
  608. #define WM_CREATE           0x0001
  609. #define WM_DESTROY          0x0002
  610.  
  611. #ifndef INCL_SAADEFS
  612. #define WM_OTHERWINDOWDESTROYED 0x0003
  613. #endif /* INCL_SAADEFS */
  614.  
  615. #define WM_ENABLE           0x0004
  616. #define WM_SHOW             0x0005
  617. #define WM_MOVE             0x0006
  618. #define WM_SIZE             0x0007
  619. #define WM_ADJUSTWINDOWPOS  0x0008
  620.  
  621. #ifndef INCL_SAADEFS
  622. #define WM_CALCVALIDRECTS   0x0009
  623. #endif /* INCL_SAADEFS */
  624.  
  625. #define WM_SETWINDOWPARAMS  0x000a
  626. #define WM_QUERYWINDOWPARAMS 0x000b
  627. #define WM_HITTEST          0x000c
  628. #define WM_ACTIVATE         0x000d
  629. #define WM_SETFOCUS         0x000f
  630. #define WM_SETSELECTION     0x0010
  631.  
  632. #define WM_COMMAND          0x0020
  633. #define WM_SYSCOMMAND       0x0021
  634. #define WM_HELP             0x0022
  635. #define WM_PAINT            0x0023
  636.  
  637. #ifndef INCL_SAADEFS
  638. #define WM_TIMER            0x0024
  639. #define WM_SEM1             0x0025
  640. #define WM_SEM2             0x0026
  641. #define WM_SEM3             0x0027
  642. #define WM_SEM4             0x0028
  643. #endif /* INCL_SAADEFS */
  644.  
  645. #define WM_CLOSE            0x0029
  646. #define WM_QUIT             0x002a
  647. #define WM_SYSCOLORCHANGE   0x002b
  648. #define WM_SYSVALUECHANGED  0x002d
  649.  
  650. /* Control notification messages */
  651.  
  652. #define WM_CONTROL          0x0030
  653. #define WM_VSCROLL          0x0031
  654. #define WM_HSCROLL          0x0032
  655. #define WM_INITMENU         0x0033
  656. #define WM_MENUSELECT       0x0034
  657. #define WM_MENUEND          0x0035
  658. #define WM_DRAWITEM         0x0036
  659. #define WM_MEASUREITEM      0x0037
  660. #define WM_CONTROLPOINTER   0x0038
  661. #define WM_CONTROLHEAP      0x0039
  662. #define WM_QUERYDLGCODE     0x003a
  663. #define WM_INITDLG          0x003b
  664. #define WM_SUBSTITUTESTRING 0x003c
  665. #define WM_MATCHMNEMONIC    0x003d
  666.  
  667.  
  668. #define WM_USER             0x1000
  669.  
  670. /* WM_COMMAND msg source codes */
  671.  
  672. #define CMDSRC_PUSHBUTTON   1
  673. #define CMDSRC_MENU         2
  674. #define CMDSRC_ACCELERATOR  3
  675. #define CMDSRC_OTHER        0
  676.  
  677. /*
  678.  * The following structure and macro are used to access the
  679.  * WM_COMMAND, WM_HELP, and WM_SYSCOMMAND message parameters:
  680.  */
  681.  
  682. #ifdef PM_MACINTOSH
  683.  
  684. struct _COMMANDMSG {
  685.     USHORT unused;          /* mp1 */
  686.     USHORT cmd;
  687.     BOOL   fMouse;          /* mp2 */
  688.     USHORT source;
  689. };
  690.  
  691. #define COMMANDMSG(pmsg) \
  692.         ( (struct _COMMANDMSG FAR *)( (pmsg) + 1 ) )
  693.  
  694. #else
  695.  
  696. struct _COMMANDMSG {
  697.     USHORT source;          /* mp2 */
  698.     BOOL   fMouse;
  699.     USHORT cmd;             /* mp1 */
  700.     USHORT unused;
  701. };
  702.  
  703. #define COMMANDMSG(pmsg) \
  704.         ((struct _COMMANDMSG FAR *)((PBYTE)pmsg - sizeof(MPARAM) * 2))
  705.  
  706. #endif
  707.  
  708. /*
  709.  * The following structure is used by the WinQueryQueueInfo() routine
  710.  */
  711. #ifndef INCL_SAADEFS
  712. typedef struct _MQINFO {    /* mqi */
  713.     USHORT  cb;
  714.     PID     pid;
  715.     TID     tid;
  716.     USHORT  cmsgs;
  717.     PVOID   pReserved;
  718. } MQINFO;
  719. typedef MQINFO FAR *PMQINFO;
  720. #endif /* INCL_SAADEFS */
  721.  
  722.  
  723. MRESULT APIENTRY WinSendMsg(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);
  724.  
  725. #ifndef INCL_SAADEFS
  726.  
  727. BOOL    APIENTRY WinQueryQueueInfo(HMQ hmq, PMQINFO pmqi, USHORT cbCopy);
  728. #endif /* INCL_SAADEFS */
  729.  
  730. HMQ     APIENTRY WinCreateMsgQueue(HAB hab, SHORT cmsg);
  731. BOOL    APIENTRY WinDestroyMsgQueue(HMQ hmq);
  732.  
  733.  
  734. #ifndef INCL_SAADEFS
  735. BOOL    APIENTRY WinCancelShutdown(HMQ hmq, BOOL fCancelAlways);
  736. #endif /* INCL_SAADEFS */
  737.  
  738. BOOL    APIENTRY WinGetMsg(HAB hab, PQMSG pqmsg, HWND hwndFilter,
  739.                            USHORT msgFilterFirst, USHORT msgFilterLast);
  740. BOOL    APIENTRY WinPeekMsg(HAB hab, PQMSG pqmsg, HWND hwndFilter,
  741.                             USHORT msgFilterFirst, USHORT msgFilterLast,
  742.                             USHORT fs);
  743. ULONG   APIENTRY WinDispatchMsg(HAB hab, PQMSG pqmsg);
  744. BOOL    APIENTRY WinPostMsg(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);
  745.  
  746. /* WinPeekMsg() constants */
  747.  
  748. #define PM_REMOVE       0x0001
  749. #define PM_NOREMOVE     0x0000
  750.  
  751.  
  752. #endif /* Message Manager Common Subsection */
  753.  
  754. #ifdef INCL_WINMESSAGEMGR
  755.  
  756. /* WM_CALCVALIDRECTS return flags */
  757.  
  758. #ifndef INCL_SAADEFS
  759. #define CVR_ALIGNLEFT       0x0001
  760. #define CVR_ALIGNBOTTOM     0x0002
  761. #define CVR_ALIGNRIGHT      0x0004
  762. #define CVR_ALIGNTOP        0x0008
  763. #define CVR_REDRAW          0x0010
  764.  
  765.  
  766. /* WM_HITTEST return codes */
  767.  
  768. #define HT_NORMAL       0
  769. #define HT_TRANSPARENT  (-1)
  770. #define HT_DISCARD      (-2)
  771. #define HT_ERROR        (-3)
  772.  
  773. /* WM_SET/QUERYWINDOWPARAMS structures and flags */
  774.  
  775. typedef struct _WNDPARAMS {   /* wprm */
  776.     USHORT fsStatus;
  777.     USHORT cchText;
  778.     PSZ    pszText;
  779.     USHORT cbPresParams;
  780.     PVOID  pPresParams;
  781.     USHORT cbCtlData;
  782.     PVOID  pCtlData;
  783. } WNDPARAMS;
  784. typedef WNDPARAMS FAR *PWNDPARAMS;
  785.  
  786.  
  787. /* Flags used by WM_SET/QUERYWINDOWPARAMS */
  788.  
  789. #define WPM_TEXT        0x0001
  790. #define WPM_CTLDATA     0x0002
  791. #define WPM_PRESPARAMS  0x0004
  792. #define WPM_CCHTEXT     0x0008
  793. #define WPM_CBCTLDATA   0x0010
  794. #define WPM_CBPRESPARAMS 0x0020
  795.  
  796.  
  797. BOOL    APIENTRY WinInSendMsg(HAB hab);
  798. BOOL    APIENTRY WinBroadcastMsg(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2,
  799.                                  BOOL rgf);
  800.  
  801.  
  802. /* WinBroadcastMsg codes */
  803.  
  804. #define BMSG_POST           0x0000
  805. #define BMSG_SEND           0x0001
  806. #define BMSG_POSTQUEUE      0x0002
  807. #define BMSG_DESCENDANTS    0x0004
  808. #define BMSG_FRAMEONLY      0x0008
  809.  
  810.  
  811. #endif /* INCL_SAADEFS */
  812.  
  813.  
  814. BOOL  APIENTRY WinWaitMsg(HAB hab, USHORT msgFirst, USHORT msgLast);
  815.  
  816. #ifndef INCL_SAADEFS
  817. ULONG APIENTRY WinQueryQueueStatus(HWND hwndDesktop);
  818.  
  819. /* WinQueryQueueStatus() constants */
  820.  
  821. #define QS_KEY          0x0001
  822. #define QS_MOUSEBUTTON  0x0002
  823. #define QS_MOUSEMOVE    0x0004
  824. #define QS_MOUSE        0x0006      /* QS_MOUSEMOVE|QS_MOUSEBUTTON */
  825. #define QS_TIMER        0x0008
  826. #define QS_PAINT        0x0010
  827. #define QS_POSTMSG      0x0020
  828. #define QS_SEM1         0x0040
  829. #define QS_SEM2         0x0080
  830. #define QS_SEM3         0x0100
  831. #define QS_SEM4         0x0200
  832. #define QS_SENDMSG      0x0400
  833.  
  834.  
  835. BOOL  APIENTRY WinPostQueueMsg(HMQ hmq, USHORT msg, MPARAM mp1, MPARAM mp2);
  836.  
  837. BOOL  APIENTRY WinQueryMsgPos(HAB hab, PPOINTL pptl);
  838. ULONG APIENTRY WinQueryMsgTime(HAB hab);
  839.  
  840. USHORT APIENTRY WinMsgSemWait(HSEM hsem, LONG dtTimeout);
  841. USHORT APIENTRY WinMsgMuxSemWait(PUSHORT pisemCleared, PVOID pmxsl, LONG dtTimeout);
  842. #endif /* INCL_SAADEFS */
  843.  
  844. /* WinSetMsgInterest() constants */
  845.  
  846. #define SMI_NOINTEREST      0x0001
  847.  
  848. BOOL  APIENTRY WinSetMsgInterest(HWND hwnd, USHORT msg_class, SHORT control);
  849.  
  850. #endif /* INCL_WINMESSAGEMGR */
  851.  
  852. /*** Keyboard and mouse input stuff */
  853.  
  854. #ifdef INCL_WININPUT
  855.  
  856. /*** Keyboard and mouse input COMMON subsection */
  857. BOOL  APIENTRY WinSetFocus(HWND hwndDesktop, HWND hwndSetFocus);
  858. BOOL  APIENTRY WinFocusChange(HWND hwndDesktop, HWND hwndSetFocus, USHORT fsFocusChange);
  859.  
  860. #define FC_NOSETFOCUS              0x0001
  861. #define FC_NOLOSEFOCUS             0x0002
  862. #define FC_NOSETACTIVE             0x0004
  863. #define FC_NOLOSEACTIVE            0x0008
  864. #define FC_NOSETSELECTION          0x0010
  865. #define FC_NOLOSESELECTION         0x0020
  866. #define FC_NOBRINGTOTOP            0x0040
  867. #define FC_NOBRINGTOTOPFIRSTWINDOW 0x0080
  868. #define FC_SETACTIVEFOCUS          0x0100
  869. #define FC_QUERYACTIVE             0x0200
  870. #define FC_QUERYTASK               0x0400
  871.  
  872.  
  873. #endif  /* Keyboard and mouse input COMMON subsection */
  874.  
  875. #ifdef INCL_WININPUT
  876.  
  877. #ifndef INCL_SAADEFS
  878. BOOL  APIENTRY WinSetCapture(HWND hwndDesktop, HWND hwnd);
  879. HWND  APIENTRY WinQueryCapture(HWND hwndDesktop, BOOL fLock);
  880. #endif /* INCL_SAADEFS */
  881.  
  882. /* Mouse input messages */
  883.  
  884. #ifndef INCL_SAADEFS
  885. #define WM_MOUSEFIRST       0x0070
  886. #define WM_MOUSELAST        0x0079
  887. #define WM_BUTTONCLICKFIRST 0x0071
  888. #define WM_BUTTONCLICKLAST  0x0079
  889.  
  890. #define WM_MOUSEMOVE        0x0070
  891. #endif /* INCL_SAADEFS */
  892.  
  893. #define WM_BUTTON1DOWN      0x0071
  894.  
  895. #ifndef INCL_SAADEFS
  896. #define WM_BUTTON1UP        0x0072
  897. #define WM_BUTTON1DBLCLK    0x0073
  898. #define WM_BUTTON2DOWN      0x0074
  899. #define WM_BUTTON2UP        0x0075
  900. #define WM_BUTTON2DBLCLK    0x0076
  901. #define WM_BUTTON3DOWN      0x0077
  902. #define WM_BUTTON3UP        0x0078
  903. #define WM_BUTTON3DBLCLK    0x0079
  904. #endif /* INCL_SAADEFS */
  905.  
  906. HWND  APIENTRY WinQueryFocus(HWND hwndDesktop, BOOL fLock);
  907.  
  908.  
  909. /* Key/Character input msg     */
  910.  
  911. #define WM_CHAR             0x007a
  912. #define WM_QUEUESYNC        0x007b
  913.  
  914. /* WM_CHAR fs field bits */
  915.  
  916. #define KC_CHAR             0x0001
  917. #define KC_VIRTUALKEY       0x0002
  918. #define KC_SCANCODE         0x0004
  919.  
  920. #ifndef INCL_SAADEFS
  921. #define KC_SHIFT            0x0008
  922. #define KC_CTRL             0x0010
  923. #define KC_ALT              0x0020
  924. #define KC_KEYUP            0x0040
  925. #define KC_PREVDOWN         0x0080
  926. #define KC_LONEKEY          0x0100
  927. #define KC_DEADKEY          0x0200
  928. #define KC_COMPOSITE        0x0400
  929. #define KC_INVALIDCOMP      0x0800
  930. #define KC_TOGGLE           0x1000
  931. #define KC_INVALIDCHAR      0x2000
  932. #endif /* INCL_SAADEFS */
  933.  
  934. /*
  935.  * The following structure and macro are used to access the
  936.  * WM_MOUSEMOVE, and WM_BUTTON* message parameters
  937.  */
  938.  
  939. #ifdef PM_MACINTOSH
  940.  
  941. struct _MOUSEMSG {
  942.     SHORT  y;               /* mp1 */
  943.     SHORT  x;
  944.     USHORT unused;        /* mp2 */
  945.     USHORT codeHitTest;
  946. };
  947.  
  948. #define MOUSEMSG(pmsg) \
  949.         ( (struct _MOUSEMSG FAR *)( (pmsg) + 1 ) )
  950.  
  951. #else
  952.  
  953. struct _MOUSEMSG {
  954.     USHORT codeHitTest;     /* mp2 */
  955.     USHORT unused;
  956.     SHORT  x;               /* mp1 */
  957.     SHORT  y;
  958. };
  959.  
  960. #define MOUSEMSG(pmsg) \
  961.         ((struct _MOUSEMSG FAR *)((PBYTE)pmsg - sizeof(MPARAM) * 2))
  962.  
  963. #endif
  964.  
  965. /*
  966.  * The following structure and macro are used to access the
  967.  * WM_CHAR message parameters.
  968.  */
  969.  
  970. #ifdef PM_MACINTOSH
  971.  
  972. struct _CHARMSG {
  973.     UCHAR  scancode;
  974.     UCHAR  cRepeat;         /* mp1 */
  975.     USHORT fs;
  976.     USHORT vkey;            /* mp2 */
  977.     USHORT chr;
  978. };
  979.  
  980. #define CHARMSG(pmsg) \
  981.         ( (struct _CHARMSG FAR *)( (pmsg) + 1 ) )
  982.  
  983. #else
  984.  
  985. struct _CHARMSG {
  986.     USHORT chr;             /* mp2 */
  987.     USHORT vkey;
  988.     USHORT fs;              /* mp1 */
  989.     UCHAR  cRepeat;
  990.     UCHAR  scancode;
  991. };
  992.  
  993. #define CHARMSG(pmsg) \
  994.         ((struct _CHARMSG FAR *)((PBYTE)pmsg - sizeof(MPARAM) * 2))
  995.  
  996. #endif
  997.  
  998. /*** Virtual key values */
  999.  
  1000. #define VK_BUTTON1      0x01
  1001. #define VK_BUTTON2      0x02
  1002. #define VK_BUTTON3      0x03
  1003. #define VK_BREAK        0x04
  1004. #define VK_BACKSPACE    0x05
  1005. #define VK_TAB          0x06
  1006. #define VK_BACKTAB      0x07
  1007. #define VK_NEWLINE      0x08
  1008. #define VK_SHIFT        0x09
  1009. #define VK_CTRL         0x0A
  1010. #define VK_ALT          0x0B
  1011. #define VK_ALTGRAF      0x0C
  1012. #define VK_PAUSE        0x0D
  1013. #define VK_CAPSLOCK     0x0E
  1014. #define VK_ESC          0x0F
  1015. #define VK_SPACE        0x10
  1016. #define VK_PAGEUP       0x11
  1017. #define VK_PAGEDOWN     0x12
  1018. #define VK_END          0x13
  1019. #define VK_HOME         0x14
  1020. #define VK_LEFT         0x15
  1021. #define VK_UP           0x16
  1022. #define VK_RIGHT        0x17
  1023. #define VK_DOWN         0x18
  1024. #define VK_PRINTSCRN    0x19
  1025. #define VK_INSERT       0x1A
  1026. #define VK_DELETE       0x1B
  1027. #define VK_SCRLLOCK     0x1C
  1028. #define VK_NUMLOCK      0x1D
  1029. #define VK_ENTER        0x1E
  1030. #define VK_SYSRQ        0x1F
  1031. #define VK_F1           0x20
  1032. #define VK_F2           0x21
  1033. #define VK_F3           0x22
  1034. #define VK_F4           0x23
  1035. #define VK_F5           0x24
  1036. #define VK_F6           0x25
  1037. #define VK_F7           0x26
  1038. #define VK_F8           0x27
  1039. #define VK_F9           0x28
  1040. #define VK_F10          0x29
  1041. #define VK_F11          0x2A
  1042. #define VK_F12          0x2B
  1043. #define VK_F13          0x2C
  1044. #define VK_F14          0x2D
  1045. #define VK_F15          0x2E
  1046. #define VK_F16          0x2F
  1047. #define VK_F17          0x30
  1048. #define VK_F18          0x31
  1049. #define VK_F19          0x32
  1050. #define VK_F20          0x33
  1051. #define VK_F21          0x34
  1052. #define VK_F22          0x35
  1053. #define VK_F23          0x36
  1054. #define VK_F24          0x37
  1055.  
  1056.  
  1057. #define VK_MENU         VK_ALT
  1058.  
  1059. #ifndef INCL_SAADEFS
  1060.  
  1061. SHORT APIENTRY WinGetKeyState(HWND hwndDesktop, SHORT vkey);
  1062. SHORT APIENTRY WinGetPhysKeyState(HWND hwndDesktop, SHORT sc);
  1063. BOOL  APIENTRY WinEnablePhysInput(HWND hwndDesktop, BOOL fEnable);
  1064. BOOL  APIENTRY WinIsPhysInputEnabled(HWND hwndDesktop);
  1065. BOOL  APIENTRY WinSetKeyboardStateTable(HWND hwndDesktop,
  1066.                                         PBYTE pKeyStateTable, BOOL fSet);
  1067.  
  1068.  
  1069. /* Journal Notification messages  */
  1070. #define WM_JOURNALNOTIFY    0x007c
  1071.  
  1072. /*** Define the valid commands (lParm1) for journal notify message */
  1073. #define JRN_QUEUESTATUS     0x00000001L
  1074. #define JRN_PHYSKEYSTATE    0x00000002L
  1075.  
  1076. #endif /* INCL_SAADEFS */
  1077. #endif /* INCL_WININPUT */
  1078.  
  1079.  
  1080. /**** Dialog Manager */
  1081.  
  1082. #ifdef INCL_WINDIALOGS
  1083. /**** Dialog Manager COMMON subsection */
  1084.  
  1085. HWND    APIENTRY WinLoadDlg(HWND hwndParent, HWND hwndOwner, PFNWP pfnDlgProc,
  1086.                             HMODULE hmod, USHORT idDlg, PVOID pCreateParams);
  1087. USHORT  APIENTRY WinDlgBox(HWND hwndParent, HWND hwndOwner, PFNWP pfnDlgProc,
  1088.                             HMODULE hmod, USHORT idDlg, PVOID pCreateParams);
  1089.  
  1090. BOOL    APIENTRY WinDismissDlg(HWND hwndDlg, USHORT usResult);
  1091.  
  1092. #ifndef INCL_SAADEFS
  1093. BOOL    APIENTRY WinSetDlgItemShort(HWND hwndDlg, USHORT idItem,
  1094.                                     USHORT usValue, BOOL fSigned);
  1095. BOOL    APIENTRY WinQueryDlgItemShort(HWND hwndDlg, USHORT idItem,
  1096.                                       PSHORT pResult, BOOL fSigned);
  1097. SHORT   APIENTRY WinSetDlgItemText(HWND hwndDlg, USHORT idItem, PSZ pszText);
  1098. SHORT   APIENTRY WinQueryDlgItemText(HWND hwndDlg, USHORT idItem,
  1099.                                      USHORT cchBufferMax, PSZ pchBuffer);
  1100. #endif /* INCL_SAADEFS */
  1101.  
  1102. MRESULT APIENTRY WinDefDlgProc(HWND hwndDlg, USHORT msg, MPARAM mp1,
  1103.             MPARAM mp2);
  1104.  
  1105. /* Special item IDs */
  1106.  
  1107. #ifndef INCL_SAADEFS
  1108. #define DID_OK      1
  1109. #define DID_CANCEL  2
  1110. #define DID_ERROR   0xffff
  1111. #endif /* INCL_SAADEFS */
  1112.  
  1113. BOOL APIENTRY WinAlarm(HWND hwndDesktop, USHORT rgfType);
  1114.  
  1115. /* WinAlarm Codes */
  1116.  
  1117. #define WA_WARNING              0
  1118. #define WA_NOTE                 1
  1119. #define WA_ERROR                2
  1120.  
  1121. #define WA_CWINALARMS           3
  1122.  
  1123. #ifndef INCL_SAADEFS
  1124. USHORT APIENTRY WinMessageBox(HWND hwndParent, HWND hwndOwner, PSZ pszText,
  1125.                               PSZ pszCaption, USHORT idWindow, USHORT flStyle);
  1126.  
  1127. /* Message box types */
  1128.  
  1129. #define MB_OK                   0x0000
  1130. #define MB_OKCANCEL             0x0001
  1131. #define MB_RETRYCANCEL          0x0002
  1132. #define MB_ABORTRETRYIGNORE     0x0003
  1133. #define MB_YESNO                0x0004
  1134. #define MB_YESNOCANCEL          0x0005
  1135. #define MB_CANCEL               0x0006
  1136. #define MB_ENTER                0x0007
  1137. #define MB_ENTERCANCEL          0x0008
  1138.  
  1139. #define MB_NOICON               0x0000
  1140. #define MB_CUANOTIFICATION      0x0000
  1141. #define MB_ICONQUESTION         0x0010
  1142. #define MB_ICONEXCLAMATION      0x0020
  1143. #define MB_CUAWARNING           0x0020
  1144. #define MB_ICONASTERISK         0x0030
  1145. #define MB_ICONHAND             0x0040
  1146. #define MB_CUACRITICAL          0x0040
  1147.  
  1148. #define MB_DEFBUTTON1           0x0000
  1149. #define MB_DEFBUTTON2           0x0100
  1150. #define MB_DEFBUTTON3           0x0200
  1151.  
  1152. #define MB_APPLMODAL            0x0000
  1153. #define MB_SYSTEMMODAL          0x1000
  1154. #define MB_HELP                 0x2000
  1155. #define MB_MOVEABLE             0x4000
  1156.  
  1157.  
  1158. /* Message box return codes */
  1159.  
  1160. #define MBID_OK                 1
  1161. #define MBID_CANCEL             2
  1162. #define MBID_ABORT              3
  1163. #define MBID_RETRY              4
  1164. #define MBID_IGNORE             5
  1165. #define MBID_YES                6
  1166. #define MBID_NO                 7
  1167. #define MBID_HELP               8
  1168. #define MBID_ENTER              9
  1169. #define MBID_ERROR              0xffff
  1170. #endif /* INCL_SAADEFS */
  1171.  
  1172. #endif /* Dialog Manager COMMON subsection */
  1173.  
  1174.  
  1175. #ifdef INCL_WINDIALOGS
  1176.  
  1177. /* Dialog codes: returned by WM_QUERYDLGCODE msg     */
  1178.  
  1179. #ifndef INCL_SAADEFS
  1180. #define DLGC_ENTRYFIELD     0x0001    /* Entry field item understands EM_SETSEL) */
  1181. #define DLGC_BUTTON         0x0002    /* Button item */
  1182. #define DLGC_RADIOBUTTON    0x0004    /* Radio button */
  1183. #define DLGC_STATIC         0x0008    /* Static item */
  1184. #define DLGC_DEFAULT        0x0010    /* Default push button */
  1185. #define DLGC_PUSHBUTTON     0x0020    /* Normal (Non-default) push button */
  1186. #define DLGC_CHECKBOX       0x0040    /* Check box button control */
  1187. #define DLGC_SCROLLBAR      0x0080    /* Scroll bar */
  1188. #define DLGC_MENU           0x0100    /* Menu */
  1189.  
  1190. #endif /* INCL_SAADEFS */
  1191.  
  1192. USHORT  APIENTRY WinProcessDlg(HWND hwndDlg);
  1193. MRESULT APIENTRY WinSendDlgItemMsg(HWND hwndDlg, USHORT idItem, USHORT msg,
  1194.                                    MPARAM mp1, MPARAM mp2);
  1195. BOOL    APIENTRY WinMapDlgPoints(HWND hwndDlg, PPOINTL prgwptl, SHORT cwpt,
  1196.                                  BOOL fCalcWindowCoords);
  1197.  
  1198.  
  1199. #ifndef INCL_SAADEFS
  1200. SHORT   APIENTRY WinSubstituteStrings(HWND hwnd, PSZ pszSrc, SHORT cchDstMax,
  1201.                                       PSZ pszDst);
  1202. HWND    APIENTRY WinEnumDlgItem(HWND hwndDlg, HWND hwnd, USHORT code,
  1203.                                 BOOL fLock);
  1204.  
  1205. /* WinEnumDlgItem() constants */
  1206.  
  1207. #define EDI_FIRSTTABITEM        0
  1208. #define EDI_LASTTABITEM         1
  1209. #define EDI_NEXTTABITEM         2
  1210. #define EDI_PREVTABITEM         3
  1211. #define EDI_FIRSTGROUPITEM      4
  1212. #define EDI_LASTGROUPITEM       5
  1213. #define EDI_NEXTGROUPITEM       6
  1214. #define EDI_PREVGROUPITEM       7
  1215. #endif /* INCL_SAADEFS */
  1216.  
  1217. /*** Dialog template definitions */
  1218.  
  1219. /* Variable-sized dialog template items: */
  1220.  
  1221. typedef struct _DLGTITEM {    /* dlgti */
  1222.     USHORT    fsItemStatus;
  1223.     USHORT    cChildren;
  1224.     USHORT    cchClassName;
  1225.     USHORT    offClassName;
  1226.     USHORT    cchText;
  1227.     USHORT    offText;
  1228.     ULONG     flStyle;
  1229.     SHORT     x;
  1230.     SHORT     y;
  1231.     SHORT     cx;
  1232.     SHORT     cy;
  1233.     USHORT    id;
  1234.     USHORT    offPresParams;
  1235.     USHORT    offCtlData;
  1236. } DLGTITEM;
  1237. typedef DLGTITEM FAR *PDLGTITEM;
  1238.  
  1239. /* Dialog Template structure */
  1240.  
  1241. typedef struct _DLGTEMPLATE {        /* dlgt */
  1242.     USHORT      cbTemplate;
  1243.     USHORT      type;
  1244.     USHORT      codepage;
  1245.     USHORT      offadlgti;          /* Is always 12 for Winthorn 1 */
  1246.     USHORT      fsTemplateStatus;
  1247.     USHORT      iItemFocus;
  1248.     USHORT      coffPresParams;     /* Reserved to be 0 for winthorn 1 */
  1249.     DLGTITEM    adlgti[1];
  1250. } DLGTEMPLATE;
  1251. typedef DLGTEMPLATE FAR *PDLGTEMPLATE;
  1252.  
  1253. HWND   APIENTRY WinCreateDlg(HWND hwndParent, HWND hwndOwner, PFNWP pfnDlgProc,
  1254.                              PDLGTEMPLATE pdlgt, PVOID pCreateParams);
  1255.  
  1256.  
  1257. #endif /* INCL_WINDIALOGS */
  1258.  
  1259.  
  1260. #ifdef INCL_WINSTATICS
  1261.  
  1262. /**** Static Control Manager */
  1263.  
  1264. /* Static control styles:
  1265.  *
  1266.  * NOTE: the top 9 bits of the LOWORD of the window flStyle are used for
  1267.  * DT_* flags.  The lower 7 bits are for SS_* styles.  This gives us up
  1268.  * to 128 distinct static control types (we currently use 11 of them).
  1269.  */
  1270. #define SS_TEXT             0x0001L
  1271. #define SS_GROUPBOX         0x0002L
  1272.  
  1273. #ifndef INCL_SAADEFS
  1274. #define SS_ICON             0x0003L
  1275. #define SS_BITMAP           0x0004L
  1276. #define SS_FGNDRECT         0x0005L
  1277. #define SS_HALFTONERECT     0x0006L
  1278. #define SS_BKGNDRECT        0x0007L
  1279. #define SS_FGNDFRAME        0x0008L
  1280. #define SS_HALFTONEFRAME    0x0009L 
  1281. #define SS_BKGNDFRAME       0x000aL
  1282. #define SS_SYSICON          0x000bL
  1283. #endif /* INCL_SAADEFS */
  1284.  
  1285. /* Static control class name */
  1286.  
  1287. #define WC_STATIC       ((PSZ)0xffff0005L)
  1288.  
  1289. /* Static control messages */
  1290.  
  1291. #ifndef INCL_SAADEFS
  1292. #define SM_SETHANDLE        0x0100
  1293. #define SM_QUERYHANDLE      0x0101
  1294. #endif /* INCL_SAADEFS */
  1295.  
  1296. #endif /* INCL_WINSTATICS */
  1297.  
  1298.  
  1299. #ifdef INCL_WINBUTTONS
  1300. /**** Button Controls Subsection */
  1301.  
  1302. /* Button control styles */
  1303.  
  1304. #define BS_PUSHBUTTON       0L
  1305. #define BS_CHECKBOX         1L
  1306. #define BS_AUTOCHECKBOX     2L
  1307. #define BS_RADIOBUTTON      3L
  1308. #define BS_AUTORADIOBUTTON  4L
  1309. #define BS_3STATE           5L
  1310. #define BS_AUTO3STATE       6L
  1311.  
  1312. #ifndef INCL_SAADEFS
  1313. #define BS_USERBUTTON       7L
  1314. #endif /* INCL_SAADEFS */
  1315.  
  1316. #define BS_HELP             0x0100L
  1317. #define BS_SYSCOMMAND       0x0200L
  1318. #define BS_DEFAULT          0x0400L
  1319. #define BS_NOPOINTERFOCUS   0x0800L
  1320. #define BS_NOBORDER         0x1000L
  1321.  
  1322.  
  1323. /* Button class name */
  1324.  
  1325. #define WC_BUTTON       ((PSZ)0xffff0003L)
  1326.  
  1327.  
  1328. #ifndef INCL_SAADEFS
  1329. typedef struct _BTNCDATA {    /* btncd */
  1330.     USHORT cb;
  1331.     USHORT fsCheckState;
  1332.     USHORT fsHiliteState;
  1333. } BTNCDATA;
  1334. typedef BTNCDATA FAR *PBTNCDATA;
  1335. #endif /* INCL_SAADEFS */
  1336.  
  1337. /* User button structure (passed in WM_CONTROL msg) */
  1338.  
  1339. #ifndef INCL_SAADEFS
  1340. typedef struct _USERBUTTON {  /* ubtn */
  1341.     HWND hwnd;
  1342.     HPS hps;
  1343.     USHORT fsState;
  1344.     USHORT fsStateOld;
  1345. } USERBUTTON;
  1346. typedef USERBUTTON FAR *PUSERBUTTON;
  1347. #endif /* INCL_SAADEFS */
  1348.  
  1349. /* Button control messages */
  1350.  
  1351. #define BM_CLICK            0x0120
  1352. #define BM_QUERYCHECKINDEX  0x0121
  1353. #define BM_QUERYHILITE      0x0122
  1354. #define BM_SETHILITE        0x0123
  1355. #define BM_QUERYCHECK       0x0124
  1356. #define BM_SETCHECK         0x0125
  1357. #define BM_SETDEFAULT       0x0126
  1358.  
  1359. /* Button notification codes */
  1360.  
  1361. #ifndef INCL_SAADEFS
  1362. #define BN_CLICKED          1
  1363. #define BN_DBLCLICKED       2
  1364. #define BN_PAINT            3
  1365. #endif /* INCL_SAADEFS */
  1366.  
  1367. /* BN_PAINT button draw state codes (must be in high byte) */
  1368.  
  1369. #ifndef INCL_SAADEFS
  1370. #define BDS_HILITED         0x0100
  1371. #define BDS_DISABLED        0x0200
  1372. #define BDS_DEFAULT         0x0400
  1373.  
  1374. #endif /* INCL_SAADEFS */
  1375.  
  1376. #endif /* INCL_WINBUTTONS */
  1377.  
  1378.  
  1379. #ifdef INCL_WINENTRYFIELDS
  1380. /**** Entryfield controls Subsection */
  1381.  
  1382. /* Entry field  styles */
  1383.  
  1384. #define ES_LEFT             0x00000000L
  1385. #define ES_CENTER           0x00000001L
  1386. #define ES_RIGHT            0x00000002L
  1387.  
  1388. #ifndef INCL_SAADEFS
  1389. #define ES_AUTOSCROLL       0x00000004L
  1390. #endif /* INCL_SAADEFS */
  1391.  
  1392. #define ES_MARGIN           0x00000008L
  1393.  
  1394. #define WC_ENTRYFIELD     ((PSZ)0xffff0006L)
  1395.  
  1396. #ifndef INCL_SAADEFS
  1397. typedef struct _ENTRYFDATA {       /* efd */
  1398.     USHORT cb;
  1399.     USHORT cchEditLimit;
  1400.     USHORT ichMinSel;
  1401.     USHORT ichMaxSel;
  1402. } ENTRYFDATA;
  1403.  
  1404. typedef ENTRYFDATA FAR *PENTRYFDATA;
  1405. #define EDITCDATA ENTRYFDATA
  1406. #define PEDITCDATA PENTRYFDATA
  1407. #endif /* INCL_SAADEFS */
  1408.  
  1409. /* Entry Field  messages */
  1410.  
  1411. #define EM_QUERYCHANGED     0x0140
  1412. #define EM_QUERYSEL         0x0141
  1413. #define EM_SETSEL           0x0142
  1414. #define EM_SETTEXTLIMIT     0x0143
  1415.  
  1416. #ifndef INCL_SAADEFS
  1417. #define EM_CUT              0x0144
  1418. #define EM_COPY             0x0145
  1419. #define EM_CLEAR            0x0146
  1420. #define EM_PASTE            0x0147
  1421. #define EM_QUERYFIRSTCHAR   0x0148
  1422. #define EM_SETFIRSTCHAR     0x0149
  1423. #endif /* INCL_SAADEFS */
  1424.  
  1425. /* Entry Field  notification messages */
  1426.  
  1427. #ifndef INCL_SAADEFS
  1428. #define EN_SETFOCUS         0x0001
  1429. #define EN_KILLFOCUS        0x0002
  1430. #define EN_CHANGE           0x0004
  1431. #define EN_SCROLL           0x0008
  1432. #define EN_MEMERROR         0x0010
  1433.  
  1434. #endif /* INCL_SAADEFS */
  1435.  
  1436. #endif /* INCL_WINENTRYFIELDS */
  1437.  
  1438.  
  1439. #ifdef INCL_WINLISTBOXES
  1440.  
  1441. /**** Listboxes */
  1442.  
  1443. /* List box styles */
  1444.  
  1445. #define LS_MULTIPLESEL      0x00000001L
  1446.  
  1447. #ifndef INCL_SAADEFS
  1448. #define LS_OWNERDRAW        0x00000002L
  1449. #endif /* INCL_SAADEFS */
  1450.  
  1451. #define LS_NOADJUSTPOS      0x00000004L
  1452.  
  1453.  
  1454. /* Listbox class name */
  1455.  
  1456. #define WC_LISTBOX      ((PSZ)0xffff0007L)
  1457.  
  1458. /* List box notification messages */
  1459.  
  1460. #ifndef INCL_SAADEFS
  1461. #define LN_SELECT           1
  1462. #define LN_SETFOCUS         2
  1463. #define LN_KILLFOCUS        3
  1464. #define LN_SCROLL           4
  1465. #define LN_ENTER            5
  1466.  
  1467. #endif /* INCL_SAADEFS */
  1468.  
  1469. /* List box messages */
  1470.  
  1471. #define LM_QUERYITEMCOUNT   0x0160
  1472. #define LM_INSERTITEM       0x0161
  1473. #define LM_SETTOPINDEX      0x0162
  1474. #define LM_DELETEITEM       0x0163
  1475. #define LM_SELECTITEM       0x0164
  1476. #define LM_QUERYSELECTION   0x0165
  1477. #define LM_SETITEMTEXT      0x0166
  1478. #define LM_QUERYITEMTEXTLENGTH 0x0167
  1479. #define LM_QUERYITEMTEXT    0x0168
  1480.  
  1481. #ifndef INCL_SAADEFS
  1482. #define LM_SETITEMHANDLE    0x0169
  1483. #define LM_QUERYITEMHANDLE  0x016a
  1484. #define LM_SEARCHSTRING     0x016b
  1485. #define LM_SETITEMHEIGHT    0x016c
  1486. #define LM_QUERYTOPINDEX    0x016d
  1487. #define LM_DELETEALL        0x016e
  1488. #endif /* INCL_SAADEFS */
  1489.  
  1490. /* List box constants */
  1491.  
  1492. #define LIT_ERROR            (-3)
  1493. #define LIT_MEMERROR         (-2)
  1494. #define LIT_NONE             (-1)
  1495. #define LIT_FIRST            (-1)
  1496.  
  1497. /* For LM_INSERTITEM msg     */
  1498.  
  1499. #define LIT_END              (-1)
  1500. #define LIT_SORTASCENDING    (-2)
  1501. #define LIT_SORTDESCENDING   (-3)
  1502.  
  1503. /* For LM_SEARCHSTRING msg     */
  1504.  
  1505. #define LSS_SUBSTRING       0x0001
  1506. #define LSS_PREFIX          0x0002
  1507. #define LSS_CASESENSITIVE   0x0004
  1508.  
  1509.  
  1510. #endif /* INCL_WINLISTBOXES */
  1511.  
  1512.  
  1513. #ifdef INCL_WINMENUS
  1514.  
  1515. /**** Menu Manager Subsection */
  1516.  
  1517. /* Menu control styles */
  1518.  
  1519. #define MS_ACTIONBAR        0x00000001L
  1520. #define MS_TITLEBUTTON      0x00000002L
  1521. #define MS_VERTICALFLIP     0x00000004L
  1522.  
  1523. HWND APIENTRY WinLoadMenu(HWND, HMODULE, USHORT);
  1524.  
  1525. /* Menu class name */
  1526.  
  1527. #define WC_MENU         ((PSZ)0xffff0004L)
  1528.  
  1529. /* Menu control messages */
  1530.  
  1531. #define MM_INSERTITEM           0x0180
  1532. #define MM_DELETEITEM           0x0181
  1533. #define MM_QUERYITEM            0x0182
  1534. #define MM_SETITEM              0x0183
  1535. #define MM_QUERYITEMCOUNT       0x0184
  1536. #define MM_STARTMENUMODE        0x0185
  1537. #define MM_ENDMENUMODE          0x0186
  1538. #define MM_DISMISSMENU          0x0187
  1539. #define MM_REMOVEITEM           0x0188
  1540. #define MM_SELECTITEM           0x0189
  1541. #define MM_QUERYSELITEMID       0x018a
  1542. #define MM_QUERYITEMTEXT        0x018b
  1543. #define MM_QUERYITEMTEXTLENGTH  0x018c
  1544. #define MM_SETITEMHANDLE        0x018d
  1545. #define MM_SETITEMTEXT          0x018e
  1546. #define MM_ITEMPOSITIONFROMID   0x018f
  1547. #define MM_ITEMIDFROMPOSITION   0x0190
  1548. #define MM_QUERYITEMATTR        0x0191
  1549. #define MM_SETITEMATTR          0x0192
  1550. #define MM_ISITEMVALID          0x0193
  1551.  
  1552. HWND APIENTRY WinCreateMenu(HWND, PVOID);
  1553.  
  1554. /* Owner Item Structure (Also used for listboxes) */
  1555.  
  1556. #ifndef INCL_SAADEFS
  1557. typedef struct _OWNERITEM {   /* oi */
  1558.     HWND    hwnd;
  1559.     HPS     hps;
  1560.     USHORT  fsState;
  1561.     USHORT  fsStateOld;
  1562.     RECTL   rclItem;
  1563.     SHORT   idItem; /* This field contains idItem for menus, iItem for lb. */
  1564.     ULONG   hItem;
  1565. } OWNERITEM;
  1566. typedef OWNERITEM FAR *POWNERITEM;
  1567. #endif /* INCL_SAADEFS */
  1568.  
  1569. /* Menu item */
  1570.  
  1571. typedef struct _MENUITEM {    /* mi */
  1572.     SHORT     iPosition;
  1573.     USHORT    afStyle;
  1574.     USHORT    id;
  1575.     HWND    hwndSubMenu;
  1576.     ULONG   hItem;
  1577. } MENUITEM;
  1578. typedef MENUITEM FAR *PMENUITEM;
  1579.  
  1580. #define MIT_END         (-1)
  1581. #define MIT_NONE        (-1)
  1582. #define MIT_MEMERROR    (-1)
  1583. #define MIT_ERROR       (-1)
  1584. #define MID_NONE        MIT_NONE
  1585. #define MID_ERROR       (-1)
  1586.  
  1587. /* Menu item styles & attributes */
  1588.  
  1589. #define MIS_TEXT            0x0001
  1590.  
  1591. #ifndef INCL_SAADEFS
  1592. #define MIS_BITMAP          0x0002
  1593. #endif /* INCL_SAADEFS */
  1594. #define MIS_SEPARATOR       0x0004
  1595.  
  1596. #ifndef INCL_SAADEFS
  1597. #define MIS_OWNERDRAW       0x0008
  1598. #endif /* INCL_SAADEFS */
  1599.  
  1600. #define MIS_SUBMENU         0x0010
  1601. #define MIS_NODISMISS       0x0020
  1602. #define MIS_SYSCOMMAND      0x0040
  1603. #define MIS_HELP            0x0080
  1604. #define MIS_STATIC          0x0100
  1605. #define MIS_BUTTONSEPARATOR 0x0200
  1606. #define MIS_BREAK           0x0400
  1607. #define MIS_BREAKSEPARATOR  0x0800
  1608.  
  1609.  
  1610. #define MIA_FRAMED          0x1000
  1611. #define MIA_CHECKED         0x2000
  1612. #define MIA_DISABLED        0x4000
  1613. #define MIA_HILITED         0x8000
  1614.  
  1615. #endif /* INCL_WINMENUS */
  1616.  
  1617.  
  1618. #ifdef INCL_WINSCROLLBARS
  1619.  
  1620. /*** Scroll Bar controls Subsection */
  1621.  
  1622. /* Scroll Bar styles */
  1623.  
  1624. #define SBS_HORZ            0L
  1625. #define SBS_VERT            1L
  1626.  
  1627. /* Scroll bar class name */
  1628.  
  1629.  
  1630. #define WC_SCROLLBAR    ((PSZ)0xffff0008L)
  1631.  
  1632. /* Scroll Bar messages */
  1633.  
  1634. #define SBM_SETSCROLLBAR    0x01a0
  1635. #define SBM_SETPOS          0x01a1
  1636. #define SBM_QUERYPOS        0x01a2
  1637. #define SBM_QUERYRANGE      0x01a3
  1638. #define SBM_SETHILITE       0x01a4
  1639. #define SBM_QUERYHILITE     0x01a5
  1640.  
  1641. /* Scroll Bar Commands */
  1642.  
  1643. #define SB_LINEUP           1
  1644. #define SB_LINEDOWN         2
  1645. #define SB_LINELEFT         1
  1646. #define SB_LINERIGHT        2
  1647. #define SB_PAGEUP           3
  1648. #define SB_PAGEDOWN         4
  1649. #define SB_PAGELEFT         3
  1650. #define SB_PAGERIGHT        4
  1651. #define SB_SLIDERTRACK      5
  1652. #define SB_SLIDERPOSITION   6
  1653. #define SB_ENDSCROLL        7
  1654.  
  1655.  
  1656. #ifndef INCL_SAADEFS
  1657. typedef struct _SBCDATA {     /* sbcd */
  1658.     USHORT cb;
  1659.     USHORT sHilite;         /* reserved, should be set to zero */
  1660.     SHORT posFirst;
  1661.     SHORT posLast;
  1662.     SHORT posThumb;
  1663. } SBCDATA;
  1664. typedef SBCDATA FAR *PSBCDATA;
  1665. #endif /* INCL_SAADEFS */
  1666.  
  1667. #endif /* INCL_WINSCROLLBARS */
  1668.  
  1669.  
  1670. #ifdef INCL_WINFRAMEMGR
  1671. /*** Frame Manager Common subsection */
  1672.  
  1673. /* Frame window styles */
  1674.  
  1675. #define FCF_TITLEBAR    0x00000001L
  1676. #define FCF_SYSMENU     0x00000002L
  1677. #define FCF_MENU        0x00000004L
  1678. #define FCF_SIZEBORDER  0x00000008L
  1679. #define FCF_MINBUTTON   0x00000010L  
  1680. #define FCF_MAXBUTTON   0x00000020L
  1681. #define FCF_MINMAX      0x00000030L     /* minmax means both buttons */
  1682. #define FCF_VERTSCROLL  0x00000040L
  1683. #define FCF_HORZSCROLL  0x00000080L
  1684. /* FCF_TITLEBAR | FCF_SYSMENU | FCF_MENU | FCF_SIZEBORDER | FCF_MINMAX */
  1685. #define FCF_STANDARD    0x0000003FL
  1686.  
  1687.  
  1688. #define FS_ICON             0x00000001L
  1689. #define FS_ACCELTABLE       0x00000002L
  1690.  
  1691. #ifndef INCL_SAADEFS
  1692. #define FS_SHELLPOSITION    0x00000004L
  1693. #endif /* INCL_SAADEFS */
  1694.  
  1695. #define FS_TASKLIST         0x00000008L
  1696. #define FS_NOBYTEALIGN      0x00000010L
  1697. #define FS_NOMOVEWITHOWNER  0x00000020L
  1698. #define FS_SYSMODAL         0x00000040L
  1699. #define FS_DLGBORDER        0x00000080L
  1700. #define FS_BORDER           0x00000100L
  1701. #define FS_SCREENALIGN      0x00000200L
  1702. #define FS_MOUSEALIGN       0x00000400L
  1703.  
  1704. /* FS_ICON | FS_ACCELTABLE | FS_SHELLPOSITION | FS_TASKLIST */
  1705. #define FS_STANDARD         0x0000000FL
  1706.  
  1707.  
  1708. /* Frame Window Flags accessed via WinSet/QueryWindowUShort(QWS_FLAGS) */
  1709.  
  1710. #ifndef INCL_SAADEFS
  1711. #define FF_FLASHWINDOW      0x0001  
  1712. #define FF_ACTIVE           0x0002
  1713. #define FF_FLASHHILITE      0x0004
  1714. #define FF_OWNERHIDDEN      0x0008
  1715. #define FF_DLGDISMISSED     0x0010
  1716. #define FF_OWNERDISABLED    0x0020
  1717. #define FF_SELECTED         0x0040
  1718. #endif /* INCL_SAADEFS */
  1719.  
  1720.  
  1721. HWND  APIENTRY WinCreateStdWindow(HWND hwndParent, ULONG flStyle,
  1722.         PVOID pCtlData, PSZ pszClientClass, PSZ pszTitle,
  1723.         ULONG styleClient, HMODULE hmod, USHORT idResources,
  1724.         PHWND phwndClient);
  1725.  
  1726.  
  1727. #endif /* Frame Manager Common subsection */
  1728.  
  1729.  
  1730. #ifdef INCL_WINFRAMEMGR
  1731.  
  1732. #ifndef INCL_SAADEFS
  1733. BOOL  APIENTRY WinFlashWindow(HWND hwndFrame, BOOL fFlash);
  1734. #endif /* INCL_SAADEFS */
  1735.  
  1736. /* Frame window related messages */
  1737.  
  1738. #ifndef INCL_SAADEFS
  1739. #define WM_FLASHWINDOW      0x0040
  1740. #define WM_FORMATFRAME      0x0041
  1741. #define WM_UPDATEFRAME      0x0042
  1742. #define WM_FOCUSCHANGE      0x0043
  1743.  
  1744. #define WM_MINMAXFRAME      0x0046
  1745. #define WM_SETICON          0x0047
  1746. #define WM_QUERYICON        0x0048
  1747. #define WM_SETACCELTABLE    0x0049
  1748. #define WM_QUERYACCELTABLE  0x004a
  1749. #define WM_TRANSLATEACCEL   0x004b
  1750. #define WM_QUERYTRACKINFO   0x004c
  1751. #define WM_QUERYBORDERSIZE  0x004d
  1752. #define WM_NEXTMENU         0x004e
  1753. #define WM_ERASEBACKGROUND  0x004f
  1754. #define WM_QUERYFRAMEINFO   0x0050
  1755.  
  1756.  
  1757. /* WM_QUERYFRAMEINFO constants */
  1758.  
  1759. #define FI_FRAME            0x00000001L
  1760. #define FI_OWNERHIDE        0x00000002L
  1761. #define FI_ACTIVATEOK       0x00000004L
  1762. #define FI_NOMOVEWITHOWNER  0x00000008L
  1763.  
  1764.  
  1765. #endif /* INCL_SAADEFS */
  1766.  
  1767. /* Frame class name */
  1768.  
  1769. #define WC_FRAME        ((PSZ)0xffff0001L)
  1770.  
  1771. #ifndef INCL_SAADEFS
  1772. BOOL  APIENTRY WinCreateFrameControls(HWND hwndFrame, ULONG flStyle,
  1773.                                       PSZ pszTitle, HMODULE hmod);
  1774. SHORT APIENTRY WinFormatFrame(HWND hwndFrame, PRECTL prclFrame, PSWP pswp,
  1775.                               SHORT cswpMax, PRECTL prclClient);
  1776. #endif /* INCL_SAADEFS */
  1777.  
  1778. BOOL  APIENTRY WinCalcFrameRect(HWND hwndFrame, PRECTL prcl, BOOL fClient);
  1779.  
  1780. #ifndef INCL_SAADEFS
  1781. BOOL  APIENTRY WinGetMinPosition(HWND hwnd, PSWP pswp, PPOINTL pptl);
  1782. BOOL  APIENTRY WinGetMaxPosition(HWND hwnd, PSWP pswp);
  1783. #endif /* INCL_SAADEFS */
  1784.  
  1785. /* Frame control IDs    */
  1786.  
  1787. #define FID_SIZEBORDER      0x8001
  1788. #define FID_SYSMENU         0x8002
  1789. #define FID_TITLEBAR        0x8003
  1790. #define FID_MINMAX          0x8004
  1791. #define FID_MENU            0x8005
  1792. #define FID_VERTSCROLL      0x8006
  1793. #define FID_HORZSCROLL      0x8007
  1794. #define FID_CLIENT          0x8008
  1795.  
  1796. /* Standard WM_SYSCOMMAND command values */
  1797.  
  1798. #ifndef INCL_SAADEFS
  1799. #define SC_SIZE             1
  1800. #define SC_MOVE             2
  1801. #define SC_MINIMIZE         3
  1802. #define SC_MAXIMIZE         4
  1803. #define SC_CLOSE            5
  1804. #define SC_NEXT             6
  1805. #define SC_APPMENU          7
  1806. #define SC_SYSMENU          8
  1807. #define SC_RESTORE          9
  1808. #define SC_NEXTFRAME       10
  1809. #define SC_NEXTWINDOW      11
  1810. #define SC_TASKMANAGER     12
  1811.  
  1812. #endif /* INCL_SAADEFS */
  1813.  
  1814. #endif /* INCL_WINFRAMEMGR */
  1815.  
  1816. /*** Frame controls */
  1817.  
  1818. /** Size border controls */
  1819.  
  1820. #ifdef INCL_WINFRAMECTLS
  1821.  
  1822. /* Size control class name */
  1823.  
  1824. #define WC_SIZEBORDER       ((PSZ)0xffff000aL)
  1825.  
  1826. /* Size control messages */
  1827.  
  1828. #ifndef INCL_SAADEFS
  1829. #define SZM_TRACKSIZE       0x01c0
  1830. #define SZM_SETBORDERSIZE   0x01c1
  1831. #define SZM_QUERYBORDERSIZE 0x01c2
  1832. #define SZM_SETHILITE       0x01c3
  1833. #define SZM_QUERYHILITE     0x01c4
  1834. #endif /* INCL_SAADEFS */
  1835.  
  1836. /** Title bar controls */
  1837.  
  1838. /* Title bar control class name */
  1839.  
  1840. #define WC_TITLEBAR     ((PSZ)0xffff0009L)
  1841.  
  1842. /* Title bar control messages */
  1843.  
  1844. #ifndef INCL_SAADEFS
  1845. #define TBM_TRACKMOVE           0x01e0
  1846. #define TBM_QUERYICONTEXTWINDOW 0x01e1
  1847. #define TBM_SHOWICONTEXT        0x01e2
  1848. #define TBM_SETHILITE           0x01e3
  1849. #define TBM_QUERYHILITE         0x01e4
  1850. #endif /* INCL_SAADEFS */
  1851.  
  1852. #endif /* INCL_WINFRAMECTLS */
  1853.  
  1854. #ifdef INCL_WINRECTANGLES
  1855. /*** Rectangle routines */
  1856.  
  1857. #ifndef INCL_SAADEFS
  1858. BOOL APIENTRY WinSetRect(HAB hab, PRECTL prcl, SHORT xLeft, SHORT yBottom,
  1859.                          SHORT xRight, SHORT yTop);
  1860. BOOL APIENTRY WinIsRectEmpty(HAB hab, PRECTL prcl);
  1861. BOOL APIENTRY WinCopyRect(HAB hab, PRECTL prclDst, PRECTL prclSrc);
  1862. BOOL APIENTRY WinEqualRect(HAB hab, PRECTL prcl1, PRECTL prcl2);
  1863. BOOL APIENTRY WinSetRectEmpty(HAB hab, PRECTL prcl);
  1864. BOOL APIENTRY WinOffsetRect(HAB hab, PRECTL prcl, SHORT cx, SHORT cy);
  1865. BOOL APIENTRY WinInflateRect(HAB hab, PRECTL prcl, SHORT cx, SHORT cy);
  1866. BOOL APIENTRY WinPtInRect(HAB hab, PRECTL prcl, PPOINTL pptl);
  1867. BOOL APIENTRY WinIntersectRect(HAB hab, PRECTL prclDst, PRECTL prclSrc1,
  1868.                                PRECTL prclSrc2);
  1869. BOOL APIENTRY WinUnionRect(HAB hab, PRECTL prclDst, PRECTL prclSrc1,
  1870.                            PRECTL prclSrc2);
  1871. BOOL APIENTRY WinSubtractRect(HAB hab, PRECTL prclDst, PRECTL prclSrc1,
  1872.                               PRECTL prclSrc2);
  1873. BOOL APIENTRY WinMakeRect(HAB hab, PWRECT pwrc);
  1874. BOOL APIENTRY WinMakePoints(HAB hab, PWPOINT pwpt, SHORT cwpt);
  1875. #endif /* INCL_SAADEFS */
  1876.  
  1877. #endif /* INCL_WINRECTANGLES */
  1878.  
  1879.  
  1880. #ifdef INCL_WINSYS
  1881.  
  1882. /*** System values */
  1883.  
  1884. LONG APIENTRY WinQuerySysValue(HWND hwndDesktop, SHORT iSysValue);
  1885. BOOL  APIENTRY WinSetSysValue(HWND hwndDesktop, SHORT iSysValue, LONG lValue);
  1886.  
  1887. #define SV_SWAPBUTTON       0
  1888. #define SV_DBLCLKTIME       1
  1889. #define SV_CXDBLCLK         2
  1890. #define SV_CYDBLCLK         3
  1891. #define SV_CXSIZEBORDER     4
  1892. #define SV_CYSIZEBORDER     5
  1893. #define SV_ALARM            6
  1894.  
  1895. #ifndef INCL_SAADEFS
  1896. #define SV_RESERVEDFIRST1   7
  1897. #define SV_RESERVEDLAST1    8
  1898. #endif /* INCL_SAADEFS */
  1899.  
  1900. #define SV_CURSORRATE       9
  1901. #define SV_FIRSTSCROLLRATE  10
  1902. #define SV_SCROLLRATE       11
  1903. #define SV_NUMBEREDLISTS    12
  1904. #define SV_WARNINGFREQ      13
  1905. #define SV_NOTEFREQ         14
  1906. #define SV_ERRORFREQ        15
  1907. #define SV_WARNINGDURATION  16
  1908. #define SV_NOTEDURATION     17
  1909. #define SV_ERRORDURATION    18
  1910.  
  1911. #ifndef INCL_SAADEFS
  1912. #define SV_RESERVEDFIRST    19
  1913. #define SV_RESERVEDLAST     19
  1914. #endif /* INCL_SAADEFS */
  1915.  
  1916. #define SV_CXSCREEN         20
  1917. #define SV_CYSCREEN         21
  1918. #define SV_CXVSCROLL        22
  1919. #define SV_CYHSCROLL        23
  1920. #define SV_CYVSCROLLARROW   24
  1921. #define SV_CXHSCROLLARROW   25
  1922. #define SV_CXBORDER         26
  1923. #define SV_CYBORDER         27
  1924. #define SV_CXDLGFRAME       28
  1925. #define SV_CYDLGFRAME       29
  1926. #define SV_CYTITLEBAR       30
  1927. #define SV_CYVSLIDER        31
  1928. #define SV_CXHSLIDER        32
  1929. #define SV_CXMINMAXBUTTON   33
  1930. #define SV_CYMINMAXBUTTON   34
  1931. #define SV_CYMENU           35
  1932. #define SV_CXFULLSCREEN     36
  1933. #define SV_CYFULLSCREEN     37
  1934. #define SV_CXICON           38
  1935. #define SV_CYICON           39
  1936. #define SV_CXPOINTER        40
  1937. #define SV_CYPOINTER        41
  1938.  
  1939. #define SV_DEBUG            42
  1940. #define SV_CMOUSEBUTTONS    43
  1941. #define SV_POINTERLEVEL     44
  1942. #define SV_CURSORLEVEL      45
  1943. #define SV_TRACKRECTLEVEL   46
  1944.  
  1945. #ifndef INCL_SAADEFS
  1946. #define SV_CTIMERS          47
  1947. #endif /* INCL_SAADEFS */
  1948.  
  1949. #define SV_MOUSEPRESENT     48
  1950.  
  1951. #define SV_CXBYTEALIGN      49
  1952. #define SV_CYBYTEALIGN      50
  1953.  
  1954. #define SV_CSYSVALUES       51
  1955.  
  1956.  
  1957. /*** System color functions */
  1958.  
  1959.  
  1960. #ifndef INCL_SAADEFS
  1961. LONG APIENTRY WinQuerySysColor(HWND hwndDesktop, LONG iColor, LONG lReserved);
  1962. BOOL APIENTRY WinSetSysColors(HWND hwndDesktop, ULONG flOptions,
  1963.                               ULONG flFormat, LONG clrFirst, ULONG cclr,
  1964.                               PLONG pclr);
  1965.  
  1966. #define SYSCLR_WINDOWSTATICTEXT   (-26L)
  1967. #define SYSCLR_SCROLLBAR          (-25L)
  1968. #define SYSCLR_BACKGROUND         (-24L)
  1969. #define SYSCLR_ACTIVETITLE        (-23L)
  1970. #define SYSCLR_INACTIVETITLE      (-22L)
  1971. #define SYSCLR_MENU               (-21L)
  1972. #define SYSCLR_WINDOW             (-20L)
  1973. #define SYSCLR_WINDOWFRAME        (-19L)
  1974. #define SYSCLR_MENUTEXT           (-18L)
  1975. #define SYSCLR_WINDOWTEXT         (-17L)
  1976. #define SYSCLR_TITLETEXT          (-16L)
  1977. #define SYSCLR_ACTIVEBORDER       (-15L)
  1978. #define SYSCLR_INACTIVEBORDER     (-14L)
  1979. #define SYSCLR_APPWORKSPACE       (-13L)
  1980. #define SYSCLR_HELPBACKGROUND     (-12L)
  1981. #define SYSCLR_HELPTEXT           (-11L)
  1982. #define SYSCLR_HELPHILITE         (-10L) /* assumed by ColorInit() */
  1983. #define SYSCLR_CSYSCOLORS         17L
  1984. #endif /* INCL_SAADEFS */
  1985.  
  1986. #endif /* INCL_WINSYS */
  1987.  
  1988.  
  1989. #ifdef INCL_WINTIMER
  1990. /**** Timer manager */
  1991.  
  1992. #ifndef INCL_SAADEFS
  1993. USHORT APIENTRY WinStartTimer(HAB hab, HWND hwnd, USHORT idTimer,
  1994.                               USHORT dtTimeout);
  1995. BOOL   APIENTRY WinStopTimer(HAB hab, HWND hwnd, USHORT idTimer);
  1996. ULONG  APIENTRY WinGetCurrentTime(HAB hab);
  1997.  
  1998. #define TID_CURSOR          0xffff  /* Reserved cursor timer ID */
  1999. #define TID_SCROLL          0xfffe  /* Reserved scrolling timer ID */
  2000. #define TID_FLASHWINDOW     0xfffd  /* Reserved for window flashing timer ID */
  2001. #endif /* INCL_SAADEFS */
  2002.  
  2003. #endif /* INCL_WINTIMER */
  2004.  
  2005.  
  2006. #ifdef INCL_WINACCELERATORS
  2007. /**** Accelerator functions */
  2008.  
  2009. /* ACCEL fs bits
  2010.  *
  2011.  * NOTE: the first six AF_ code bits have the same value
  2012.  * as their KC_ counterparts
  2013.  */
  2014. #ifndef INCL_SAADEFS
  2015. #define AF_CHAR         0x0001
  2016. #define AF_VIRTUALKEY   0x0002
  2017. #define AF_SCANCODE     0x0004
  2018. #define AF_SHIFT        0x0008
  2019. #define AF_CONTROL      0x0010
  2020. #define AF_ALT          0x0020
  2021. #define AF_LONEKEY      0x0040
  2022. #define AF_SYSCOMMAND   0x0100
  2023. #define AF_HELP         0x0200
  2024.  
  2025.  
  2026. typedef LHANDLE HACCEL; /* haccel */
  2027.  
  2028. typedef struct _ACCEL {       /* acc */
  2029.     USHORT fs;
  2030.     USHORT key;
  2031.     USHORT cmd;
  2032. } ACCEL;
  2033. typedef ACCEL FAR *PACCEL;
  2034.  
  2035. typedef struct _ACCELTABLE {  /* acct  */
  2036.     USHORT cAccel;
  2037.     USHORT codepage;
  2038.     ACCEL aaccel[1];
  2039. } ACCELTABLE;
  2040. typedef ACCELTABLE FAR *PACCELTABLE;
  2041.  
  2042. HACCEL APIENTRY WinLoadAccelTable(HAB hab, HMODULE hmod, USHORT idAccelTable);
  2043. HACCEL APIENTRY WinCreateAccelTable(HAB hab, PACCELTABLE pAccelTable);
  2044. BOOL   APIENTRY WinDestroyAccelTable(HACCEL haccel);
  2045. USHORT APIENTRY WinCopyAccelTable(HACCEL haccel, PACCELTABLE pAccelTable,
  2046.                                   USHORT cbCopyMax);
  2047. BOOL   APIENTRY WinTranslateAccel(HAB hab, HWND hwnd, HACCEL haccel,
  2048.                                   PQMSG pqmsg);
  2049. BOOL   APIENTRY WinSetAccelTable(HAB hab, HACCEL haccel, HWND hwndFrame);
  2050. HACCEL APIENTRY WinQueryAccelTable(HAB hab, HWND hwndFrame);
  2051. #endif /* INCL_SAADEFS */
  2052.  
  2053. #endif /* INCL_WINACCELERATORS */
  2054.  
  2055.  
  2056. /*** WinTrackRect() stuff */
  2057.  
  2058. #ifdef INCL_WINTRACKRECT
  2059.  
  2060. /* WinTrackRect() tracking information structure */
  2061.  
  2062. typedef struct _TRACKINFO {   /* ti */
  2063.     SHORT  cxBorder;
  2064.     SHORT  cyBorder;
  2065.     SHORT  cxGrid;
  2066.     SHORT  cyGrid;
  2067.     SHORT  cxKeyboard;
  2068.     SHORT  cyKeyboard;
  2069.     RECTL  rclTrack;
  2070.     RECTL  rclBoundary;
  2071.     POINTL ptlMinTrackSize;
  2072.     POINTL ptlMaxTrackSize;
  2073.     USHORT fs;
  2074. } TRACKINFO;
  2075. typedef TRACKINFO FAR *PTRACKINFO;
  2076.  
  2077. #ifndef INCL_SAADEFS
  2078. BOOL APIENTRY WinTrackRect(HWND hwnd, HPS hps, PTRACKINFO pti);
  2079. BOOL APIENTRY WinShowTrackRect(HWND hwnd, BOOL fShow);
  2080.  
  2081. /* WinTrackRect() flags */
  2082.  
  2083. #define TF_LEFT              0x0001
  2084. #define TF_TOP               0x0002
  2085. #define TF_RIGHT             0x0004
  2086. #define TF_BOTTOM            0x0008
  2087. /* TF_MOVE = TF_LEFT | TF_TOP | TF_RIGHT | TF_BOTTOM */
  2088. #define TF_MOVE              0x000F
  2089.  
  2090. #define TF_SETPOINTERPOS     0x0010
  2091. #define TF_GRID              0x0020
  2092. #define TF_STANDARD          0x0040
  2093. #define TF_ALLINBOUNDARY     0x0080
  2094. #define TF_VALIDATETRACKRECT 0x0100
  2095.  
  2096. #endif /* INCL_SAADEFS */
  2097.  
  2098. #endif /* INCL_WINTRACKRECT */
  2099.  
  2100.  
  2101. /**** Clipboard Manager */
  2102.  
  2103. #ifdef INCL_WINCLIPBOARD
  2104.  
  2105. /* Clipboard messages */
  2106.  
  2107. #ifndef INCL_SAADEFS
  2108. #define WM_RENDERFMT        0x0060
  2109. #define WM_RENDERALLFMTS    0x0061
  2110. #define WM_DESTROYCLIPBOARD 0x0062
  2111. #define WM_PAINTCLIPBOARD   0x0063
  2112. #define WM_SIZECLIPBOARD    0x0064
  2113. #define WM_HSCROLLCLIPBOARD 0x0065
  2114. #define WM_VSCROLLCLIPBOARD 0x0066
  2115. #define WM_DRAWCLIPBOARD    0x0067
  2116.  
  2117. /* Standard Clipboard formats */
  2118.  
  2119. #define CF_TEXT             1
  2120. #define CF_BITMAP           2
  2121. #define CF_DSPTEXT          3
  2122. #define CF_DSPBITMAP        4
  2123. #define CF_METAFILE         5
  2124. #define CF_DSPMETAFILE      6
  2125.  
  2126. BOOL   APIENTRY WinOpenClipbrd(HAB hab);
  2127. BOOL   APIENTRY WinCloseClipbrd(HAB hab);
  2128. BOOL   APIENTRY WinEmptyClipbrd(HAB hab);
  2129. BOOL   APIENTRY WinSetClipbrdOwner(HAB hab, HWND hwnd);
  2130. HWND   APIENTRY WinQueryClipbrdOwner(HAB hab, BOOL fLock);
  2131. BOOL   APIENTRY WinSetClipbrdData(HAB hab, ULONG ulData, USHORT fmt, USHORT rgfFmtInfo);
  2132. ULONG  APIENTRY WinQueryClipbrdData(HAB hab, USHORT fmt);
  2133. USHORT APIENTRY WinEnumClipbrdFmts(HAB hab, USHORT fmt);
  2134. BOOL   APIENTRY WinQueryClipbrdFmtInfo(HAB hab, USHORT fmt,
  2135.                                        PUSHORT prgfFmtInfo);
  2136. BOOL   APIENTRY WinSetClipbrdViewer(HAB hab, HWND hwndNewClipViewer);
  2137. HWND   APIENTRY WinQueryClipbrdViewer(HAB hab, BOOL fLock);
  2138.  
  2139. /* WinSetClipbrdData() flags */
  2140.  
  2141. #define CFI_OWNERFREE       0x0001
  2142. #define CFI_OWNERDISPLAY    0x0002
  2143. #define CFI_SELECTOR        0x0100
  2144. #define CFI_HANDLE          0x0200
  2145.  
  2146.  
  2147. #endif /* INCL_SAADEFS */
  2148.  
  2149. #endif /* INCL_WINCLIPBOARD */
  2150.  
  2151.  
  2152. #ifdef INCL_WINCURSORS
  2153. /**** Cursor manager common subsection */
  2154.  
  2155. #ifndef INCL_SAADEFS
  2156. BOOL APIENTRY WinDestroyCursor(HWND hwnd);
  2157. BOOL APIENTRY WinShowCursor(HWND hwnd, BOOL fShow);
  2158. BOOL APIENTRY WinCreateCursor(HWND hwnd, SHORT x, SHORT y, SHORT cx, SHORT cy,
  2159.                               USHORT fs, PRECTL prclClip);
  2160.  
  2161. /* WinCreateCursor() flags */
  2162.  
  2163. #define CURSOR_SOLID     0x0000
  2164. #define CURSOR_HALFTONE  0x0001
  2165. #define CURSOR_FRAME     0x0002
  2166. #define CURSOR_FLASH     0x0004
  2167. #define CURSOR_SETPOS    0x8000
  2168.  
  2169. #endif /* INCL_SAADEFS */
  2170.  
  2171. #endif /* Cursor manager common subsection */
  2172.  
  2173. #ifdef INCL_WINCURSORS
  2174.  
  2175. #ifndef INCL_SAADEFS
  2176. typedef struct _CURSORINFO {   /* csri */
  2177.     HWND   hwnd;
  2178.     SHORT  x;
  2179.     SHORT  y;
  2180.     SHORT  cx;
  2181.     SHORT  cy;
  2182.     USHORT fs;
  2183.     RECTL  rclClip;
  2184. } CURSORINFO;
  2185. typedef CURSORINFO FAR *PCURSORINFO;
  2186.  
  2187. BOOL APIENTRY WinQueryCursorInfo(HWND hwndDesktop, PCURSORINFO pCursorInfo);
  2188. #endif /* INCL_SAADEFS */
  2189.  
  2190. #endif /* INCL_WINCURSORS */
  2191.  
  2192.  
  2193. #ifdef INCL_WINPOINTERS
  2194. /**** Pointer manager */
  2195.  
  2196. typedef LHANDLE HPOINTER;   /* HPOINTER */
  2197.  
  2198. BOOL     APIENTRY WinSetPointer(HWND hwndDesktop, HPOINTER hptrNew);
  2199. BOOL     APIENTRY WinShowPointer(HWND hwndDesktop, BOOL fShow);
  2200.  
  2201. #ifndef INCL_SAADEFS
  2202. HPOINTER APIENTRY WinQuerySysPointer(HWND hwndDesktop, SHORT iptr, BOOL fLoad);
  2203.  
  2204.  
  2205. /* System pointers (NOTE: these are 1-based) */
  2206.  
  2207. /* The following pointers are loaded by pmwin */
  2208. #define SPTR_ARROW            1
  2209. #define SPTR_TEXT             2
  2210. #define SPTR_WAIT             3
  2211. #define SPTR_SIZE             4
  2212. #define SPTR_MOVE             5
  2213. #define SPTR_SIZENWSE         6
  2214. #define SPTR_SIZENESW         7
  2215. #define SPTR_SIZEWE           8
  2216. #define SPTR_SIZENS           9
  2217. #define SPTR_APPICON          10
  2218. #define SPTR_HANDICON         11
  2219. #define SPTR_QUESICON         12
  2220. #define SPTR_BANGICON         13
  2221. #define SPTR_NOTEICON         14
  2222. #define SPTR_CPTR             14    /* count loaded by pmwin */
  2223.  
  2224. /* The following pointers are loaded by pmwin */
  2225. #define SPTR_ILLEGAL          18
  2226. #define SPTR_FILE             19
  2227. #define SPTR_FOLDER           20
  2228. #define SPTR_MULTFILE         21
  2229. #define SPTR_PROGRAM          22
  2230.  
  2231. #endif /* INCL_SAADEFS */
  2232.  
  2233. #ifndef INCL_SAADEFS
  2234. HPOINTER APIENTRY WinLoadPointer(HWND hwndDesktop, HMODULE hmod, USHORT idres);
  2235. HPOINTER APIENTRY WinCreatePointer(HWND hwndDesktop, HBITMAP hbmPointer,
  2236.                                    BOOL fPointer, SHORT xHotspot,
  2237.                                    SHORT yHotspot);
  2238. BOOL     APIENTRY WinDestroyPointer(HPOINTER hptr);
  2239. #endif /* INCL_SAADEFS */
  2240.  
  2241. HPOINTER APIENTRY WinQueryPointer(HWND hwndDesktop);
  2242. BOOL     APIENTRY WinSetPointerPos(HWND hwndDesktop, SHORT x, SHORT y);
  2243. BOOL     APIENTRY WinQueryPointerPos(HWND hwndDesktop, PPOINTL pptl);
  2244.  
  2245. #ifndef INCL_SAADEFS
  2246. typedef struct _POINTERINFO {  /* ptri */
  2247.     BOOL fPointer;
  2248.     SHORT xHotspot;
  2249.     SHORT yHotspot;
  2250.     HBITMAP hbmPointer;
  2251. } POINTERINFO;
  2252. typedef POINTERINFO FAR *PPOINTERINFO;
  2253.  
  2254. BOOL     APIENTRY WinQueryPointerInfo(HPOINTER hptr,
  2255.                                       PPOINTERINFO pPointerInfo);
  2256.  
  2257. BOOL     APIENTRY WinDrawPointer(HPS hps, SHORT x, SHORT y, HPOINTER hptr,
  2258.                                  USHORT fs);
  2259.  
  2260.  
  2261.  
  2262. /* WinDrawPointer() constants */
  2263.  
  2264. #define DP_NORMAL      0x0000
  2265. #define DP_HALFTONED   0x0001
  2266. #define DP_INVERTED    0x0002
  2267.  
  2268.  
  2269. HBITMAP APIENTRY WinGetSysBitmap(HWND hwndDesktop, USHORT ibm);
  2270.  
  2271. /* System bitmaps (NOTE: these are 1-based) */
  2272.  
  2273. #define SBMP_SYSMENU          1
  2274. #define SBMP_SBUPARROW        2
  2275. #define SBMP_SBDNARROW        3
  2276. #define SBMP_SBRGARROW        4
  2277. #define SBMP_SBLFARROW        5
  2278. #define SBMP_MENUCHECK        6
  2279. #define SBMP_CHECKBOXES       7
  2280. #define SBMP_BTNCORNERS       8
  2281. #define SBMP_MINBUTTON        9
  2282. #define SBMP_MAXBUTTON        10
  2283. #define SBMP_RESTOREBUTTON    11
  2284. #define SBMP_CHILDSYSMENU     12
  2285. #define SBMP_DRIVE            15
  2286. #define SBMP_FILE             16
  2287. #define SBMP_FOLDER           17
  2288. #define SBMP_TREEPLUS         18
  2289. #define SBMP_TREEMINUS        19
  2290. #define SBMP_PROGRAM          22
  2291. #define SBMP_CBMP             22    /* count */
  2292.  
  2293. #endif /* INCL_SAADEFS */
  2294.  
  2295. #endif /* INCL_WINPOINTERS */
  2296.  
  2297.  
  2298. /**** Hook manager */
  2299.  
  2300. #ifdef INCL_WINHOOKS
  2301.  
  2302. #ifndef INCL_SAADEFS
  2303. BOOL APIENTRY WinSetHook(HAB hab, HMQ hmq, SHORT iHook, PFN pfnHook,
  2304.                          HMODULE hmod);
  2305. BOOL APIENTRY WinReleaseHook(HAB hab, HMQ hmq, SHORT iHook, PFN pfnHook,
  2306.                              HMODULE hmod);
  2307. BOOL APIENTRY WinCallMsgFilter(HAB hab, PQMSG pqmsg, SHORT msgf);
  2308.  
  2309.  
  2310. /* Hook codes */
  2311.  
  2312. #define HK_SENDMSG          0
  2313. #define HK_INPUT            1
  2314. #define HK_MSGFILTER        2
  2315. #define HK_JOURNALRECORD    3
  2316. #define HK_JOURNALPLAYBACK  4
  2317. #define HK_HELP             5
  2318.  
  2319.  
  2320. #define HMQ_CURRENT         ((HMQ)1)
  2321.  
  2322. /* WH_MSGFILTER context codes */
  2323.  
  2324. #define MSGF_DIALOGBOX      1
  2325. #define MSGF_MESSAGEBOX     2
  2326. #define MSGF_TRACK          8
  2327.  
  2328. /* HK_HELP Help modes */
  2329.  
  2330. #define HLPM_FRAME          (-1)
  2331. #define HLPM_WINDOW         (-2)
  2332. #define HLPM_MENU           (-3)
  2333.  
  2334. /* HK_SENDMSG structure */
  2335.  
  2336. typedef struct _SMHSTRUCT {   /* smhs */
  2337.     MPARAM mp2;
  2338.     MPARAM mp1;
  2339.     USHORT msg;
  2340.     HWND   hwnd;
  2341. } SMHSTRUCT;
  2342. typedef SMHSTRUCT FAR *PSMHSTRUCT;
  2343. #endif /* INCL_SAADEFS */
  2344.  
  2345. #endif /* INCL_WINHOOKS */
  2346.  
  2347. /*
  2348.  * Include Shell API stuff
  2349.  */
  2350. #ifndef INCL_SAADEFS
  2351. #ifndef PM_MACINTOSH
  2352. #include <pmshl.h>      /* OS/2 Shell definitions */
  2353. #endif
  2354. #endif /* INCL_SAADEFS */
  2355.  
  2356. #ifdef INCL_WINCOUNTRY
  2357.  
  2358. #ifndef INCL_SAADEFS
  2359. BOOL    APIENTRY WinSetCp(HMQ hmq, USHORT idCodePage);
  2360. USHORT  APIENTRY WinQueryCp(HMQ hmq);
  2361. USHORT  APIENTRY WinQueryCpList(HAB hab, USHORT ccpMax, PUSHORT prgcp);
  2362. BOOL    APIENTRY WinCpTranslateString(HAB hab, USHORT cpSrc, PSZ pszSrc,
  2363.                                       USHORT cpDst, USHORT cchDestMax,
  2364.                                       PSZ pchDest);
  2365. UCHAR   APIENTRY WinCpTranslateChar(HAB hab, USHORT cpSrc, UCHAR chSrc,
  2366.                                     USHORT cpDst);
  2367.  
  2368. USHORT  APIENTRY WinUpper(HAB hab, USHORT idcp, USHORT idcc, PSZ psz);
  2369. USHORT  APIENTRY WinUpperChar(HAB hab, USHORT idcp, USHORT idcc, USHORT c);
  2370. PSZ     APIENTRY WinNextChar(HAB hab, USHORT idcp, USHORT idcc, PSZ psz);
  2371. PSZ     APIENTRY WinPrevChar(HAB hab, USHORT idcp, USHORT idcc, PSZ pszStart,
  2372.                              PSZ psz);
  2373. USHORT  APIENTRY WinCompareStrings(HAB hab, USHORT idcp, USHORT idcc, PSZ psz1,
  2374.                                    PSZ psz2, USHORT reserved);
  2375. #define WCS_ERROR 0
  2376. #define WCS_EQ    1
  2377. #define WCS_LT    2
  2378. #define WCS_GT    3
  2379.  
  2380. #endif /* INCL_SAADEFS */
  2381.  
  2382. #endif /* INCL_WINCOUNTRY */
  2383.  
  2384.  
  2385.  
  2386. /* Heap Manager Interface declarations */
  2387.  
  2388. #ifdef INCL_WINHEAP
  2389.  
  2390. #ifndef INCL_SAADEFS
  2391. typedef LHANDLE HHEAP;
  2392.  
  2393. HHEAP       APIENTRY WinCreateHeap(USHORT selHeapBase, USHORT cbHeap,
  2394.                                    USHORT cbGrow, USHORT chMinDed,
  2395.                                    USHORT cbMaxDed, USHORT fOptions);
  2396. HHEAP       APIENTRY WinDestroyHeap(HHEAP hHeap);
  2397. USHORT      APIENTRY WinAvailMem(HHEAP hHeap, BOOL fCompact, USHORT cbMinFree);
  2398. NPBYTE      APIENTRY WinAllocMem(HHEAP hHeap, USHORT cb);
  2399. NPBYTE      APIENTRY WinReallocMem(HHEAP hHeap, NPBYTE npMem,
  2400.                                    USHORT cbOld, USHORT cbNew);
  2401. NPBYTE      APIENTRY WinFreeMem(HHEAP hHeap, NPBYTE npMem, USHORT cbMem);
  2402. PVOID       APIENTRY WinLockHeap(HHEAP hHeap);
  2403.  
  2404. #define HM_MOVEABLE     0x0001      /* Parameters to WinCreateHeap */
  2405. #define HM_VALIDSIZE    0x0002
  2406. #endif /* INCL_SAADEFS */
  2407.  
  2408. #endif  /* INCL_WINHEAP */
  2409.  
  2410.  
  2411. /*** Atom Manager Interface declarations */
  2412.  
  2413. #ifdef INCL_WINATOM
  2414.  
  2415. #ifndef INCL_SAADEFS
  2416. typedef LHANDLE  HATOMTBL;
  2417. typedef USHORT   ATOM;
  2418.  
  2419. HATOMTBL APIENTRY WinQuerySystemAtomTable(VOID);
  2420. HATOMTBL APIENTRY WinCreateAtomTable(USHORT cbInitial, USHORT cBuckets);
  2421. HATOMTBL APIENTRY WinDestroyAtomTable(HATOMTBL hAtomTbl);
  2422. ATOM     APIENTRY WinAddAtom(HATOMTBL hAtomTbl, PSZ pszAtomName);
  2423. ATOM     APIENTRY WinFindAtom(HATOMTBL hAtomTbl, PSZ pszAtomName);
  2424. ATOM     APIENTRY WinDeleteAtom(HATOMTBL hAtomTbl, ATOM atom);
  2425. USHORT   APIENTRY WinQueryAtomUsage(HATOMTBL hAtomTbl, ATOM atom);
  2426. USHORT   APIENTRY WinQueryAtomLength(HATOMTBL hAtomTbl, ATOM atom);
  2427. USHORT   APIENTRY WinQueryAtomName(HATOMTBL hAtomTbl, ATOM atom, PSZ pchBuffer,
  2428.                                    USHORT cchBufferMax);
  2429.  
  2430. #define MAKEINTATOM(a)  ((PCH)MAKEULONG(a, 0xffff))
  2431. #endif /* INCL_SAADEFS */
  2432.  
  2433. #endif /* INCL_WINATOM */
  2434.  
  2435.  
  2436. /*** Catch/Throw Interface declarations */
  2437.  
  2438. #ifdef INCL_WINCATCHTHROW
  2439.  
  2440. #ifndef INCL_SAADEFS
  2441. typedef struct _CATCHBUF {  /* ctchbf */
  2442.     ULONG reserved[ 4 ];
  2443. } CATCHBUF;
  2444. typedef CATCHBUF FAR *PCATCHBUF;
  2445.  
  2446. SHORT   APIENTRY    WinCatch(PCATCHBUF pcatchbuf);
  2447. VOID    APIENTRY    WinThrow(PCATCHBUF pcatchbuf, SHORT nThrowBack);
  2448. #endif /* INCL_SAADEFS */
  2449.  
  2450. #endif /* INCL_WINCATCHTHROW */
  2451.  
  2452.  
  2453. #ifdef INCL_WINERRORS
  2454.  
  2455. #define PMERR_INVALID_HWND                  0x1001
  2456. #define PMERR_INVALID_HMQ                   0x1002
  2457. #define PMERR_PARAMETER_OUT_OF_RANGE        0x1003
  2458. #define PMERR_WINDOW_LOCK_UNDERFLOW         0x1004
  2459. #define PMERR_WINDOW_LOCK_OVERFLOW          0x1005
  2460. #define PMERR_BAD_WINDOW_LOCK_COUNT         0x1006
  2461. #define PMERR_WINDOW_NOT_LOCKED             0x1007
  2462. #define PMERR_INVALID_SELECTOR              0x1008
  2463. #define PMERR_CALL_FROM_WRONG_THREAD        0x1009
  2464. #define PMERR_RESOURCE_NOT_FOUND            0x100a
  2465. #define PMERR_INVALID_STRING_PARM           0x100b
  2466. #define PMERR_INVALID_HHEAP                 0x100c
  2467. #define PMERR_INVALID_HEAP_POINTER          0x100d
  2468. #define PMERR_INVALID_HEAP_SIZE_PARM        0x100e
  2469. #define PMERR_INVALID_HEAP_SIZE             0x100f
  2470. #define PMERR_INVALID_HEAP_SIZE_WORD        0x1010
  2471. #define PMERR_HEAP_OUT_OF_MEMORY            0x1011
  2472. #define PMERR_HEAP_MAX_SIZE_REACHED         0x1012
  2473. #define PMERR_INVALID_HATOMTBL              0x1013
  2474. #define PMERR_INVALID_ATOM                  0x1014
  2475. #define PMERR_INVALID_ATOM_NAME             0x1015
  2476. #define PMERR_INVALID_INTEGER_ATOM          0x1016
  2477. #define PMERR_ATOM_NAME_NOT_FOUND           0x1017
  2478. #define PMERR_QUEUE_TOO_LARGE               0x1018
  2479. #define PMERR_INVALID_FLAG                  0x1019
  2480. #define PMERR_INVALID_HACCEL                0x101a
  2481. #define PMERR_INVALID_HPTR                  0x101b
  2482. #define PMERR_INVALID_HENUM                 0x101c
  2483.  
  2484. #define PMERR_INVALID_SRC_CODEPAGE          0x1030
  2485. #define PMERR_INVALID_DST_CODEPAGE          0x1031
  2486.  
  2487. /* These are not real error codes, but just used to access special   */
  2488. /* error message strings used by WinGetErrorInfo to format an error */
  2489. /* message.                                                         */
  2490.  
  2491. #define PMERR_UNKNOWN_COMPONENT_ID          0x101d
  2492. #define PMERR_UNKNOWN_ERROR_CODE            0x101e
  2493. #define PMERR_SEVERITY_LEVELS               0x101f
  2494.  
  2495. /* Error codes for debugging support */
  2496.  
  2497. #define WINDBG_HWND_NOT_DESTROYED           0x1020
  2498. #define WINDBG_HPTR_NOT_DESTROYED           0x1021
  2499. #define WINDBG_HACCEL_NOT_DESTROYED         0x1022
  2500. #define WINDBG_HENUM_NOT_DESTROYED          0x1023
  2501. #define WINDBG_VISRGN_SEM_BUSY              0x1024
  2502. #define WINDBG_USER_SEM_BUSY                0x1025
  2503. #define WINDBG_DC_CACHE_BUSY                0x1026
  2504. #define WINDBG_HOOK_STILL_INSTALLED         0x1027
  2505. #define WINDBG_WINDOW_STILL_LOCKED          0x1028
  2506. #define WINDBG_UPDATEPS_ASSERTION_FAIL      0x1029
  2507. #define WINDBG_SENDMSG_WITHIN_USER_SEM      0x102a
  2508. #define WINDBG_USER_SEM_NOT_ENTERED         0x102b
  2509. #define WINDBG_PROC_NOT_EXPORTED            0x102c
  2510. #define WINDBG_BAD_SENDMSG_HWND             0x102d
  2511. #define WINDBG_ABNORMAL_EXIT                0x102e
  2512. #define WINDBG_INTERNAL_REVISION            0x102f
  2513.  
  2514. /* Get/Set Error Information Interface declarations */
  2515.  
  2516. typedef struct _ERRINFO {   /* erri */
  2517.     USHORT    cbFixedErrInfo;
  2518.     ERRORID   idError;
  2519.     USHORT    cDetailLevel;
  2520.     USHORT    offaoffszMsg;
  2521.     USHORT    offBinaryData;
  2522. } ERRINFO;
  2523. typedef ERRINFO FAR *PERRINFO;
  2524.  
  2525. ERRORID     APIENTRY    WinGetLastError(HAB hab);
  2526.  
  2527. #ifndef INCL_SAADEFS
  2528. PERRINFO    APIENTRY    WinGetErrorInfo(HAB hab);
  2529. BOOL        APIENTRY    WinFreeErrorInfo(PERRINFO perrinfo);
  2530. #endif /* INCL_SAADEFS */
  2531.  
  2532. #endif  /* INCL_WINERRORS */
  2533.  
  2534. #ifndef INCL_SAADEFS
  2535. #ifdef INCL_DDE
  2536. /* Dynamic Data Exchange (DDE) Messages */
  2537.  
  2538. #define WM_DDE_FIRST        0x00A0
  2539. #define WM_DDE_INITIATE     0x00A0
  2540. #define WM_DDE_REQUEST      0x00A1
  2541. #define WM_DDE_ACK          0x00A2
  2542. #define WM_DDE_DATA         0x00A3
  2543. #define WM_DDE_ADVISE       0x00A4
  2544. #define WM_DDE_UNADVISE     0x00A5
  2545. #define WM_DDE_POKE         0x00A6
  2546. #define WM_DDE_EXECUTE      0x00A7
  2547. #define WM_DDE_TERMINATE    0x00A8
  2548. #define WM_DDE_LAST         0x00AF
  2549. #endif /* INCL_DDE */
  2550. #endif /* INCL_SAADEFS */
  2551.