home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c034 / 7.ddi / INC11 / PMWIN.H$ / PMWIN.bin
Encoding:
Text File  |  1990-01-09  |  72.8 KB  |  2,509 lines

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