home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / PMWIN.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  201KB  |  5,288 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /****************************** Module Header ******************************\
  13. *
  14. * Module Name: PMWIN.H
  15. *
  16. * OS/2 Presentation Manager Window Manager include file.
  17. *
  18. *
  19. * ===========================================================================
  20. *
  21. * The folowing symbols are used in this file for conditional sections.
  22. *
  23. * If INCL_WIN is defined, all subcomponents are included.
  24. *
  25. * Subcomponents marked with "+" are partially included by default:
  26. *
  27. *   #define:                To include:
  28. *
  29. * + INCL_WINWINDOWMGR       General window management
  30. * + INCL_WINMESSAGEMGR      Message management
  31. * + INCL_WININPUT           Mouse and keyboard input
  32. * + INCL_WINDIALOGS         Dialog boxes
  33. * + INCL_WINSTATICS         Static controls
  34. * + INCL_WINBUTTONS         Button controls
  35. * + INCL_WINENTRYFIELDS     Entry Fields
  36. *   INCL_WINMLE             Multiple Line Entry Fields
  37. * + INCL_WINLISTBOXES       List box controls
  38. * + INCL_WINMENUS           Menu controls
  39. * + INCL_WINSCROLLBARS      Scroll bar controls
  40. * + INCL_WINFRAMEMGR        Frame manager
  41. *   INCL_WINFRAMECTLS       Frame controls (title bars & size border)
  42. *   INCL_WINRECTANGLES      Rectangle routines
  43. *   INCL_WINSYS             System values (and colors)
  44. *   INCL_WINTIMER           Timer routines
  45. * + INCL_WINACCELERATORS    Keyboard accelerators
  46. *   INCL_WINTRACKRECT       WinTrackRect() function
  47. *   INCL_WINCLIPBOARD       Clipboard manager
  48. * + INCL_WINCURSORS         Text cursors
  49. * + INCL_WINPOINTERS        Mouse pointers
  50. *   INCL_WINHOOKS           Hook manager
  51. * + INCL_WINSWITCHLIST      Shell Switch List API
  52. *   INCL_WINPROGRAMLIST     Shell Program List API
  53. *   INCL_WINSHELLDATA       Shell Data (?)
  54. *   INCL_WINCOUNTRY         Country support
  55. *   INCL_WINHEAP            Heap Manager
  56. *   INCL_WINATOM            Atom Manager
  57. #ifndef INCL_32
  58.    *INCL_WINCATCHTHROW      WinCatch/WinThrow support
  59. #endif
  60. *   INCL_WINERRORS          Error code definitions
  61. *   INCL_NLS                DBCS window manager definition
  62. * + INCL_WINHELP            Help Manager definitions
  63. *   INCL_WINSEI             Set Error Info API
  64. *   INCL_WINLOAD            Load/Delete Library/Procedure
  65. *   INCL_WINTYPES           Definitions for Datatypes
  66. *   INCL_WINTHUNKAPI        Thunk Procedure API
  67. *   INCL_WINDESKTOP         Desktop API
  68. *
  69. * ===========================================================================
  70. *
  71. * Comments at the end of each typedef line give the name tags used in
  72. * the assembler include version of this file.
  73. *
  74. * The assembler include version of this file excludes lines between NOINC
  75. * and INC comments.
  76. *
  77. #ifndef __IBMC__
  78.    * The public version of this file (as shipped with the OS/2 Toolkit
  79.    * product) excludes all non 32-bit material marked in this file
  80.    * as well as any areas specifically marked with __IBMC__ conditional
  81.    * sections - including this paragraph. The H2IBMH rexx command file
  82.    * removes these sections.
  83. #endif
  84. \***************************************************************************/
  85.  
  86. /* NOINC */
  87. #ifdef __IBMC__
  88.    #pragma checkout( suspend )
  89.       #ifndef __CHKHDR__
  90.          #pragma checkout( suspend )
  91.       #endif
  92.    #pragma checkout( resume )
  93. #endif
  94. /* INC */
  95.  
  96. #define WIN_INCLUDED
  97.  
  98.  
  99. #ifndef INCL_32         /* If neither INCL_32 or INCL_16 set already */
  100.    #ifndef INCL_16      /* find out from compiler if 32-bit or not.  */
  101.      #ifdef M_I386
  102.         #define INCL_32 /* Compiling for 32-bit */
  103.      #else
  104.         #define INCL_16 /* Compiling for 16-bit */
  105.      #endif
  106.   #endif
  107. #endif
  108.  
  109. #ifdef INCL_16
  110.    /* NOINC */
  111.    #include <pmwin16.h>
  112.    /* INC */
  113. #endif /* INCL_16 */
  114.  
  115. /*** include everything if requested ***************************************/
  116. #ifdef INCL_WIN
  117.    #define INCL_WINWINDOWMGR
  118.    #define INCL_WINMESSAGEMGR
  119.    #define INCL_WININPUT
  120.    #define INCL_WINDIALOGS
  121.    #define INCL_WINSTATICS
  122.    #define INCL_WINBUTTONS
  123.    #define INCL_WINENTRYFIELDS
  124.    #define INCL_WINMLE
  125.    #define INCL_WINLISTBOXES
  126.    #define INCL_WINMENUS
  127.    #define INCL_WINSCROLLBARS
  128.    #define INCL_WINFRAMEMGR
  129.    #define INCL_WINFRAMECTLS
  130.    #define INCL_WINRECTANGLES
  131.    #define INCL_WINSYS
  132.    #define INCL_WINTIMER
  133.    #define INCL_WINACCELERATORS
  134.    #define INCL_WINTRACKRECT
  135.    #define INCL_WINCLIPBOARD
  136.    #define INCL_WINCURSORS
  137.    #define INCL_WINPOINTERS
  138.    #define INCL_WINHOOKS
  139.    #define INCL_WINSWITCHLIST
  140.    #define INCL_WINPROGRAMLIST
  141.    #define INCL_WINSHELLDATA
  142.    #define INCL_WINCOUNTRY
  143.    #define INCL_WINHEAP
  144.    #define INCL_WINATOM
  145.    #ifndef INCL_32
  146.      #define INCL_WINCATCHTHROW
  147.    #endif
  148.    #define INCL_WINERRORS
  149.    #define INCL_WINDDE
  150.    #define INCL_WINHELP
  151.    #define INCL_WINSEI
  152.    #define INCL_WINLOAD
  153.    #define INCL_WINTYPES
  154.    #define INCL_WINDESKTOP
  155.    #define INCL_WINPALETTE
  156.    #define INCL_WINTHUNKAPI
  157.    #define INCL_WINSTDDLGS
  158. #else /* INCL_WIN */
  159.    /*** include resource compiler required sections ************************/
  160.    #ifdef RC_INVOKED
  161.       #define INCL_WININPUT
  162.       #define INCL_WINDIALOGS
  163.       #define INCL_WINSTATICS
  164.       #define INCL_WINBUTTONS
  165.       #define INCL_WINENTRYFIELDS
  166.       #define INCL_WINLISTBOXES
  167.       #define INCL_WINMENUS
  168.       #define INCL_WINSCROLLBARS
  169.       #define INCL_WINFRAMEMGR
  170.       #define INCL_WINFRAMECTLS
  171.       #define INCL_WINACCELERATORS
  172.       #define INCL_WINPOINTERS
  173.       #define INCL_WINMESSAGEMGR
  174.       #define INCL_WINMLE
  175.       #define INCL_WINHELP
  176.       #define INCL_WINSTDDLGS
  177.       #define INCL_WINSYS
  178.    #endif /* RC_INVOKED */
  179. #endif /* INCL_WIN */
  180.  
  181. /*** ensure standard entry field defintions if MLE is defined **************/
  182. #ifdef INCL_WINMLE
  183.    #ifndef INCL_WINENTRYFIELDS
  184.       #define INCL_WINENTRYFIELDS
  185.    #endif /* INCL_WINENTRYFIELDS */
  186. #endif /* INCL_WINMLE */
  187.  
  188. /*** INCL_WINCOMMON compatability ******************************************/
  189. #ifdef INCL_WINCOMMON
  190.    #define INCL_WINWINDOWMGR
  191. #endif /* INCL_WINCOMMON */
  192.  
  193. /*** include PMWIN errors if all errors requested **************************/
  194. #ifdef INCL_ERRORS
  195.    #define INCL_WINERRORS
  196. #endif  /* INCL_ERRORS */
  197.  
  198. /***************************************************************************/
  199. /***        General Window Management types, constants and macros        ***/
  200. /***************************************************************************/
  201.  
  202. typedef VOID FAR    *MPARAM;    /* mp    */
  203. typedef MPARAM FAR  *PMPARAM;   /* pmp   */
  204. typedef VOID FAR    *MRESULT;   /* mres  */
  205. typedef MRESULT FAR *PMRESULT;  /* pmres */
  206.  
  207. /*** Macros to make an MPARAM from standard types. *************************/
  208.  
  209. #define MPVOID                     ((MPARAM)0L)
  210. #ifdef INCL_32
  211.    #define MPFROMP(p)                 ((MPARAM)((ULONG)(p)))
  212. #else
  213.    #define MPFROMP(p)                 ((MPARAM)(VOID FAR *)(p))
  214. #endif
  215. #define MPFROMHWND(hwnd)           ((MPARAM)(HWND)(hwnd))
  216. #define MPFROMCHAR(ch)             ((MPARAM)(USHORT)(ch))
  217. #define MPFROMSHORT(s)             ((MPARAM)(USHORT)(s))
  218. #define MPFROM2SHORT(s1, s2)       ((MPARAM)MAKELONG(s1, s2))
  219. #define MPFROMSH2CH(s, uch1, uch2) ((MPARAM)MAKELONG(s, MAKESHORT(uch1, uch2)))
  220. #define MPFROMLONG(l)              ((MPARAM)(ULONG)(l))
  221.  
  222. /*** Macros to extract standard types from an MPARAM ***********************/
  223.  
  224. #define PVOIDFROMMP(mp)            ((VOID FAR *)(mp))
  225. #define HWNDFROMMP(mp)             ((HWND)(mp))
  226. #define CHAR1FROMMP(mp)            ((UCHAR)((ULONG)mp))
  227. #define CHAR2FROMMP(mp)            ((UCHAR)((ULONG)mp >> 8))
  228. #define CHAR3FROMMP(mp)            ((UCHAR)((ULONG)mp >> 16))
  229. #define CHAR4FROMMP(mp)            ((UCHAR)((ULONG)mp >> 24))
  230. #define SHORT1FROMMP(mp)           ((USHORT)(ULONG)(mp))
  231. #define SHORT2FROMMP(mp)           ((USHORT)((ULONG)mp >> 16))
  232. #define LONGFROMMP(mp)             ((ULONG)(mp))
  233.  
  234. /*** Macros to make an MRESULT from standard types. ************************/
  235.  
  236. #define MRFROMP(p)                 ((MRESULT)(VOID FAR *)(p))
  237. #define MRFROMSHORT(s)             ((MRESULT)(USHORT)(s))
  238. #define MRFROM2SHORT(s1, s2)       ((MRESULT)MAKELONG(s1, s2))
  239. #define MRFROMLONG(l)              ((MRESULT)(ULONG)(l))
  240.  
  241. /*** Macros to extract standard types from an MRESULT **********************/
  242.  
  243. #define PVOIDFROMMR(mr)            ((VOID FAR *)(mr))
  244. #define SHORT1FROMMR(mr)           ((USHORT)((ULONG)mr))
  245. #define SHORT2FROMMR(mr)           ((USHORT)((ULONG)mr >> 16))
  246. #define LONGFROMMR(mr)             ((ULONG)(mr))
  247.  
  248.  
  249. /****************************************************************************
  250. * This is the standard function definition for window procedures.
  251. * Typically they are names like "XxxxxxxxWndProc", where the prefix
  252. * "Xxxxxxxxx" is replaced by some name descriptive of the window procedure
  253. * being declared.  Window procedures must be EXPORTED in the definitions
  254. * file used by the linker.
  255. *
  256. * MRESULT EXPENTRY MyclassWndProc(HWND hwnd,   * window handle        *
  257. *                                 ULONG msg,   * message number       *
  258. *                                 MPARAM mp1,  * 1st (packed) parms   *
  259. *                                 MPARAM mp2); * 2nd (packed) parms   *
  260. *
  261. ****************************************************************************/
  262.  
  263. /*** Pointer to a window procedure function ********************************/
  264. #ifdef INCL_32
  265.    typedef MRESULT (EXPENTRY FNWP)(HWND, ULONG, MPARAM, MPARAM);
  266.    typedef FNWP FAR *PFNWP;
  267. #else
  268.    typedef MRESULT (PASCAL FAR *PFNWP)(HWND, USHORT, MPARAM, MPARAM);
  269. #endif
  270.  
  271. /*** Predefined window handles *********************************************/
  272. #ifndef INCL_SAADEFS
  273.    #define HWND_DESKTOP               (HWND)1
  274.    #define HWND_OBJECT                (HWND)2
  275. #endif /* !INCL_SAADEFS */
  276.  
  277. #define HWND_TOP                      (HWND)3
  278. #define HWND_BOTTOM                   (HWND)4
  279.  
  280. #ifndef INCL_SAADEFS
  281.    #define HWND_THREADCAPTURE         (HWND)5
  282. #endif /* !INCL_SAADEFS */
  283.  
  284.  
  285. /*** Standard Window Classes ***********************************************/
  286.  
  287. #define WC_FRAME             ((PSZ)0xffff0001L)
  288. #define WC_COMBOBOX          ((PSZ)0xffff0002L)
  289. #define WC_BUTTON            ((PSZ)0xffff0003L)
  290. #define WC_MENU              ((PSZ)0xffff0004L)
  291. #define WC_STATIC            ((PSZ)0xffff0005L)
  292. #define WC_ENTRYFIELD        ((PSZ)0xffff0006L)
  293. #define WC_LISTBOX           ((PSZ)0xffff0007L)
  294. #define WC_SCROLLBAR         ((PSZ)0xffff0008L)
  295. #define WC_TITLEBAR          ((PSZ)0xffff0009L)
  296. #define WC_MLE               ((PSZ)0xffff000AL)
  297. /* 000B to 000F reserved */
  298. #define WC_APPSTAT           ((PSZ)0xffff0010L)
  299. #define WC_KBDSTAT           ((PSZ)0xffff0011L)
  300. #define WC_PECIC             ((PSZ)0xffff0012L)
  301. #define WC_DBE_KKPOPUP       ((PSZ)0xffff0013L)
  302. /* 0014 to 001F reserved */
  303. #define WC_SPINBUTTON        ((PSZ)0xffff0020L)
  304. /* 0021 to 0024 reserved */
  305. #define WC_CONTAINER         ((PSZ)0xffff0025L)
  306. #define WC_SLIDER            ((PSZ)0xffff0026L)
  307. #define WC_VALUESET          ((PSZ)0xffff0027L)
  308. #define WC_NOTEBOOK          ((PSZ)0xffff0028L)
  309. /* 0029 to 002C used by PEN */
  310. #define WC_PENFIRST          ((PSZ)0xffff0029L)
  311. #define WC_PENLAST           ((PSZ)0xffff002CL)
  312. /* 002D to 0030 reserved */
  313. /* 0030 to 003F reserved */
  314. #define WC_MMPMFIRST         ((PSZ)0xffff0040L)
  315. #define WC_CIRCULARSLIDER    ((PSZ)0xffff0041L)
  316. #define WC_MMPMLAST          ((PSZ)0xffff004fL)
  317.  
  318. /*** Standard Window Styles ************************************************/
  319.  
  320. #define WS_VISIBLE                 0x80000000L
  321. #define WS_DISABLED                0x40000000L
  322. #define WS_CLIPCHILDREN            0x20000000L
  323. #define WS_CLIPSIBLINGS            0x10000000L
  324. #define WS_PARENTCLIP              0x08000000L
  325. #define WS_SAVEBITS                0x04000000L
  326. #define WS_SYNCPAINT               0x02000000L
  327. #define WS_MINIMIZED               0x01000000L
  328. #define WS_MAXIMIZED               0x00800000L
  329. #define WS_ANIMATE                 0x00400000L
  330.  
  331. /*** Dialog manager styles *************************************************/
  332.  
  333. #define WS_GROUP                   0x00010000L
  334. #define WS_TABSTOP                 0x00020000L
  335. #define WS_MULTISELECT             0x00040000L
  336.  
  337. /*** Class styles *********************************************************/
  338.  
  339. #define CS_MOVENOTIFY              0x00000001L
  340. #define CS_SIZEREDRAW              0x00000004L
  341. #define CS_HITTEST                 0x00000008L
  342. #define CS_PUBLIC                  0x00000010L
  343. #define CS_FRAME                   0x00000020L
  344. #define CS_CLIPCHILDREN            0x20000000L
  345. #define CS_CLIPSIBLINGS            0x10000000L
  346. #define CS_PARENTCLIP              0x08000000L
  347. #define CS_SAVEBITS                0x04000000L
  348. #define CS_SYNCPAINT               0x02000000L
  349.  
  350. /***************************************************************************/
  351. /*** Window Manager Subsection part 1 **************************************/
  352. /***************************************************************************/
  353.  
  354. #if (defined(INCL_WINWINDOWMGR) || !defined(INCL_NOCOMMON))
  355.  
  356.    #ifdef INCL_32
  357.       BOOL    APIENTRY WinRegisterClass(HAB hab,
  358.                                         PSZ pszClassName,
  359.                                         PFNWP pfnWndProc,
  360.                                         ULONG flStyle,
  361.                                         ULONG cbWindowData);
  362.    #else
  363.       BOOL    APIENTRY WinRegisterClass(HAB hab,
  364.                                         PSZ pszClassName,
  365.                                         PFNWP pfnWndProc,
  366.                                         ULONG flStyle,
  367.                                         USHORT cbWindowData);
  368.    #endif  /* INCL_32 */
  369.  
  370.    #ifdef INCL_32
  371.       MRESULT APIENTRY WinDefWindowProc(HWND hwnd,
  372.                                         ULONG msg,
  373.                                         MPARAM mp1,
  374.                                         MPARAM mp2);
  375.    #else
  376.       MRESULT APIENTRY WinDefWindowProc(HWND hwnd,
  377.                                         USHORT msg,
  378.                                         MPARAM mp1,
  379.                                         MPARAM mp2);
  380.    #endif  /* INCL_32 */
  381.  
  382.    BOOL    APIENTRY WinDestroyWindow(HWND hwnd);
  383.  
  384.    BOOL    APIENTRY WinShowWindow(HWND hwnd,
  385.                                   BOOL fShow);
  386.  
  387.    BOOL    APIENTRY WinQueryWindowRect(HWND hwnd,
  388.                                        PRECTL prclDest);
  389.  
  390.    HPS     APIENTRY WinGetPS(HWND hwnd);
  391.  
  392.    BOOL    APIENTRY WinReleasePS(HPS hps);
  393.  
  394.    BOOL    APIENTRY WinEndPaint(HPS hps);
  395.  
  396.    #ifndef INCL_SAADEFS
  397.  
  398.       #ifdef INCL_32
  399.          HPS   APIENTRY WinGetClipPS(HWND hwnd,
  400.                                      HWND hwndClip,
  401.                                      ULONG fl);
  402.       #else
  403.          HPS   APIENTRY WinGetClipPS(HWND hwnd,
  404.                                      HWND hwndClip,
  405.                                      USHORT fs);
  406.       #endif  /* INCL_32 */
  407.  
  408.       BOOL  APIENTRY WinIsWindowShowing(HWND hwnd);
  409.  
  410.    #endif /* !INCL_SAADEFS */
  411.  
  412.    HPS   APIENTRY WinBeginPaint(HWND hwnd,
  413.                                 HPS hps,
  414.                                 PRECTL prclPaint);
  415.    HDC   APIENTRY WinOpenWindowDC(HWND hwnd);
  416.  
  417.    #ifdef INCL_32
  418.       LONG APIENTRY WinScrollWindow(HWND hwnd,
  419.                                     LONG dx,
  420.                                     LONG dy,
  421.                                     PRECTL prclScroll,
  422.                                     PRECTL prclClip,
  423.                                     HRGN hrgnUpdate,
  424.                                     PRECTL prclUpdate,
  425.                                     ULONG rgfsw);
  426.    #else
  427.       SHORT APIENTRY WinScrollWindow(HWND hwnd,
  428.                                      SHORT dx,
  429.                                      SHORT dy,
  430.                                      PRECTL prclScroll,
  431.                                      PRECTL prclClip,
  432.                                      HRGN hrgnUpdate,
  433.                                      PRECTL prclUpdate,
  434.                                      USHORT rgfsw);
  435.    #endif  /* INCL_32 */
  436.  
  437.    /*** WinGetClipPS() flags ***********************************************/
  438.  
  439.    #ifndef INCL_SAADEFS
  440.       #define PSF_LOCKWINDOWUPDATE       0x0001
  441.       #define PSF_CLIPUPWARDS            0x0002
  442.       #define PSF_CLIPDOWNWARDS          0x0004
  443.       #define PSF_CLIPSIBLINGS           0x0008
  444.       #define PSF_CLIPCHILDREN           0x0010
  445.       #define PSF_PARENTCLIP             0x0020
  446.    #endif /* !INCL_SAADEFS */
  447.  
  448.    /*** WinScrollWindow() flags ********************************************/
  449.  
  450.    #define SW_SCROLLCHILDREN          0x0001
  451.    #define SW_INVALIDATERGN           0x0002
  452.  
  453.    BOOL  APIENTRY WinFillRect(HPS hps,
  454.                               PRECTL prcl,
  455.                               LONG lColor);
  456.  
  457.    /*** WinInitialize/WinTerminate Interface declarations ******************/
  458.  
  459.    typedef struct _QVERSDATA {  /* qver */
  460.       USHORT   environment;
  461.       USHORT   version;
  462.    } QVERSDATA;
  463.    typedef QVERSDATA FAR *PQVERSDATA;
  464.  
  465.    #define QV_OS2                     0x0000
  466.    #define QV_CMS                     0x0001
  467.    #define QV_TSO                     0x0002
  468.    #define QV_TSOBATCH                0x0003
  469.    #define QV_OS400                   0x0004
  470.  
  471.  
  472.    ULONG  APIENTRY WinQueryVersion(HAB hab);
  473.  
  474.    #ifdef INCL_32
  475.       HAB    APIENTRY WinInitialize(ULONG flOptions);
  476.    #else
  477.       HAB    APIENTRY WinInitialize(USHORT fsOptions);
  478.    #endif  /* INCL_32 */
  479.  
  480.    BOOL   APIENTRY WinTerminate(HAB hab);
  481.  
  482.    HAB    APIENTRY WinQueryAnchorBlock(HWND hwnd);
  483.  
  484. #endif /* INCL_WINWINDOWMGR | !INCL_NOCOMMON */
  485.  
  486. /***************************************************************************/
  487. /***  End of Window Manager COMMON section *********************************/
  488. /***************************************************************************/
  489.  
  490.  
  491. #ifdef INCL_32
  492.    HWND    APIENTRY WinCreateWindow(HWND hwndParent,
  493.                                     PSZ pszClass,
  494.                                     PSZ pszName,
  495.                                     ULONG flStyle,
  496.                                     LONG x,
  497.                                     LONG y,
  498.                                     LONG cx,
  499.                                     LONG cy,
  500.                                     HWND hwndOwner,
  501.                                     HWND hwndInsertBehind,
  502.                                     ULONG id,
  503.                                     PVOID pCtlData,
  504.                                     PVOID pPresParams);
  505. #else
  506.    HWND    APIENTRY WinCreateWindow(HWND hwndParent,
  507.                                     PSZ pszClass,
  508.                                     PSZ pszName,
  509.                                     ULONG flStyle,
  510.                                     SHORT x,
  511.                                     SHORT y,
  512.                                     SHORT cx,
  513.                                     SHORT cy,
  514.                                     HWND hwndOwner,
  515.                                     HWND hwndInsertBehind,
  516.                                     USHORT id,
  517.                                     PVOID pCtlData,
  518.                                     PVOID pPresParams);
  519. #endif  /* INCL_32 */
  520.  
  521. BOOL    APIENTRY WinEnableWindow(HWND hwnd,
  522.                                  BOOL fEnable);
  523.  
  524. BOOL    APIENTRY WinIsWindowEnabled(HWND hwnd);
  525.  
  526. BOOL    APIENTRY WinEnableWindowUpdate(HWND hwnd,
  527.                                        BOOL fEnable);
  528.  
  529. BOOL    APIENTRY WinIsWindowVisible(HWND hwnd);
  530.  
  531. #ifdef INCL_32
  532.    LONG    APIENTRY WinQueryWindowText(HWND hwnd,
  533.                                        LONG cchBufferMax,
  534.                                        PCH pchBuffer);
  535. #else
  536.    SHORT   APIENTRY WinQueryWindowText(HWND hwnd,
  537.                                        SHORT cchBufferMax,
  538.                                        PCH pchBuffer);
  539. #endif  /* INCL_32 */
  540.  
  541. BOOL    APIENTRY WinSetWindowText(HWND hwnd,
  542.                                   PSZ pszText);
  543.  
  544. #ifdef INCL_32
  545.    LONG    APIENTRY WinQueryWindowTextLength(HWND hwnd);
  546. #else
  547.    SHORT   APIENTRY WinQueryWindowTextLength(HWND hwnd);
  548. #endif  /* INCL_32 */
  549.  
  550. #ifdef INCL_32
  551.    HWND    APIENTRY WinWindowFromID(HWND hwndParent,
  552.                                     ULONG id);
  553. #else
  554.    HWND    APIENTRY WinWindowFromID(HWND hwndParent,
  555.                                     USHORT id);
  556. #endif  /* INCL_32 */
  557.  
  558. BOOL    APIENTRY WinIsWindow(HAB hab,
  559.                              HWND hwnd);
  560.  
  561. #ifdef INCL_32
  562.    HWND    APIENTRY WinQueryWindow(HWND hwnd,
  563.                                    LONG cmd);
  564. #else
  565.    HWND    APIENTRY WinQueryWindow(HWND hwnd,
  566.                                    SHORT cmd,
  567.                                    BOOL fLock);
  568. #endif  /* INCL_32 */
  569.  
  570. #ifdef INCL_32
  571.    LONG    APIENTRY WinMultWindowFromIDs(HWND hwndParent,
  572.                                          PHWND prghwnd,
  573.                                          ULONG idFirst,
  574.                                          ULONG idLast);
  575. #else
  576.    SHORT   APIENTRY WinMultWindowFromIDs(HWND hwndParent,
  577.                                          PHWND prghwnd,
  578.                                          USHORT idFirst,
  579.                                          USHORT idLast);
  580. #endif  /* INCL_32 */
  581.  
  582. /*** WinQueryWindow() codes ************************************************/
  583.  
  584. #define QW_NEXT         0
  585. #define QW_PREV         1
  586. #define QW_TOP          2
  587. #define QW_BOTTOM       3
  588. #define QW_OWNER        4
  589. #define QW_PARENT       5
  590. #define QW_NEXTTOP      6
  591. #define QW_PREVTOP      7
  592. #define QW_FRAMEOWNER   8
  593.  
  594. BOOL   APIENTRY WinSetParent(HWND hwnd,
  595.                              HWND hwndNewParent,
  596.                              BOOL fRedraw);
  597.  
  598. BOOL   APIENTRY WinIsChild(HWND hwnd,
  599.                            HWND hwndParent);
  600. BOOL   APIENTRY WinSetOwner(HWND hwnd,
  601.                             HWND hwndNewOwner);
  602. #ifndef INCL_SAADEFS
  603.    BOOL   APIENTRY WinQueryWindowProcess(HWND hwnd,
  604.                                          PPID ppid,
  605.                                          PTID ptid);
  606. #endif /* !INCL_SAADEFS */
  607.  
  608. HWND   APIENTRY WinQueryObjectWindow(HWND hwndDesktop);
  609. HWND   APIENTRY WinQueryDesktopWindow(HAB hab,
  610.                                       HDC hdc);
  611.  
  612. /*** Window positioning functions */
  613.  
  614. /* WinSetMultWindowPos() structure */
  615.  
  616. #ifdef INCL_32
  617.    typedef struct _SWP {  /* swp */
  618.       ULONG   fl;
  619.       LONG    cy;
  620.       LONG    cx;
  621.       LONG    y;
  622.       LONG    x;
  623.       HWND    hwndInsertBehind;
  624.       HWND    hwnd;
  625.       ULONG   ulReserved1;
  626.       ULONG   ulReserved2;
  627.    } SWP;
  628. #else
  629.    typedef struct _SWP {  /* swp */
  630.       USHORT  fs;
  631.       SHORT   cy;
  632.       SHORT   cx;
  633.       SHORT   y;
  634.       SHORT   x;
  635.       HWND    hwndInsertBehind;
  636.       HWND    hwnd;
  637.    } SWP;
  638. #endif
  639. typedef SWP FAR *PSWP;
  640.  
  641. #ifdef INCL_32
  642.    BOOL   APIENTRY WinSetWindowPos(HWND hwnd,
  643.                                    HWND hwndInsertBehind,
  644.                                    LONG x,
  645.                                    LONG y,
  646.                                    LONG cx,
  647.                                    LONG cy,
  648.                                    ULONG fl);
  649.    BOOL   APIENTRY WinSetMultWindowPos(HAB hab,
  650.                                        PSWP pswp,
  651.                                        ULONG cswp);
  652. #else
  653.    BOOL   APIENTRY WinSetWindowPos(HWND hwnd,
  654.                                    HWND hwndInsertBehind,
  655.                                    SHORT x,
  656.                                    SHORT y,
  657.                                    SHORT cx,
  658.                                    SHORT cy,
  659.                                    USHORT fs);
  660.    BOOL   APIENTRY WinSetMultWindowPos(HAB hab,
  661.                                        PSWP pswp,
  662.                                        USHORT cswp);
  663. #endif
  664. BOOL   APIENTRY WinQueryWindowPos(HWND hwnd,
  665.                                   PSWP pswp);
  666.  
  667. /* Values returned from WM_ADJUSTWINDOWPOS and passed to WM_WINDOWPOSCHANGED */
  668.  
  669. #define AWP_MINIMIZED              0x00010000L
  670. #define AWP_MAXIMIZED              0x00020000L
  671. #define AWP_RESTORED               0x00040000L
  672. #define AWP_ACTIVATE               0x00080000L
  673. #define AWP_DEACTIVATE             0x00100000L
  674.  
  675. /* WinSetWindowPos() flags */
  676.  
  677. #define SWP_SIZE                   0x0001
  678. #define SWP_MOVE                   0x0002
  679. #define SWP_ZORDER                 0x0004
  680. #define SWP_SHOW                   0x0008
  681. #define SWP_HIDE                   0x0010
  682. #define SWP_NOREDRAW               0x0020
  683. #define SWP_NOADJUST               0x0040
  684. #define SWP_ACTIVATE               0x0080
  685. #define SWP_DEACTIVATE             0x0100
  686. #define SWP_EXTSTATECHANGE         0x0200
  687. #define SWP_MINIMIZE               0x0400
  688. #define SWP_MAXIMIZE               0x0800
  689. #define SWP_RESTORE                0x1000
  690. #define SWP_FOCUSACTIVATE          0x2000
  691. #define SWP_FOCUSDEACTIVATE        0x4000
  692. #define SWP_NOAUTOCLOSE            0x8000    /* Valid in PROGDETAILS struct only */
  693.  
  694. /* Window painting */
  695.  
  696. BOOL  APIENTRY WinUpdateWindow(HWND hwnd);
  697.  
  698. BOOL  APIENTRY WinInvalidateRect(HWND hwnd,
  699.                                  PRECTL pwrc,
  700.                                  BOOL fIncludeChildren);
  701.  
  702. BOOL  APIENTRY WinInvalidateRegion(HWND hwnd,
  703.                                    HRGN hrgn,
  704.                                    BOOL fIncludeChildren);
  705.  
  706.  
  707. /* Drawing helpers */
  708.  
  709. BOOL  APIENTRY WinInvertRect(HPS hps,
  710.                              PRECTL prcl);
  711. #ifdef INCL_32
  712.    BOOL  APIENTRY WinDrawBitmap(HPS hpsDst,
  713.                                 HBITMAP hbm,
  714.                                 PRECTL pwrcSrc,
  715.                                 PPOINTL pptlDst,
  716.                                 LONG clrFore,
  717.                                 LONG clrBack,
  718.                                 ULONG fl);
  719. #else
  720.    BOOL  APIENTRY WinDrawBitmap(HPS hpsDst,
  721.                                 HBITMAP hbm,
  722.                                 PRECTL pwrcSrc,
  723.                                 PPOINTL pptlDst,
  724.                                 LONG clrFore,
  725.                                 LONG clrBack,
  726.                                 USHORT fs);
  727. #endif
  728.  
  729. /* WinDrawBitmap() flags */
  730.  
  731. #define DBM_NORMAL                 0x0000
  732. #define DBM_INVERT                 0x0001
  733. #define DBM_HALFTONE               0x0002
  734. #define DBM_STRETCH                0x0004
  735. #define DBM_IMAGEATTRS             0x0008
  736.  
  737.  
  738. #ifdef INCL_32
  739.  
  740.    LONG    APIENTRY WinDrawText(HPS hps,
  741.                                 LONG cchText,
  742.                                 PCH lpchText,
  743.                                 PRECTL prcl,
  744.                                 LONG clrFore,
  745.                                 LONG clrBack,
  746.                                 ULONG flCmd);
  747.  
  748. #else /* not INCL_32 */
  749.  
  750.    SHORT APIENTRY WinDrawText(HPS hps,
  751.                               SHORT cchText,
  752.                               PCH lpchText,
  753.                               PRECTL prcl,
  754.                               LONG clrFore,
  755.                               LONG clrBack,
  756.                               USHORT fsCmd);
  757.  
  758. #endif /* INCL_32 */
  759.  
  760. /*
  761. * WinDrawText() codes:
  762. * From DT_LEFT to DT_EXTERNALLEADING, the codes are designed to be OR'ed with
  763. * SS_TEXT to create variations of the basic text static item.
  764. */
  765. #define DT_LEFT                    0x0000
  766. #define DT_QUERYEXTENT             0x0002
  767. #define DT_UNDERSCORE              0x0010
  768. #define DT_STRIKEOUT               0x0020
  769. #define DT_TEXTATTRS               0x0040
  770. #define DT_EXTERNALLEADING         0x0080
  771. #define DT_CENTER                  0x0100
  772. #define DT_RIGHT                   0x0200
  773. #define DT_TOP                     0x0000
  774. #define DT_VCENTER                 0x0400
  775. #define DT_BOTTOM                  0x0800
  776. #define DT_HALFTONE                0x1000
  777. #define DT_MNEMONIC                0x2000
  778. #define DT_WORDBREAK               0x4000
  779. #define DT_ERASERECT               0x8000
  780.  
  781.  
  782. #ifdef INCL_32
  783.  
  784.    BOOL APIENTRY WinDrawBorder(HPS hps,
  785.                                PRECTL prcl,
  786.                                LONG cx,
  787.                                LONG cy,
  788.                                LONG clrFore,
  789.                                LONG clrBack,
  790.                                ULONG flCmd);
  791.  
  792. #else /* not INCL_32 */
  793.  
  794.    BOOL APIENTRY WinDrawBorder(HPS hps,
  795.                                PRECTL prcl,
  796.                                SHORT cx,
  797.                                SHORT cy,
  798.                                LONG clrFore,
  799.                                LONG clrBack,
  800.                                USHORT fsCmd);
  801.  
  802. #endif /* INCL_32 */
  803.  
  804. /* WinDrawBorder() flags */
  805.  
  806. #define DB_PATCOPY                 0x0000
  807. #define DB_PATINVERT               0x0001
  808. #define DB_DESTINVERT              0x0002
  809. #define DB_AREAMIXMODE             0x0003
  810.  
  811. #define DB_ROP                     0x0007
  812. #define DB_INTERIOR                0x0008
  813. #define DB_AREAATTRS               0x0010
  814. #define DB_STANDARD                0x0100
  815. #define DB_DLGBORDER               0x0200
  816.  
  817.  
  818.  
  819. /** Resource loading functions */
  820.  
  821. #ifdef INCL_32
  822.    LONG    APIENTRY WinLoadString(HAB hab,
  823.                                   HMODULE hmod,
  824.                                   ULONG id,
  825.                                   LONG cchMax,
  826.                                   PSZ pchBuffer);
  827. #else
  828.    SHORT   APIENTRY WinLoadString(HAB hab,
  829.                                   HMODULE hmod,
  830.                                   USHORT id,
  831.                                   SHORT cchMax,
  832.                                   PSZ pchBuffer);
  833. #endif
  834. #ifndef INCL_SAADEFS
  835.    #ifdef INCL_32
  836.       LONG    APIENTRY WinLoadMessage(HAB hab,
  837.                                       HMODULE hmod,
  838.                                       ULONG id,
  839.                                       LONG cchMax,
  840.                                       PSZ pchBuffer);
  841.    #else
  842.       SHORT   APIENTRY WinLoadMessage(HAB hab,
  843.                                       HMODULE hmod,
  844.                                       USHORT id,
  845.                                       SHORT cchMax,
  846.                                       PSZ pchBuffer);
  847.    #endif
  848.  
  849.  
  850. #endif /* !INCL_SAADEFS */
  851.  
  852. /***************************************************************************/
  853. /****                 Window Manager Subsection part 2                  ****/
  854. #if (defined(INCL_WINWINDOWMGR) || !defined(INCL_NOCOMMON))
  855.  
  856.    BOOL APIENTRY WinSetActiveWindow(HWND hwndDesktop,
  857.                                     HWND hwnd);
  858.  
  859. #endif /* Window Manager COMMON subsection */
  860.  
  861. #ifdef INCL_WINWINDOWMGR
  862.    /* WM_CREATE structure */
  863.  
  864.    #ifdef INCL_32
  865.       typedef struct _CREATESTRUCT {  /* crst */
  866.          PVOID   pPresParams;
  867.          PVOID   pCtlData;
  868.          ULONG   id;
  869.          HWND    hwndInsertBehind;
  870.          HWND    hwndOwner;
  871.          LONG    cy;
  872.          LONG    cx;
  873.          LONG    y;
  874.          LONG    x;
  875.          ULONG   flStyle;
  876.          PSZ     pszText;
  877.          PSZ     pszClass;
  878.          HWND    hwndParent;
  879.       } CREATESTRUCT;
  880.    #else
  881.       typedef struct _CREATESTRUCT {  /* crst */
  882.          PVOID   pPresParams;
  883.          PVOID   pCtlData;
  884.          USHORT  id;
  885.          HWND    hwndInsertBehind;
  886.          HWND    hwndOwner;
  887.          SHORT   cy;
  888.          SHORT   cx;
  889.          SHORT   y;
  890.          SHORT   x;
  891.          ULONG   flStyle;
  892.          PSZ     pszText;
  893.          PSZ     pszClass;
  894.          HWND    hwndParent;
  895.       } CREATESTRUCT;
  896.    #endif
  897.    typedef CREATESTRUCT FAR *PCREATESTRUCT;
  898.  
  899.    /* WinQueryClassInfo() structure */
  900.  
  901.    #ifdef INCL_32
  902.       typedef struct _CLASSINFO {  /* clsi */
  903.          ULONG   flClassStyle;
  904.          PFNWP   pfnWindowProc;
  905.          ULONG   cbWindowData;
  906.       } CLASSINFO;
  907.    #else
  908.       typedef struct _CLASSINFO {  /* clsi */
  909.          ULONG   flClassStyle;
  910.          PFNWP   pfnWindowProc;
  911.          USHORT  cbWindowData;
  912.       } CLASSINFO;
  913.    #endif
  914.    typedef CLASSINFO FAR *PCLASSINFO;
  915.  
  916.    #ifndef INCL_SAADEFS
  917.       PFNWP  APIENTRY WinSubclassWindow(HWND hwnd,
  918.                                         PFNWP pfnwp);
  919.    #endif /* !INCL_SAADEFS */
  920.  
  921.    #ifdef INCL_32
  922.       LONG    APIENTRY WinQueryClassName(HWND hwnd,
  923.                                          LONG cchMax,
  924.                                          PCH pch);
  925.    #else
  926.       SHORT  APIENTRY WinQueryClassName(HWND hwnd,
  927.                                         SHORT cchMax,
  928.                                         PCH pch);
  929.    #endif
  930.    BOOL   APIENTRY WinQueryClassInfo(HAB hab,
  931.                                      PSZ pszClassName,
  932.                                      PCLASSINFO pClassInfo);
  933.  
  934.    #ifdef INCL_32
  935.       HWND   APIENTRY WinQueryActiveWindow(HWND hwndDesktop);
  936.    #else
  937.       HWND   APIENTRY WinQueryActiveWindow(HWND hwndDesktop,
  938.                                            BOOL fLock);
  939.    #endif  /* INCL_32 */
  940.  
  941.    #ifndef INCL_SAADEFS
  942.       BOOL   APIENTRY WinIsThreadActive(HAB hab);
  943.    #endif /* !INCL_SAADEFS */
  944.    #ifdef INCL_32
  945.       HWND   APIENTRY WinQuerySysModalWindow(HWND hwndDesktop);
  946.    #else
  947.       HWND   APIENTRY WinQuerySysModalWindow(HWND hwndDesktop,
  948.                                              BOOL fLock);
  949.    #endif /* INCL_32 */
  950.  
  951.    #ifndef INCL_32
  952.       HWND   APIENTRY WinLockWindow(HWND hwnd,
  953.                                     BOOL fLock);
  954.       #ifndef INCL_SAADEFS
  955.          BOOL   APIENTRY WinRegisterWindowDestroy(HWND hwnd,
  956.                                                   BOOL fRegister);
  957.       #endif /* !INCL_SAADEFS */
  958.  
  959.       SHORT   APIENTRY WinQueryWindowLockCount(HWND hwnd);
  960.    #endif /* !INCL_32 */
  961.  
  962.    BOOL   APIENTRY WinSetSysModalWindow(HWND hwndDesktop,
  963.                                         HWND hwnd);
  964.  
  965.  
  966.    #ifndef INCL_SAADEFS
  967.       #ifdef INCL_32
  968.          USHORT APIENTRY WinQueryWindowUShort(HWND hwnd,
  969.                                               LONG index);
  970.          BOOL   APIENTRY WinSetWindowUShort(HWND hwnd,
  971.                                             LONG index,
  972.                                             USHORT us);
  973.          ULONG  APIENTRY WinQueryWindowULong(HWND hwnd,
  974.                                              LONG index);
  975.          BOOL   APIENTRY WinSetWindowULong(HWND hwnd,
  976.                                            LONG index,
  977.                                            ULONG ul);
  978.          PVOID  APIENTRY WinQueryWindowPtr(HWND hwnd,
  979.                                            LONG index);
  980.          BOOL   APIENTRY WinSetWindowPtr(HWND hwnd,
  981.                                          LONG index,
  982.                                          PVOID p);
  983.          BOOL   APIENTRY WinSetWindowBits(HWND hwnd,
  984.                                           LONG index,
  985.                                           ULONG flData,
  986.                                           ULONG flMask);
  987.       #else
  988.          USHORT APIENTRY WinQueryWindowUShort(HWND hwnd,
  989.                                               SHORT index);
  990.          BOOL   APIENTRY WinSetWindowUShort(HWND hwnd,
  991.                                             SHORT index,
  992.                                             USHORT us);
  993.          ULONG  APIENTRY WinQueryWindowULong(HWND hwnd,
  994.                                              SHORT index);
  995.          BOOL   APIENTRY WinSetWindowULong(HWND hwnd,
  996.                                            SHORT index,
  997.                                            ULONG ul);
  998.          PVOID  APIENTRY WinQueryWindowPtr(HWND hwnd,
  999.                                            SHORT index);
  1000.          BOOL   APIENTRY WinSetWindowPtr(HWND hwnd,
  1001.                                          SHORT index,
  1002.                                          PVOID p);
  1003.          BOOL   APIENTRY WinSetWindowBits(HWND hwnd,
  1004.                                           SHORT index,
  1005.                                           ULONG flData,
  1006.                                           ULONG flMask);
  1007.       #endif
  1008.  
  1009.       /*** Standard WinQueryWindowUShort/ULong() indices *******************/
  1010.       #define QWS_USER                   0
  1011.       #define QWS_ID                     (-1)
  1012.       #define QWS_MIN                    (-1)
  1013.  
  1014.       #define QWL_USER                   0
  1015.       #define QWL_STYLE                  (-2)
  1016.       #define QWP_PFNWP                  (-3)
  1017.       #define QWL_HMQ                    (-4)
  1018.       #define QWL_RESERVED               (-5)
  1019.  
  1020.       #define QWL_PENDATA                (-7)
  1021.       #define QWL_MIN                    (-8)
  1022.  
  1023.       /*** WC_FRAME WinQueryWindowUShort/ULong() indices *******************/
  1024.       #define QWL_HHEAP                  0x0004
  1025.       #define QWL_HWNDFOCUSSAVE          0x0018
  1026.       #define QWL_DEFBUTTON              0x0040
  1027.       #define QWL_PSSCBLK                0x0048
  1028.       #define QWL_PFEPBLK                0x004c
  1029.       #define QWL_PSTATBLK               0x0050
  1030.  
  1031.       #define QWS_FLAGS                  0x0008
  1032.       #define QWS_RESULT                 0x000a
  1033.       #define QWS_XRESTORE               0x000c
  1034.       #define QWS_YRESTORE               0x000e
  1035.       #define QWS_CXRESTORE              0x0010
  1036.       #define QWS_CYRESTORE              0x0012
  1037.       #define QWS_XMINIMIZE              0x0014
  1038.       #define QWS_YMINIMIZE              0x0016
  1039.  
  1040.  
  1041.       /*** Window enumeration **********************************************/
  1042.       typedef LHANDLE HENUM;  /* henum */
  1043.  
  1044.       HENUM APIENTRY WinBeginEnumWindows(HWND hwnd);
  1045.       HWND  APIENTRY WinGetNextWindow(HENUM henum);
  1046.       BOOL  APIENTRY WinEndEnumWindows(HENUM henum);
  1047.  
  1048.    #endif /* !INCL_SAADEFS */
  1049.  
  1050.    #ifdef INCL_32
  1051.       HWND  APIENTRY WinWindowFromPoint(HWND hwnd,
  1052.                                         PPOINTL pptl,
  1053.                                         BOOL fChildren);
  1054.  
  1055.       BOOL  APIENTRY WinMapWindowPoints(HWND hwndFrom,
  1056.                                         HWND hwndTo,
  1057.                                         PPOINTL prgptl,
  1058.                                         LONG cwpt);
  1059.    #else
  1060.       HWND  APIENTRY WinWindowFromPoint(HWND hwnd,
  1061.                                         PPOINTL pptl,
  1062.                                         BOOL fChildren,
  1063.                                         BOOL fLock);
  1064.  
  1065.       BOOL  APIENTRY WinMapWindowPoints(HWND hwndFrom,
  1066.                                         HWND hwndTo,
  1067.                                         PPOINTL prgptl,
  1068.                                         SHORT cwpt);
  1069.    #endif /* INCL_32 */
  1070.  
  1071.  
  1072.    /* More window painting functions */
  1073.  
  1074.    BOOL  APIENTRY WinValidateRect(HWND hwnd,
  1075.                                   PRECTL prcl,
  1076.                                   BOOL fIncludeChildren);
  1077.  
  1078.    BOOL  APIENTRY WinValidateRegion(HWND hwnd,
  1079.                                     HRGN hrgn,
  1080.                                     BOOL fIncludeChildren);
  1081.  
  1082.    #ifndef INCL_SAADEFS
  1083.       HWND  APIENTRY WinWindowFromDC(HDC hdc);
  1084.  
  1085.       HDC   APIENTRY WinQueryWindowDC(HWND hwnd);
  1086.  
  1087.       HPS   APIENTRY WinGetScreenPS(HWND hwndDesktop);
  1088.  
  1089.       BOOL  APIENTRY WinLockWindowUpdate(HWND hwndDesktop,
  1090.                                          HWND hwndLockUpdate);
  1091.  
  1092.       BOOL  APIENTRY WinLockVisRegions(HWND hwndDesktop,
  1093.                                        BOOL fLock);
  1094.    #endif /* !INCL_SAADEFS */
  1095.  
  1096.    BOOL  APIENTRY WinQueryUpdateRect(HWND hwnd,
  1097.                                      PRECTL prcl);
  1098.  
  1099.    #ifdef INCL_32
  1100.       LONG APIENTRY WinQueryUpdateRegion(HWND hwnd,
  1101.                                          HRGN hrgn);
  1102.  
  1103.       LONG APIENTRY WinExcludeUpdateRegion(HPS hps,
  1104.                                            HWND hwnd);
  1105.    #else
  1106.       SHORT APIENTRY WinQueryUpdateRegion(HWND hwnd,
  1107.                                           HRGN hrgn);
  1108.  
  1109.       SHORT APIENTRY WinExcludeUpdateRegion(HPS hps,
  1110.                                             HWND hwnd);
  1111.    #endif
  1112.  
  1113. #endif /* INCL_WINWINDOWMGR */
  1114.  
  1115. #if (defined(INCL_WINMESSAGEMGR) || !defined(INCL_NOCOMMON))
  1116.  
  1117.    /* QMSG structure */
  1118.    #ifdef INCL_32
  1119.       typedef struct _QMSG {  /* qmsg */
  1120.          HWND    hwnd;
  1121.          ULONG   msg;
  1122.          MPARAM  mp1;
  1123.          MPARAM  mp2;
  1124.          ULONG   time;
  1125.          POINTL  ptl;
  1126.          ULONG   reserved;
  1127.       } QMSG;
  1128.    #else
  1129.       typedef struct _QMSG {  /* qmsg */
  1130.          HWND    hwnd;
  1131.          USHORT  msg;
  1132.          MPARAM  mp1;
  1133.          MPARAM  mp2;
  1134.          ULONG   time;
  1135.          POINTL  ptl;
  1136.       } QMSG;
  1137.    #endif
  1138.    typedef QMSG FAR *PQMSG;
  1139.  
  1140.    /*** Standard Window Messages *******************************************/
  1141.    #define WM_NULL                    0x0000
  1142.    #define WM_CREATE                  0x0001
  1143.    #define WM_DESTROY                 0x0002
  1144.  
  1145.    #ifndef INCL_SAADEFS
  1146.       #ifndef INCL_32
  1147.          #define WM_OTHERWINDOWDESTROYED    0x0003
  1148.       #endif
  1149.    #endif /* !INCL_SAADEFS */
  1150.  
  1151.    #define WM_ENABLE                  0x0004
  1152.    #define WM_SHOW                    0x0005
  1153.    #define WM_MOVE                    0x0006
  1154.    #define WM_SIZE                    0x0007
  1155.    #define WM_ADJUSTWINDOWPOS         0x0008
  1156.  
  1157.    #define WM_CALCVALIDRECTS          0x0009
  1158.  
  1159.    #define WM_SETWINDOWPARAMS         0x000a
  1160.    #define WM_QUERYWINDOWPARAMS       0x000b
  1161.    #define WM_HITTEST                 0x000c
  1162.    #define WM_ACTIVATE                0x000d
  1163.    #define WM_SETFOCUS                0x000f
  1164.    #define WM_SETSELECTION            0x0010
  1165.  
  1166.    /* language support Winproc */
  1167.    #define WM_PPAINT                  0x0011
  1168.    #define WM_PSETFOCUS               0x0012
  1169.    #define WM_PSYSCOLORCHANGE         0x0013
  1170.    #define WM_PSIZE                   0x0014
  1171.    #define WM_PACTIVATE               0x0015
  1172.    #define WM_PCONTROL                0x0016
  1173.  
  1174.    #define WM_COMMAND                 0x0020
  1175.    #define WM_SYSCOMMAND              0x0021
  1176.    #define WM_HELP                    0x0022
  1177.    #define WM_PAINT                   0x0023
  1178.  
  1179.    #ifndef INCL_SAADEFS
  1180.       #define WM_TIMER                0x0024
  1181.       #define WM_SEM1                 0x0025
  1182.       #define WM_SEM2                 0x0026
  1183.       #define WM_SEM3                 0x0027
  1184.       #define WM_SEM4                 0x0028
  1185.    #endif /* !INCL_SAADEFS */
  1186.  
  1187.    #define WM_CLOSE                   0x0029
  1188.    #define WM_QUIT                    0x002a
  1189.    #define WM_SYSCOLORCHANGE          0x002b
  1190.    #define WM_SYSVALUECHANGED         0x002d
  1191.    #define WM_APPTERMINATENOTIFY      0x002e
  1192.    #define WM_PRESPARAMCHANGED        0x002f
  1193.  
  1194.    /* Control notification messages */
  1195.    #define WM_CONTROL                 0x0030
  1196.    #define WM_VSCROLL                 0x0031
  1197.    #define WM_HSCROLL                 0x0032
  1198.    #define WM_INITMENU                0x0033
  1199.    #define WM_MENUSELECT              0x0034
  1200.    #define WM_MENUEND                 0x0035
  1201.    #define WM_DRAWITEM                0x0036
  1202.    #define WM_MEASUREITEM             0x0037
  1203.    #define WM_CONTROLPOINTER          0x0038
  1204.    #define WM_QUERYDLGCODE            0x003a
  1205.    #define WM_INITDLG                 0x003b
  1206.    #define WM_SUBSTITUTESTRING        0x003c
  1207.    #define WM_MATCHMNEMONIC           0x003d
  1208.    #define WM_SAVEAPPLICATION         0x003e
  1209.  
  1210.    #ifdef INCL_16
  1211.       #define WM_CONTROLHEAP          0x0039
  1212.    #endif /* INCL_16 */
  1213.  
  1214.    /*************************************************************************
  1215.    * Reserve a range of messages for help manager.  This range includes
  1216.    * public messages, defined below, and private ones, which need to be
  1217.    * reserved here to prevent clashing with application messages
  1218.    *************************************************************************/
  1219.  
  1220.    #define WM_HELPBASE                0x0F00 /* Start of msgs for help manager   */
  1221.    #define WM_HELPTOP                 0x0FFF /* End of msgs for help manager     */
  1222.  
  1223.    #define WM_USER                    0x1000
  1224.  
  1225.    /*** WM_COMMAND msg source codes ****************************************/
  1226.    #define CMDSRC_PUSHBUTTON      1
  1227.    #define CMDSRC_MENU            2
  1228.    #define CMDSRC_ACCELERATOR     3
  1229.    #define CMDSRC_FONTDLG         4
  1230.    #define CMDSRC_FILEDLG         5
  1231.    #define CMDSRC_PRINTDLG        6
  1232.    #define CMDSRC_COLORDLG        7
  1233.    #define CMDSRC_OTHER           0
  1234.  
  1235.    #pragma pack(1) /* force structure alignment packing */
  1236.  
  1237.    /*
  1238.    * The following structure and macro are used to access the
  1239.    * WM_COMMAND, WM_HELP, and WM_SYSCOMMAND message parameters:
  1240.    */
  1241.    #ifdef INCL_32
  1242.       typedef struct _COMMANDMSG {  /* commandmsg */
  1243.          USHORT  cmd;              /* mp1 */
  1244.          USHORT  unused;
  1245.          USHORT  source;           /* mp2 */
  1246.          USHORT  fMouse;
  1247.       } CMDMSG;
  1248.       typedef CMDMSG FAR *PCMDMSG;
  1249.  
  1250.       #define COMMANDMSG(pmsg) \
  1251.       ((PCMDMSG)((PBYTE)pmsg + sizeof(MPARAM) ))
  1252.    #else
  1253.       typedef struct _COMMANDMSG {  /* commandmsg */
  1254.          USHORT  source;           /* mp2 */
  1255.          USHORT  fMouse;
  1256.          USHORT  cmd;              /* mp1 */
  1257.          USHORT  unused;
  1258.       } CMDMSG;
  1259.       typedef CMDMSG FAR *PCMDMSG;
  1260.  
  1261.       #define COMMANDMSG(pmsg) \
  1262.       ((PCMDMSG)((PBYTE)pmsg - sizeof(MPARAM) * 2))
  1263.    #endif
  1264.  
  1265.    #pragma pack()  /* restore packing to default */
  1266.  
  1267.    /*** The following structure is used by the WinQueryQueueInfo() routine */
  1268.    #ifdef INCL_32
  1269.       typedef struct _MQINFO {  /* mqi */
  1270.          ULONG   cb;
  1271.          PID     pid;
  1272.          TID     tid;
  1273.          ULONG   cmsgs;
  1274.          PVOID   pReserved;
  1275.       } MQINFO;
  1276.    #else
  1277.       typedef struct _MQINFO {     /* mqi */
  1278.          USHORT  cb;
  1279.          USHORT  pid;
  1280.          USHORT  tid;
  1281.          USHORT  cmsgs;
  1282.          PVOID   pReserved;
  1283.       } MQINFO;
  1284.    #endif
  1285.    typedef MQINFO FAR *PMQINFO;
  1286.  
  1287.    #ifdef INCL_32
  1288.       MRESULT APIENTRY WinSendMsg(HWND hwnd,
  1289.                                   ULONG msg,
  1290.                                   MPARAM mp1,
  1291.                                   MPARAM mp2);
  1292.  
  1293.       HMQ     APIENTRY WinCreateMsgQueue(HAB hab,
  1294.                                          LONG cmsg);
  1295.  
  1296.       BOOL    APIENTRY WinDestroyMsgQueue(HMQ hmq);
  1297.  
  1298.       BOOL    APIENTRY WinQueryQueueInfo(HMQ hmq,
  1299.                                          PMQINFO pmqi,
  1300.                                          ULONG cbCopy);
  1301.    #else
  1302.       MRESULT APIENTRY WinSendMsg(HWND hwnd,
  1303.                                   USHORT msg,
  1304.                                   MPARAM mp1,
  1305.                                   MPARAM mp2);
  1306.  
  1307.       HMQ     APIENTRY WinCreateMsgQueue(HAB hab,
  1308.                                          SHORT cmsg);
  1309.  
  1310.       BOOL    APIENTRY WinDestroyMsgQueue(HMQ hmq);
  1311.  
  1312.       BOOL    APIENTRY WinQueryQueueInfo(HMQ hmq,
  1313.                                          PMQINFO pmqi,
  1314.                                          USHORT cbCopy);
  1315.    #endif
  1316.  
  1317.    #ifndef INCL_SAADEFS
  1318.       BOOL    APIENTRY WinCancelShutdown(HMQ hmq,
  1319.                                          BOOL fCancelAlways);
  1320.    #endif /* INCL_SAADEFS */
  1321.  
  1322.    #ifdef INCL_32
  1323.       BOOL    APIENTRY WinGetMsg(HAB hab,
  1324.                                  PQMSG pqmsg,
  1325.                                  HWND hwndFilter,
  1326.                                  ULONG msgFilterFirst,
  1327.                                  ULONG msgFilterLast);
  1328.  
  1329.       BOOL    APIENTRY WinPeekMsg(HAB hab,
  1330.                                   PQMSG pqmsg,
  1331.                                   HWND hwndFilter,
  1332.                                   ULONG msgFilterFirst,
  1333.                                   ULONG msgFilterLast,
  1334.                                   ULONG fl);
  1335.  
  1336.       MRESULT APIENTRY WinDispatchMsg(HAB hab,
  1337.                                       PQMSG pqmsg);
  1338.  
  1339.       BOOL    APIENTRY WinPostMsg(HWND hwnd,
  1340.                                   ULONG msg,
  1341.                                   MPARAM mp1,
  1342.                                   MPARAM mp2);
  1343.  
  1344.       BOOL    APIENTRY WinRegisterUserMsg(HAB hab,
  1345.                                           ULONG msgid,
  1346.                                           LONG datatype1,
  1347.                                           LONG dir1,
  1348.                                           LONG datatype2,
  1349.                                           LONG dir2,
  1350.                                           LONG datatyper);
  1351.  
  1352.       BOOL    APIENTRY WinRegisterUserDatatype(HAB hab,
  1353.                                                LONG datatype,
  1354.                                                LONG count,
  1355.                                                PLONG types);
  1356.       BOOL    APIENTRY WinSetMsgMode(HAB hab,
  1357.                                      PSZ classname,
  1358.                                      LONG control);
  1359.  
  1360.       BOOL    APIENTRY WinSetSynchroMode(HAB hab,
  1361.                                          LONG mode);
  1362.    #else
  1363.       BOOL    APIENTRY WinGetMsg(HAB hab,
  1364.                                  PQMSG pqmsg,
  1365.                                  HWND hwndFilter,
  1366.                                  USHORT msgFilterFirst,
  1367.                                  USHORT msgFilterLast);
  1368.  
  1369.       BOOL    APIENTRY WinPeekMsg(HAB hab,
  1370.                                   PQMSG pqmsg,
  1371.                                   HWND hwndFilter,
  1372.                                   USHORT msgFilterFirst,
  1373.                                   USHORT msgFilterLast,
  1374.                                   USHORT fs);
  1375.  
  1376.       MRESULT APIENTRY WinDispatchMsg(HAB hab,
  1377.                                       PQMSG pqmsg);
  1378.  
  1379.       BOOL    APIENTRY WinPostMsg(HWND hwnd,
  1380.                                   USHORT msg,
  1381.                                   MPARAM mp1,
  1382.                                   MPARAM mp2);
  1383.  
  1384.       BOOL    APIENTRY WinRegisterUserMsg(HAB hab,
  1385.                                           USHORT msgid,
  1386.                                           SHORT datatype1,
  1387.                                           SHORT dir1,
  1388.                                           SHORT datatype2,
  1389.                                           SHORT dir2,
  1390.                                           SHORT datatyper);
  1391.  
  1392.       BOOL    APIENTRY WinRegisterUserDatatype(HAB hab,
  1393.                                                SHORT datatype,
  1394.                                                SHORT count,
  1395.                                                PSHORT types);
  1396.  
  1397.       BOOL    APIENTRY WinSetMsgMode(HAB hab,
  1398.                                      PSZ classname,
  1399.                                      SHORT control);
  1400.  
  1401.       BOOL    APIENTRY WinSetSynchroMode(HAB hab,
  1402.                                          SHORT mode);
  1403.    #endif
  1404.  
  1405.    /*** WinPeekMsg() constants *********************************************/
  1406.    #define PM_REMOVE                  0x0001
  1407.    #define PM_NOREMOVE                0x0000
  1408.  
  1409.    /*** WinRegisterUserDatatype datatypes defined in separate file *********/
  1410.    #ifdef INCL_WINTYPES
  1411.       #include <pmtypes.h>
  1412.    #endif /*INCL_WINTYPES*/
  1413.  
  1414.    /*** WinRegisterUserMsg direction codes *********************************/
  1415.    #define RUM_IN                     1
  1416.    #define RUM_OUT                    2
  1417.    #define RUM_INOUT                  3
  1418.  
  1419.    /*** WinSetMsgMode constants *******************************************/
  1420.    #define SMD_DELAYED                0x0001
  1421.    #define SMD_IMMEDIATE              0x0002
  1422.  
  1423.    /*** WinSetSynchroMode constants ***************************************/
  1424.    #define SSM_SYNCHRONOUS            0x0001
  1425.    #define SSM_ASYNCHRONOUS           0x0002
  1426.    #define SSM_MIXED                  0x0003
  1427.  
  1428. #endif /* WINMESSAGEMGR || !INCL_NOCOMMON       */
  1429.  
  1430. #ifdef INCL_WINMESSAGEMGR
  1431.  
  1432.    /*** WM_CALCVALIDRECTS return flags *************************************/
  1433.    #define CVR_ALIGNLEFT               0x0001
  1434.    #define CVR_ALIGNBOTTOM             0x0002
  1435.    #define CVR_ALIGNRIGHT              0x0004
  1436.    #define CVR_ALIGNTOP                0x0008
  1437.    #define CVR_REDRAW                  0x0010
  1438.  
  1439.    /*** WM_HITTEST return codes ********************************************/
  1440.    #define HT_NORMAL                   0
  1441.    #define HT_TRANSPARENT              (-1)
  1442.    #define HT_DISCARD                  (-2)
  1443.    #define HT_ERROR                    (-3)
  1444.  
  1445.    /*** WM_SET/QUERYWINDOWPARAMS structures and flags **********************/
  1446.    #ifdef INCL_32
  1447.       typedef struct _WNDPARAMS {  /* wprm */
  1448.          ULONG   fsStatus;
  1449.          ULONG   cchText;
  1450.          PSZ     pszText;
  1451.          ULONG   cbPresParams;
  1452.          PVOID   pPresParams;
  1453.          ULONG   cbCtlData;
  1454.          PVOID   pCtlData;
  1455.       } WNDPARAMS;
  1456.    #else
  1457.       typedef struct _WNDPARAMS {  /* wprm */
  1458.          USHORT  fsStatus;
  1459.          USHORT  cchText;
  1460.          PSZ     pszText;
  1461.          USHORT  cbPresParams;
  1462.          PVOID   pPresParams;
  1463.          USHORT  cbCtlData;
  1464.          PVOID   pCtlData;
  1465.       } WNDPARAMS;
  1466.    #endif
  1467.    typedef WNDPARAMS FAR *PWNDPARAMS;
  1468.  
  1469.    #define WPM_TEXT                   0x0001
  1470.    #define WPM_CTLDATA                0x0002
  1471.    #define WPM_PRESPARAMS             0x0004
  1472.    #define WPM_CCHTEXT                0x0008
  1473.    #define WPM_CBCTLDATA              0x0010
  1474.    #define WPM_CBPRESPARAMS           0x0020
  1475.  
  1476.    #ifndef INCL_SAADEFS
  1477.       BOOL    APIENTRY WinInSendMsg(HAB hab);
  1478.    #endif /* INCL_SAADEFS */
  1479.  
  1480.    #ifdef INCL_32
  1481.       BOOL    APIENTRY WinBroadcastMsg(HWND hwnd,
  1482.                                        ULONG msg,
  1483.                                        MPARAM mp1,
  1484.                                        MPARAM mp2,
  1485.                                        ULONG rgf);
  1486.    #else
  1487.       BOOL    APIENTRY WinBroadcastMsg(HWND hwnd,
  1488.                                        USHORT msg,
  1489.                                        MPARAM mp1,
  1490.                                        MPARAM mp2,
  1491.                                        USHORT rgf);
  1492.    #endif
  1493.  
  1494.    /*** WinBroadcastMsg codes **********************************************/
  1495.    #define BMSG_POST                  0x0000
  1496.    #define BMSG_SEND                  0x0001
  1497.    #define BMSG_POSTQUEUE             0x0002
  1498.    #define BMSG_DESCENDANTS           0x0004
  1499.    #define BMSG_FRAMEONLY             0x0008
  1500.  
  1501.    #ifdef INCL_32
  1502.       BOOL  APIENTRY WinWaitMsg(HAB hab,
  1503.                                 ULONG msgFirst,
  1504.                                 ULONG msgLast);
  1505.    #else
  1506.       BOOL  APIENTRY WinWaitMsg(HAB hab,
  1507.                                 USHORT msgFirst,
  1508.                                 USHORT msgLast);
  1509.    #endif
  1510.  
  1511.    #ifndef INCL_SAADEFS
  1512.       ULONG APIENTRY WinQueryQueueStatus(HWND hwndDesktop);
  1513.  
  1514.       /*** WinQueryQueueStatus() constants *********************************/
  1515.       #define QS_KEY                     0x0001
  1516.       #define QS_MOUSEBUTTON             0x0002
  1517.       #define QS_MOUSEMOVE               0x0004
  1518.       #define QS_MOUSE                   0x0006   /* QS_MOUSEMOVE|QS_MOUSEBUTTON */
  1519.       #define QS_TIMER                   0x0008
  1520.       #define QS_PAINT                   0x0010
  1521.       #define QS_POSTMSG                 0x0020
  1522.       #define QS_SEM1                    0x0040
  1523.       #define QS_SEM2                    0x0080
  1524.       #define QS_SEM3                    0x0100
  1525.       #define QS_SEM4                    0x0200
  1526.       #define QS_SENDMSG                 0x0400
  1527.       #define QS_MSGINPUT                0x0800
  1528.  
  1529.       BOOL  APIENTRY WinQueryMsgPos(HAB hab,
  1530.                                     PPOINTL pptl);
  1531.  
  1532.       ULONG APIENTRY WinQueryMsgTime(HAB hab);
  1533.  
  1534.       #ifdef INCL_32
  1535.          #ifndef INCL_DOSSEMAPHORES
  1536.             #ifndef __HEV__
  1537.                #define __HEV__
  1538.                typedef ULONG HEV;    /* hev */
  1539.             #endif
  1540.             typedef ULONG HMTX;   /* hmtx */
  1541.             typedef ULONG HMUX;   /* hmux */
  1542.          #endif
  1543.  
  1544.          APIRET APIENTRY WinWaitEventSem(HEV hev,
  1545.                                          ULONG ulTimeout);
  1546.  
  1547.          APIRET APIENTRY WinRequestMutexSem(HMTX hmtx,
  1548.                                             ULONG ulTimeout);
  1549.  
  1550.          APIRET APIENTRY WinWaitMuxWaitSem(HMUX hmux,
  1551.                                            ULONG ulTimeout,
  1552.                                            PULONG pulUser);
  1553.  
  1554.       #else
  1555.          USHORT APIENTRY WinMsgSemWait(HSEM hsem,
  1556.                                        LONG dtTimeout);
  1557.  
  1558.          USHORT APIENTRY WinMsgMuxSemWait(PUSHORT pisemCleared,
  1559.                                           PVOID pmxsl,
  1560.                                           LONG dtTimeout);
  1561.       #endif
  1562.  
  1563.    #endif /* !INCL_SAADEFS */
  1564.  
  1565.    #ifdef INCL_32
  1566.       BOOL  APIENTRY WinPostQueueMsg(HMQ hmq,
  1567.                                      ULONG msg,
  1568.                                      MPARAM mp1,
  1569.                                      MPARAM mp2);
  1570.    #else
  1571.       BOOL  APIENTRY WinPostQueueMsg(HMQ hmq,
  1572.                                      USHORT msg,
  1573.                                      MPARAM mp1,
  1574.                                      MPARAM mp2);
  1575.    #endif
  1576.  
  1577.    /*** WinSetMsgInterest()/WinSetClassMsgInterest() constants *************/
  1578.    #define SMIM_ALL                   0x0EFF
  1579.    #define SMI_NOINTEREST             0x0001
  1580.    #define SMI_INTEREST               0x0002
  1581.    #define SMI_RESET                  0x0004
  1582.    #define SMI_AUTODISPATCH           0x0008
  1583.  
  1584.    #ifdef INCL_32
  1585.       BOOL  APIENTRY WinSetMsgInterest(HWND hwnd,
  1586.                                        ULONG msg_class,
  1587.                                        LONG control);
  1588.  
  1589.       BOOL  APIENTRY WinSetClassMsgInterest(HAB hab,
  1590.                                             PSZ pszClassName,
  1591.                                             ULONG msg_class,
  1592.                                             LONG control);
  1593.    #else
  1594.       BOOL  APIENTRY WinSetMsgInterest(HWND hwnd,
  1595.                                        USHORT msg_class,
  1596.                                        SHORT control);
  1597.  
  1598.       BOOL  APIENTRY WinSetClassMsgInterest(HAB hab,
  1599.                                             PSZ pszClassName,
  1600.                                             USHORT msg_class,
  1601.                                             SHORT control);
  1602.    #endif
  1603.  
  1604. #endif /* INCL_WINMESSAGEMGR */
  1605.  
  1606. /*** Keyboard and mouse ****************************************************/
  1607.  
  1608. #if (defined(INCL_WININPUT) || !defined(INCL_NOCOMMON))
  1609.  
  1610.    /*** Keyboard and mouse input COMMON subsection *************************/
  1611.    BOOL  APIENTRY WinSetFocus(HWND hwndDesktop,
  1612.                               HWND hwndSetFocus);
  1613.  
  1614.    #ifdef INCL_32
  1615.       BOOL  APIENTRY WinFocusChange(HWND hwndDesktop,
  1616.                                     HWND hwndSetFocus,
  1617.                                     ULONG flFocusChange);
  1618.  
  1619.       BOOL  EXPENTRY WinLockupSystem(HAB hab);
  1620.  
  1621.       BOOL  EXPENTRY WinUnlockSystem(HAB hab, PSZ pszPassword);
  1622.    #else
  1623.       BOOL  APIENTRY WinFocusChange(HWND hwndDesktop,
  1624.                                     HWND hwndSetFocus,
  1625.                                     USHORT fsFocusChange);
  1626.    #endif
  1627.  
  1628.    #define FC_NOSETFOCUS              0x0001
  1629.    #define FC_NOBRINGTOTOP            FC_NOSETFOCUS
  1630.    #define FC_NOLOSEFOCUS             0x0002
  1631.    #define FC_NOBRINGTOPFIRSTWINDOW   FC_NOLOSEFOCUS
  1632.    #define FC_NOSETACTIVE             0x0004
  1633.    #define FC_NOLOSEACTIVE            0x0008
  1634.    #define FC_NOSETSELECTION          0x0010
  1635.    #define FC_NOLOSESELECTION         0x0020
  1636.  
  1637.    #define QFC_NEXTINCHAIN            0x0001
  1638.    #define QFC_ACTIVE                 0x0002
  1639.    #define QFC_FRAME                  0x0003
  1640.    #define QFC_SELECTACTIVE           0x0004
  1641.    #define QFC_PARTOFCHAIN            0x0005
  1642.  
  1643. #endif  /* Keyboard and mouse input COMMON subsection */
  1644.  
  1645. /*
  1646. ** @86823; added WM_VRNDISABLED, WM_VRNENABLED,
  1647. **               WinSetVisibleRegionNotify, WinQueryVisibleRegion
  1648. */
  1649.    #define WM_VRNDISABLED             0x007e
  1650.    #define WM_VRNENABLED              0x007f
  1651.  
  1652.    BOOL APIENTRY WinSetVisibleRegionNotify( HWND hwnd, BOOL fEnable);
  1653.  
  1654.    ULONG APIENTRY WinQueryVisibleRegion( HWND hwnd, HRGN hrgn);
  1655.  
  1656.  
  1657. #ifdef INCL_WININPUT
  1658.    #ifndef INCL_SAADEFS
  1659.       BOOL  APIENTRY WinSetCapture(HWND hwndDesktop,
  1660.                                    HWND hwnd);
  1661.    #endif /* !INCL_SAADEFS */
  1662.  
  1663.    #ifdef INCL_32
  1664.       HWND  APIENTRY WinQueryCapture(HWND hwndDesktop);
  1665.    #else
  1666.       HWND  APIENTRY WinQueryCapture(HWND hwndDesktop,
  1667.                                      BOOL fLock);
  1668.    #endif  /* INCL_32 */
  1669.  
  1670.    #ifdef INCL_32
  1671.       BOOL  APIENTRY WinCheckInput(HAB hab);
  1672.    #endif
  1673.  
  1674.    /*** Mouse input messages ***********************************************/
  1675.    #ifndef INCL_SAADEFS
  1676.       #define WM_MOUSEFIRST           0x0070
  1677.       #define WM_MOUSELAST            0x0079
  1678.       #define WM_BUTTONCLICKFIRST     0x0071
  1679.       #define WM_BUTTONCLICKLAST      0x0079
  1680.    #endif /* !INCL_SAADEFS */
  1681.    #define WM_MOUSEMOVE               0x0070
  1682.  
  1683.    #define WM_BUTTON1DOWN             0x0071
  1684.  
  1685.    #define WM_BUTTON1UP               0x0072
  1686.    #define WM_BUTTON1DBLCLK           0x0073
  1687.    #define WM_BUTTON2DOWN             0x0074
  1688.    #define WM_BUTTON2UP               0x0075
  1689.    #define WM_BUTTON2DBLCLK           0x0076
  1690.    #ifndef INCL_SAADEFS
  1691.       #define WM_BUTTON3DOWN          0x0077
  1692.       #define WM_BUTTON3UP            0x0078
  1693.       #define WM_BUTTON3DBLCLK        0x0079
  1694.  
  1695.       #define WM_MOUSEMAP             0x007D
  1696.  
  1697.       #define WM_EXTMOUSEFIRST        0x0410
  1698.       #define WM_EXTMOUSELAST         0x0419
  1699.  
  1700.       #define WM_CHORD                0x0410
  1701.       #define WM_BUTTON1MOTIONSTART   0x0411
  1702.       #define WM_BUTTON1MOTIONEND     0x0412
  1703.       #define WM_BUTTON1CLICK         0x0413
  1704.       #define WM_BUTTON2MOTIONSTART   0x0414
  1705.       #define WM_BUTTON2MOTIONEND     0x0415
  1706.       #define WM_BUTTON2CLICK         0x0416
  1707.       #define WM_BUTTON3MOTIONSTART   0x0417
  1708.       #define WM_BUTTON3MOTIONEND     0x0418
  1709.       #define WM_BUTTON3CLICK         0x0419
  1710.  
  1711.       /* Messages 0x041A - 0x041F are reserved */
  1712.  
  1713.       #define WM_MOUSETRANSLATEFIRST  0x0420
  1714.       #define WM_MOUSETRANSLATELAST   0x0428
  1715.  
  1716.       #define WM_BEGINDRAG            0x0420
  1717.       #define WM_ENDDRAG              0x0421
  1718.       #define WM_SINGLESELECT         0x0422
  1719.       #define WM_OPEN                 0x0423
  1720.       #define WM_CONTEXTMENU          0x0424
  1721.       #define WM_CONTEXTHELP          0x0425
  1722.       #define WM_TEXTEDIT             0x0426
  1723.       #define WM_BEGINSELECT          0x0427
  1724.       #define WM_ENDSELECT            0x0428
  1725.       #define WM_PICKUP               0x0429
  1726.  
  1727.       #define WM_PENFIRST             0x04C0
  1728.       #define WM_PENLAST              0x04FF
  1729.       #define WM_MMPMFIRST            0x0500
  1730.       #define WM_MMPMLAST             0x05FF
  1731.  
  1732.       /* Messages 0x0BD0 - 0x0BFF are reserved */
  1733.       /* for bidirectional language support.   */
  1734.  
  1735.       #define  WM_BIDI_FIRST           0x0BD0
  1736.       #define  WM_BIDI_LAST            0x0BFF
  1737.  
  1738.    #endif /* !INCL_SAADEFS */
  1739.  
  1740.    #ifdef INCL_32
  1741.       HWND  APIENTRY WinQueryFocus(HWND hwndDesktop);
  1742.    #else
  1743.       HWND  APIENTRY WinQueryFocus(HWND hwndDesktop,
  1744.                                    BOOL fLock);
  1745.    #endif
  1746.  
  1747.  
  1748.    /*** Key/Character input messages ***************************************/
  1749.    #define WM_CHAR                    0x007a
  1750.    #define WM_VIOCHAR                 0x007b
  1751.  
  1752.    /* WM_CHAR fs field bits */
  1753.    #define KC_NONE                    0x0000     /* Reserved */
  1754.    #define KC_CHAR                    0x0001
  1755.    #define KC_VIRTUALKEY              0x0002
  1756.    #define KC_SCANCODE                0x0004
  1757.  
  1758.    #define KC_SHIFT                   0x0008
  1759.    #define KC_CTRL                    0x0010
  1760.    #define KC_ALT                     0x0020
  1761.    #define KC_KEYUP                   0x0040
  1762.    #define KC_PREVDOWN                0x0080
  1763.    #define KC_LONEKEY                 0x0100
  1764.    #define KC_DEADKEY                 0x0200
  1765.    #define KC_COMPOSITE               0x0400
  1766.    #define KC_INVALIDCOMP             0x0800
  1767.  
  1768.    #ifndef INCL_SAADEFS
  1769.       #define KC_TOGGLE               0x1000
  1770.       #define KC_INVALIDCHAR          0x2000
  1771.       #define KC_DBCSRSRVD1           0x4000
  1772.       #define KC_DBCSRSRVD2           0x8000
  1773.    #endif /* !INCL_SAADEFS */
  1774.  
  1775.    #pragma pack(1) /* force structure alignment packing */
  1776.  
  1777.    /*
  1778.    * The following structure and macro are used to access the
  1779.    * WM_MOUSEMOVE, and WM_BUTTON message parameters
  1780.    */
  1781.    #ifdef INCL_32
  1782.       typedef struct _MOUSEMSG {  /* mousemsg */
  1783.          SHORT   x;             /* mp1      */
  1784.          SHORT   y;
  1785.          USHORT  codeHitTest;   /* mp2      */
  1786.          USHORT  fsInp;         /* input flags */
  1787.       } MSEMSG;
  1788.       typedef MSEMSG FAR *PMSEMSG;
  1789.  
  1790.       #define MOUSEMSG(pmsg) \
  1791.       ((PMSEMSG)((PBYTE)pmsg + sizeof(MPARAM) ))
  1792.  
  1793.       typedef struct _CHARMSG {  /* charmsg */
  1794.          USHORT  fs;           /* mp1     */
  1795.          UCHAR   cRepeat;
  1796.          UCHAR   scancode;
  1797.          USHORT  chr;          /* mp2     */
  1798.          USHORT  vkey;
  1799.       } CHRMSG;
  1800.       typedef CHRMSG FAR *PCHRMSG;
  1801.  
  1802.       #define CHARMSG(pmsg) \
  1803.       ((PCHRMSG)((PBYTE)pmsg + sizeof(MPARAM) ))
  1804.    #else
  1805.       typedef struct _MOUSEMSG {  /* mousemsg */
  1806.          USHORT  codeHitTest;   /* mp2      */
  1807.          USHORT  fsInp;         /* input flags */
  1808.          SHORT   x;             /* mp1      */
  1809.          SHORT   y;
  1810.       } MSEMSG;
  1811.       typedef MSEMSG FAR *PMSEMSG;
  1812.  
  1813.       #define MOUSEMSG(pmsg) \
  1814.       ((PMSEMSG)((PBYTE)pmsg - sizeof(MPARAM) * 2))
  1815.  
  1816.       typedef struct _CHARMSG {  /* charmsg */
  1817.          USHORT  chr;          /* mp2     */
  1818.          USHORT  vkey;
  1819.          USHORT  fs;           /* mp1     */
  1820.          UCHAR   cRepeat;
  1821.          UCHAR   scancode;
  1822.       } CHRMSG;
  1823.       typedef CHRMSG FAR *PCHRMSG;
  1824.  
  1825.       #define CHARMSG(pmsg) \
  1826.       ((PCHRMSG)((PBYTE)pmsg - sizeof(MPARAM) * 2))
  1827.    #endif
  1828.  
  1829.    #pragma pack()  /* restore packing to default */
  1830.  
  1831.    #define INP_NONE                   0x0000
  1832.    #define INP_KBD                    0x0001
  1833.    #define INP_MULT                   0x0002
  1834.    #define INP_RES2                   0x0004
  1835.    #define INP_SHIFT                  0x0008
  1836.    #define INP_CTRL                   0x0010
  1837.    #define INP_ALT                    0x0020
  1838.    #define INP_RES3                   0x0040
  1839.    #define INP_RES4                   0x0080
  1840.    #define INP_IGNORE                 0xFFFF
  1841.  
  1842.    /*** Virtual key values *************************************************/
  1843.    #define VK_BUTTON1                 0x01
  1844.    #define VK_BUTTON2                 0x02
  1845.    #define VK_BUTTON3                 0x03
  1846.    #define VK_BREAK                   0x04
  1847.    #define VK_BACKSPACE               0x05
  1848.    #define VK_TAB                     0x06
  1849.    #define VK_BACKTAB                 0x07
  1850.    #define VK_NEWLINE                 0x08
  1851.    #define VK_SHIFT                   0x09
  1852.    #define VK_CTRL                    0x0A
  1853.    #define VK_ALT                     0x0B
  1854.    #define VK_ALTGRAF                 0x0C
  1855.    #define VK_PAUSE                   0x0D
  1856.    #define VK_CAPSLOCK                0x0E
  1857.    #define VK_ESC                     0x0F
  1858.    #define VK_SPACE                   0x10
  1859.    #define VK_PAGEUP                  0x11
  1860.    #define VK_PAGEDOWN                0x12
  1861.    #define VK_END                     0x13
  1862.    #define VK_HOME                    0x14
  1863.    #define VK_LEFT                    0x15
  1864.    #define VK_UP                      0x16
  1865.    #define VK_RIGHT                   0x17
  1866.    #define VK_DOWN                    0x18
  1867.    #define VK_PRINTSCRN               0x19
  1868.    #define VK_INSERT                  0x1A
  1869.    #define VK_DELETE                  0x1B
  1870.    #define VK_SCRLLOCK                0x1C
  1871.    #define VK_NUMLOCK                 0x1D
  1872.    #define VK_ENTER                   0x1E
  1873.    #define VK_SYSRQ                   0x1F
  1874.    #define VK_F1                      0x20
  1875.    #define VK_F2                      0x21
  1876.    #define VK_F3                      0x22
  1877.    #define VK_F4                      0x23
  1878.    #define VK_F5                      0x24
  1879.    #define VK_F6                      0x25
  1880.    #define VK_F7                      0x26
  1881.    #define VK_F8                      0x27
  1882.    #define VK_F9                      0x28
  1883.    #define VK_F10                     0x29
  1884.    #define VK_F11                     0x2A
  1885.    #define VK_F12                     0x2B
  1886.    #define VK_F13                     0x2C
  1887.    #define VK_F14                     0x2D
  1888.    #define VK_F15                     0x2E
  1889.    #define VK_F16                     0x2F
  1890.    #define VK_F17                     0x30
  1891.    #define VK_F18                     0x31
  1892.    #define VK_F19                     0x32
  1893.    #define VK_F20                     0x33
  1894.    #define VK_F21                     0x34
  1895.    #define VK_F22                     0x35
  1896.    #define VK_F23                     0x36
  1897.    #define VK_F24                     0x37
  1898.    #define VK_ENDDRAG                 0x38
  1899.    #define VK_CLEAR                   0x39
  1900.    #define VK_EREOF                   0x3A
  1901.    #define VK_PA1                     0x3B
  1902.    #define VK_ATTN                    0x3C
  1903.    #define VK_CRSEL                   0x3D
  1904.    #define VK_EXSEL                   0x3E
  1905.    #define VK_COPY                    0x3F
  1906.    #define VK_BLK1                    0x40
  1907.    #define VK_BLK2                    0x41
  1908.  
  1909.  
  1910.    #define VK_MENU                    VK_F10
  1911.    #ifdef INCL_NLS
  1912.       #define VK_DBCSFIRST            0x0080
  1913.       #define VK_DBCSLAST             0x00ff
  1914.  
  1915.       /* VK_ vluaes 0xE0 - 0xFF are reserved   */
  1916.       /* for bidirectional language support.   */
  1917.  
  1918.       #define VK_BIDI_FIRST           0xE0
  1919.       #define VK_BIDI_LAST            0xFF
  1920.  
  1921.    #endif /* INCL_NLS */
  1922.  
  1923.    #define VK_USERFIRST               0x0100
  1924.    #define VK_USERLAST                0x01ff
  1925.  
  1926.    #ifndef INCL_SAADEFS
  1927.  
  1928.       #ifdef INCL_32
  1929.          LONG APIENTRY WinGetKeyState(HWND hwndDesktop,
  1930.                                       LONG vkey);
  1931.          LONG APIENTRY WinGetPhysKeyState(HWND hwndDesktop,
  1932.                                           LONG sc);
  1933.       #else
  1934.          SHORT APIENTRY WinGetKeyState(HWND hwndDesktop,
  1935.                                        SHORT vkey);
  1936.          SHORT APIENTRY WinGetPhysKeyState(HWND hwndDesktop,
  1937.                                            SHORT sc);
  1938.       #endif
  1939.       BOOL  APIENTRY WinEnablePhysInput(HWND hwndDesktop,
  1940.                                         BOOL fEnable);
  1941.       BOOL  APIENTRY WinIsPhysInputEnabled(HWND hwndDesktop);
  1942.       BOOL  APIENTRY WinSetKeyboardStateTable(HWND hwndDesktop,
  1943.                                               PBYTE pKeyStateTable,
  1944.                                               BOOL fSet);
  1945.  
  1946.  
  1947.       /* Journal Notification messages  */
  1948.       #define WM_JOURNALNOTIFY           0x007c
  1949.  
  1950.       /*** Define the valid commands (lParm1) for journal notify message */
  1951.       #define JRN_QUEUESTATUS            0x00000001L
  1952.       #define JRN_PHYSKEYSTATE           0x00000002L
  1953.  
  1954.    #endif /* !INCL_SAADEFS */
  1955. #endif /* INCL_WININPUT */
  1956.  
  1957.    typedef LHANDLE HPOINTER;   /* hptr */
  1958.  
  1959.  
  1960. /**** Dialog Manager */
  1961.  
  1962. #if (defined(INCL_WINDIALOGS) || !defined(INCL_NOCOMMON))
  1963.    /**** Dialog Manager COMMON subsection */
  1964.  
  1965.    BOOL    APIENTRY WinGetDlgMsg(HWND hwndDlg,
  1966.                                  PQMSG pqmsg);
  1967.  
  1968.    #ifdef INCL_32
  1969.       HWND    APIENTRY WinLoadDlg(HWND hwndParent,
  1970.                                   HWND hwndOwner,
  1971.                                   PFNWP pfnDlgProc,
  1972.                                   HMODULE hmod,
  1973.                                   ULONG idDlg,
  1974.                                   PVOID pCreateParams);
  1975.       ULONG  APIENTRY WinDlgBox(HWND hwndParent,
  1976.                                 HWND hwndOwner,
  1977.                                 PFNWP pfnDlgProc,
  1978.                                 HMODULE hmod,
  1979.                                 ULONG idDlg,
  1980.                                 PVOID pCreateParams);
  1981.  
  1982.       BOOL    APIENTRY WinDismissDlg(HWND hwndDlg,
  1983.                                      ULONG usResult);
  1984.  
  1985.       BOOL    APIENTRY WinQueryDlgItemShort(HWND hwndDlg,
  1986.                                             ULONG idItem,
  1987.                                             PSHORT pResult,
  1988.                                             BOOL fSigned);
  1989.       BOOL    APIENTRY WinSetDlgItemShort(HWND hwndDlg,
  1990.                                           ULONG idItem,
  1991.                                           USHORT usValue,
  1992.                                           BOOL fSigned);
  1993.       BOOL    APIENTRY WinSetDlgItemText(HWND hwndDlg,
  1994.                                          ULONG idItem,
  1995.                                          PSZ pszText);
  1996.       ULONG  APIENTRY WinQueryDlgItemText(HWND hwndDlg,
  1997.                                           ULONG idItem,
  1998.                                           LONG cchBufferMax,
  1999.                                           PSZ pchBuffer);
  2000.       LONG   APIENTRY WinQueryDlgItemTextLength(HWND hwndDlg,
  2001.                                                 ULONG idItem);
  2002.  
  2003.       MRESULT APIENTRY WinDefDlgProc(HWND hwndDlg,
  2004.                                      ULONG msg,
  2005.                                      MPARAM mp1,
  2006.                                      MPARAM mp2);
  2007.    #else
  2008.       HWND    APIENTRY WinLoadDlg(HWND hwndParent,
  2009.                                   HWND hwndOwner,
  2010.                                   PFNWP pfnDlgProc,
  2011.                                   HMODULE hmod,
  2012.                                   USHORT idDlg,
  2013.                                   PVOID pCreateParams);
  2014.       USHORT  APIENTRY WinDlgBox(HWND hwndParent,
  2015.                                  HWND hwndOwner,
  2016.                                  PFNWP pfnDlgProc,
  2017.                                  HMODULE hmod,
  2018.                                  USHORT idDlg,
  2019.                                  PVOID pCreateParams);
  2020.  
  2021.       BOOL    APIENTRY WinDismissDlg(HWND hwndDlg,
  2022.                                      USHORT usResult);
  2023.  
  2024.       BOOL    APIENTRY WinQueryDlgItemShort(HWND hwndDlg,
  2025.                                             USHORT idItem,
  2026.                                             PSHORT pResult,
  2027.                                             BOOL fSigned);
  2028.       BOOL    APIENTRY WinSetDlgItemShort(HWND hwndDlg,
  2029.                                           USHORT idItem,
  2030.                                           USHORT usValue,
  2031.                                           BOOL fSigned);
  2032.       BOOL    APIENTRY WinSetDlgItemText(HWND hwndDlg,
  2033.                                          USHORT idItem,
  2034.                                          PSZ pszText);
  2035.       USHORT  APIENTRY WinQueryDlgItemText(HWND hwndDlg,
  2036.                                            USHORT idItem,
  2037.                                            SHORT cchBufferMax,
  2038.                                            PSZ pchBuffer);
  2039.       SHORT   APIENTRY WinQueryDlgItemTextLength(HWND hwndDlg,
  2040.                                                  USHORT idItem);
  2041.  
  2042.       MRESULT APIENTRY WinDefDlgProc(HWND hwndDlg,
  2043.                                      USHORT msg,
  2044.                                      MPARAM mp1,
  2045.                                      MPARAM mp2);
  2046.    #endif
  2047.  
  2048.    /* Special item IDs */
  2049.  
  2050.    #ifndef INCL_SAADEFS
  2051.       #define DID_OK      1
  2052.       #define DID_CANCEL  2
  2053.       #define DID_ERROR   0xffff
  2054.    #endif /* !INCL_SAADEFS */
  2055.  
  2056.    #ifdef INCL_32
  2057.       BOOL APIENTRY WinAlarm(HWND hwndDesktop,
  2058.                              ULONG rgfType);
  2059.    #else
  2060.       BOOL APIENTRY WinAlarm(HWND hwndDesktop,
  2061.                              USHORT rgfType);
  2062.    #endif
  2063.  
  2064.    /* WinAlarm Codes */
  2065.  
  2066.    #define WA_WARNING                 0
  2067.    #define WA_NOTE                    1
  2068.    #define WA_ERROR                   2
  2069.    #define WA_CWINALARMS             13     /* count of valid alarms     53304*/
  2070.  
  2071.    #ifdef INCL_32
  2072.  
  2073.       ULONG APIENTRY WinMessageBox(HWND hwndParent,
  2074.                                    HWND hwndOwner,
  2075.                                    PSZ pszText,
  2076.                                    PSZ pszCaption,
  2077.                                    ULONG idWindow,
  2078.                                    ULONG flStyle);
  2079.  
  2080.    #else /* not INCL_32 */
  2081.  
  2082.       USHORT APIENTRY WinMessageBox(HWND hwndParent,
  2083.                                     HWND hwndOwner,
  2084.                                     PSZ pszText,
  2085.                                     PSZ pszCaption,
  2086.                                     USHORT idWindow,
  2087.                                     USHORT fsStyle);
  2088.  
  2089.    #endif /* INCL_32 */
  2090.  
  2091.  
  2092.  
  2093.    #define MAX_MBDTEXT               70
  2094.  
  2095. /* NOINC */
  2096.    #pragma pack(4)
  2097.  
  2098.    typedef struct _MB2D
  2099.    {
  2100.        CHAR   achText[MAX_MBDTEXT + 1]; /* Text of the button. eg. "~Cancel"    */
  2101.        ULONG  idButton;                  /* Button ID returned when user chooses */
  2102.        /*  button                              */
  2103.        LONG   flStyle;                   /* Button style or'ed with internal     */
  2104.        /*  styles                              */
  2105.    } MB2D;
  2106.  
  2107.    typedef MB2D * PMB2D;
  2108.  
  2109.    typedef struct _MB2INFO
  2110.    {
  2111.       ULONG    cb;                  /* Size of fixed part of structure          */
  2112.       HPOINTER hIcon;               /* Icon handle                              */
  2113.       ULONG    cButtons;            /* Number of buttons                        */
  2114.       ULONG    flStyle;             /* Icon style flags (MB_ICONQUESTION, etc...)*/
  2115.       HWND     hwndNotify;          /* Reserved                                 */
  2116.       MB2D     mb2d[1];             /* Array of button definitions              */
  2117.    } MB2INFO;
  2118.  
  2119.    typedef MB2INFO * PMB2INFO;
  2120.  
  2121.    #pragma pack()
  2122.  
  2123.    /************************************************************************/
  2124.    /* WinMessageBox2                                                       */
  2125.    /*                                                                      */
  2126.    /* Parameters: HWND   hwndParent   - handle of the parent window.       */
  2127.    /*             HWND   hwndOwner    - handle of the owner window.        */
  2128.    /*             PSZ    pszText      - message text.                      */
  2129.    /*             PSZ    pszCaption   - title of the message box.          */
  2130.    /*             ULONG  idWindow     - Message box id                     */
  2131.    /*             PMB2INFO pmb2info   - pointer to button/icon info        */
  2132.    /************************************************************************/
  2133.    ULONG  EXPENTRY  WinMessageBox2(HWND     hwndParent,
  2134.                                    HWND     hwndOwner,
  2135.                                    PSZ      pszText,
  2136.                                    PSZ      pszCaption,
  2137.                                    ULONG    idWindow,
  2138.                                    PMB2INFO pmb2info);
  2139.  
  2140. /* INC */
  2141.  
  2142.    /* Message box types */
  2143.  
  2144.    #define MB_OK                      0x0000
  2145.    #define MB_OKCANCEL                0x0001
  2146.    #define MB_RETRYCANCEL             0x0002
  2147.    #define MB_ABORTRETRYIGNORE        0x0003
  2148.    #define MB_YESNO                   0x0004
  2149.    #define MB_YESNOCANCEL             0x0005
  2150.    #define MB_CANCEL                  0x0006
  2151.    #define MB_ENTER                   0x0007
  2152.    #define MB_ENTERCANCEL             0x0008
  2153.  
  2154.    #define MB_NOICON                  0x0000
  2155.    #define MB_CUANOTIFICATION         0x0000
  2156.    #define MB_ICONQUESTION            0x0010
  2157.    #define MB_ICONEXCLAMATION         0x0020
  2158.    #define MB_CUAWARNING              0x0020
  2159.    #define MB_ICONASTERISK            0x0030
  2160.    #define MB_ICONHAND                0x0040
  2161.    #define MB_CUACRITICAL             0x0040
  2162.    #define MB_QUERY                   MB_ICONQUESTION
  2163.    #define MB_WARNING                 MB_CUAWARNING
  2164.    #define MB_INFORMATION             MB_ICONASTERISK
  2165.    #define MB_CRITICAL                MB_CUACRITICAL
  2166.    #define MB_ERROR                   MB_CRITICAL
  2167.    #define MB_CUSTOMICON              0x0080
  2168.  
  2169.    #define MB_DEFBUTTON1              0x0000
  2170.    #define MB_DEFBUTTON2              0x0100
  2171.    #define MB_DEFBUTTON3              0x0200
  2172.  
  2173.    #define MB_APPLMODAL               0x0000
  2174.    #define MB_SYSTEMMODAL             0x1000
  2175.    #define MB_HELP                    0x2000
  2176.    #define MB_MOVEABLE                0x4000
  2177.    #define MB_NONMODAL                0x8000
  2178.  
  2179.  
  2180.    /* Message box return codes */
  2181.  
  2182.    #define MBID_OK                    1
  2183.    #define MBID_CANCEL                2
  2184.    #define MBID_ABORT                 3
  2185.    #define MBID_RETRY                 4
  2186.    #define MBID_IGNORE                5
  2187.    #define MBID_YES                   6
  2188.    #define MBID_NO                    7
  2189.    #define MBID_HELP                  8
  2190.    #define MBID_ENTER                 9
  2191.    #define MBID_ERROR                 0xffff
  2192.  
  2193.  
  2194.    /* Useful macros */
  2195.  
  2196.    /***************************************************************************
  2197.    * ULONG/USHORT WinCheckButton(HWND hwndDlg, USHORT id, USHORT checkState)
  2198.    *    sets the check state of button #id.
  2199.    *    returns the previous check state.
  2200.    ***************************************************************************/
  2201.    #ifdef INCL_32
  2202.       #define WinCheckButton(hwndDlg, id, usCheckState) \
  2203.       ((ULONG)WinSendDlgItemMsg(hwndDlg, id, BM_SETCHECK, \
  2204.       MPFROMSHORT(usCheckState), (MPARAM)NULL))
  2205.    #else
  2206.       #define WinCheckButton(hwndDlg, id, usCheckState) \
  2207.       ((USHORT)WinSendDlgItemMsg(hwndDlg, id, BM_SETCHECK, \
  2208.       MPFROMSHORT(usCheckState), (MPARAM)NULL))
  2209.    #endif
  2210.  
  2211.    /***************************************************************************
  2212.    * ULONG/USHORT WinQueryButtonCheckstate(HWND hwndDlg, USHORT id)
  2213.    *    returns the check state of buttin #id.
  2214.    *
  2215.    ***************************************************************************/
  2216.    #ifdef INCL_32
  2217.       #define WinQueryButtonCheckstate(hwndDlg, id) \
  2218.       ((ULONG)WinSendDlgItemMsg(hwndDlg, id, BM_QUERYCHECK, \
  2219.       (MPARAM)NULL, (MPARAM)NULL))
  2220.    #else
  2221.       #define WinQueryButtonCheckstate(hwndDlg, id) \
  2222.       ((USHORT)WinSendDlgItemMsg(hwndDlg, id, BM_QUERYCHECK, \
  2223.       (MPARAM)NULL, (MPARAM)NULL))
  2224.    #endif
  2225.  
  2226.    /***************************************************************************
  2227.    * BOOL WinEnableControl(HWND hwndDlg, USHORT id, BOOL fEnable)
  2228.    *    sets the enable state of button #id.
  2229.    *    returns fSuccess.
  2230.    ***************************************************************************/
  2231.    #define WinEnableControl(hwndDlg, id, fEnable) \
  2232.    WinEnableWindow(WinWindowFromID(hwndDlg, id), fEnable)
  2233.  
  2234.    /***************************************************************************
  2235.    * BOOL WinIsControlEnabled(HWND hwndDlg, ULONG id)
  2236.    *    returns the enable state of control #id.
  2237.    *
  2238.    ***************************************************************************/
  2239.    #define WinIsControlEnabled(hwndDlg, id) \
  2240.    ((BOOL)WinIsWindowEnabled(WinWindowFromID(hwndDlg, id)))
  2241.  
  2242. #endif /* Dialog Manager COMMON subsection */
  2243.  
  2244.  
  2245. #ifdef INCL_WINDIALOGS
  2246.  
  2247.    /* Dialog codes: returned by WM_QUERYDLGCODE msg     */
  2248.  
  2249.    #define DLGC_ENTRYFIELD    0x0001  /* Entry field item understands EM_SETSEL) */
  2250.    #define DLGC_BUTTON        0x0002  /* Button item                             */
  2251.    #define DLGC_RADIOBUTTON   0x0004  /* Radio button                            */
  2252.    #define DLGC_STATIC        0x0008  /* Static item                             */
  2253.    #define DLGC_DEFAULT       0x0010  /* Default push button                     */
  2254.    #define DLGC_PUSHBUTTON    0x0020  /* Normal (Non-default) push button        */
  2255.    #define DLGC_CHECKBOX      0x0040  /* Check box button control                */
  2256.    #define DLGC_SCROLLBAR     0x0080  /* Scroll bar                              */
  2257.    #define DLGC_MENU          0x0100  /* Menu                                    */
  2258.    #define DLGC_TABONCLICK    0x0200
  2259.    #define DLGC_MLE           0x0400  /* Multiple Line Entry                     */
  2260.  
  2261.  
  2262.    #ifdef INCL_32
  2263.       ULONG  APIENTRY WinProcessDlg(HWND hwndDlg);
  2264.       MRESULT APIENTRY WinSendDlgItemMsg(HWND hwndDlg,
  2265.                                          ULONG idItem,
  2266.                                          ULONG msg,
  2267.                                          MPARAM mp1,
  2268.                                          MPARAM mp2);
  2269.       BOOL    APIENTRY WinMapDlgPoints(HWND hwndDlg,
  2270.                                        PPOINTL prgwptl,
  2271.                                        ULONG cwpt,
  2272.                                        BOOL fCalcWindowCoords);
  2273.       HWND    APIENTRY WinEnumDlgItem(HWND hwndDlg,
  2274.                                       HWND hwnd,
  2275.                                       ULONG code);
  2276.       LONG   APIENTRY WinSubstituteStrings(HWND hwnd,
  2277.                                            PSZ pszSrc,
  2278.                                            LONG cchDstMax,
  2279.                                            PSZ pszDst);
  2280.    #else
  2281.       USHORT  APIENTRY WinProcessDlg(HWND hwndDlg);
  2282.       MRESULT APIENTRY WinSendDlgItemMsg(HWND hwndDlg,
  2283.                                          USHORT idItem,
  2284.                                          USHORT msg,
  2285.                                          MPARAM mp1,
  2286.                                          MPARAM mp2);
  2287.       BOOL    APIENTRY WinMapDlgPoints(HWND hwndDlg,
  2288.                                        PPOINTL prgwptl,
  2289.                                        USHORT cwpt,
  2290.                                        BOOL fCalcWindowCoords);
  2291.       HWND    APIENTRY WinEnumDlgItem(HWND hwndDlg,
  2292.                                       HWND hwnd,
  2293.                                       USHORT code,
  2294.                                       BOOL fLock);
  2295.       SHORT   APIENTRY WinSubstituteStrings(HWND hwnd,
  2296.                                             PSZ pszSrc,
  2297.                                             SHORT cchDstMax,
  2298.                                             PSZ pszDst);
  2299.    #endif  /* INCL_32 */
  2300.  
  2301.  
  2302.    /* WinEnumDlgItem() constants */
  2303.  
  2304.    #define EDI_FIRSTTABITEM           0
  2305.    #define EDI_LASTTABITEM            1
  2306.    #define EDI_NEXTTABITEM            2
  2307.    #define EDI_PREVTABITEM            3
  2308.    #define EDI_FIRSTGROUPITEM         4
  2309.    #define EDI_LASTGROUPITEM          5
  2310.    #define EDI_NEXTGROUPITEM          6
  2311.    #define EDI_PREVGROUPITEM          7
  2312.  
  2313.    /*** Dialog template definitions */
  2314.  
  2315.    /*** Variable-sized dialog template items: ******************************/
  2316.  
  2317.    #pragma pack(2) /* force structure alignment packing */
  2318.  
  2319.    /*************************************************************************
  2320.    *
  2321.    *  We pack the structures _DLGTITEM and _DLGTEMPLATE so that the
  2322.    *  structures are identical in the 32-bit and 16-bit worlds. We have
  2323.    *  to do this because is has been documented that one can pass a
  2324.    *  pointer to 'the binary resource format' when calling WinCreateDlg.
  2325.    *
  2326.    *************************************************************************/
  2327.  
  2328.    /* Binary resources may be bound into application executables or */
  2329.    /* passed as a parameter when creating a window or dialog        */
  2330.    /* Currently they must be the same for both 16-bit and 32-bit    */
  2331.    /* so we pack the structures.                                    */
  2332.    typedef struct _DLGTITEM {  /* dlgti */
  2333.       USHORT  fsItemStatus;
  2334.       USHORT  cChildren;
  2335.       USHORT  cchClassName;
  2336.       USHORT  offClassName;
  2337.       USHORT  cchText;
  2338.       USHORT  offText;
  2339.       ULONG   flStyle;
  2340.       SHORT   x;
  2341.       SHORT   y;
  2342.       SHORT   cx;
  2343.       SHORT   cy;
  2344.       USHORT  id;
  2345.       USHORT  offPresParams;
  2346.       USHORT  offCtlData;
  2347.    } DLGTITEM;
  2348.    typedef DLGTITEM FAR *PDLGTITEM;
  2349.  
  2350.    /*** Dialog Template structure ******************************************/
  2351.  
  2352.    /* Binary resources may be bound into application executables or */
  2353.    /* passed as a parameter when creating a window or dialog        */
  2354.    /* Currently they must be the same for both 16-bit and 32-bit    */
  2355.    /* so we pack the structures.                                    */
  2356.    typedef struct _DLGTEMPLATE {  /* dlgt */
  2357.       USHORT   cbTemplate;
  2358.       USHORT   type;
  2359.       USHORT   codepage;
  2360.       USHORT   offadlgti;
  2361.       USHORT   fsTemplateStatus;
  2362.       USHORT   iItemFocus;
  2363.       USHORT   coffPresParams;
  2364.       DLGTITEM adlgti[1];
  2365.    } DLGTEMPLATE;
  2366.    typedef DLGTEMPLATE FAR *PDLGTEMPLATE;
  2367.  
  2368.    #pragma pack()  /* restore packing to default */
  2369.  
  2370.    HWND   APIENTRY WinCreateDlg(HWND hwndParent,
  2371.                                 HWND hwndOwner,
  2372.                                 PFNWP pfnDlgProc,
  2373.                                 PDLGTEMPLATE pdlgt,
  2374.                                 PVOID pCreateParams);
  2375.  
  2376.  
  2377. #endif /* INCL_WINDIALOGS */
  2378.  
  2379.  
  2380. #ifdef INCL_WINSTATICS
  2381.  
  2382.    /*** Static Control Manager */
  2383.  
  2384.    /* Static control styles:
  2385.    *
  2386.    * NOTE: the top 9 bits of the LOWORD of the window flStyle are used for
  2387.    * DT_* flags.  The lower 7 bits are for SS_* styles.  This gives us up
  2388.    * to 128 distinct static control types (we currently use 11 of them).
  2389.    */
  2390.    #define SS_TEXT                    0x0001L
  2391.    #define SS_GROUPBOX                0x0002L
  2392.  
  2393.    #ifndef INCL_SAADEFS
  2394.       #define SS_ICON                    0x0003L
  2395.       #define SS_BITMAP                  0x0004L
  2396.    #endif /* !INCL_SAADEFS */
  2397.    #define SS_FGNDRECT                0x0005L
  2398.    #ifndef INCL_SAADEFS
  2399.       #define SS_HALFTONERECT            0x0006L
  2400.    #endif /* !INCL_SAADEFS */
  2401.    #define SS_BKGNDRECT               0x0007L
  2402.    #define SS_FGNDFRAME               0x0008L
  2403.    #ifndef INCL_SAADEFS
  2404.       #define SS_HALFTONEFRAME           0x0009L
  2405.    #endif /* !INCL_SAADEFS */
  2406.    #define SS_BKGNDFRAME              0x000aL
  2407.    #define SS_SYSICON                 0x000bL
  2408.    #define SS_AUTOSIZE         0x0040L
  2409.  
  2410.  
  2411.    /* Static control messages */
  2412.  
  2413.    #define SM_SETHANDLE               0x0100
  2414.    #define SM_QUERYHANDLE             0x0101
  2415.  
  2416.    /* Message Box 2 notification messages */
  2417.    #define WM_MSGBOXINIT              0x010E
  2418.    #define WM_MSGBOXDISMISS           0x010F
  2419. #endif /* INCL_WINSTATICS */
  2420.  
  2421.  
  2422. #ifdef INCL_WINBUTTONS
  2423.    /**** Button Controls Subsection */
  2424.  
  2425.    /* Button control styles */
  2426.  
  2427.    #define BS_PUSHBUTTON              0L
  2428.    #define BS_CHECKBOX                1L
  2429.    #define BS_AUTOCHECKBOX            2L
  2430.    #define BS_RADIOBUTTON             3L
  2431.    #define BS_AUTORADIOBUTTON         4L
  2432.    #define BS_3STATE                  5L
  2433.    #define BS_AUTO3STATE              6L
  2434.  
  2435.    #ifndef INCL_SAADEFS
  2436.       #define BS_USERBUTTON              7L
  2437.    #endif /* !INCL_SAADEFS */
  2438.    #define BS_PRIMARYSTYLES       0x000fL
  2439.  
  2440.    #define BS_TEXT                 0x0010
  2441.    #define BS_MINIICON             0x0020
  2442.    #define BS_BITMAP           0x0040L
  2443.    #define BS_ICON             0x0080L
  2444.    #define BS_HELP                    0x0100L
  2445.    #define BS_SYSCOMMAND              0x0200L
  2446.    #define BS_DEFAULT                 0x0400L
  2447.    #define BS_NOPOINTERFOCUS          0x0800L
  2448.    #define BS_NOBORDER                0x1000L
  2449.    #define BS_NOCURSORSELECT          0x2000L
  2450.    #define BS_AUTOSIZE             0x4000L
  2451.  
  2452.  
  2453.  
  2454.    #ifndef INCL_SAADEFS
  2455.       #pragma pack(2) /* force structure alignment packing */
  2456.  
  2457.       /* Binary resources may be bound into application executables or */
  2458.       /* passed as a parameter when creating a window or dialog        */
  2459.       /* Currently they must be the same for both 16-bit and 32-bit    */
  2460.       /* so we pack the structures.                                    */
  2461.       typedef struct _BTNCDATA {  /* btncd */
  2462.          USHORT  cb;
  2463.          USHORT  fsCheckState;
  2464.          USHORT  fsHiliteState;
  2465.          LHANDLE hImage;
  2466.       } BTNCDATA;
  2467.       typedef BTNCDATA FAR *PBTNCDATA;
  2468.  
  2469.       #pragma pack()  /* restore packing to default */
  2470.  
  2471.    #endif /* !INCL_SAADEFS */
  2472.  
  2473.    /*** User button structure (passed in WM_CONTROL msg) *******************/
  2474.  
  2475.    #ifndef INCL_SAADEFS
  2476.       #ifdef INCL_32
  2477.          typedef struct _USERBUTTON {  /* ubtn */
  2478.             HWND    hwnd;
  2479.             HPS     hps;
  2480.             ULONG   fsState;
  2481.             ULONG   fsStateOld;
  2482.          } USERBUTTON;
  2483.       #else
  2484.          typedef struct _USERBUTTON {  /* ubtn */
  2485.             HWND    hwnd;
  2486.             HPS     hps;
  2487.             USHORT  fsState;
  2488.             USHORT  fsStateOld;
  2489.          } USERBUTTON;
  2490.       #endif
  2491.       typedef USERBUTTON FAR *PUSERBUTTON;
  2492.    #endif /* !INCL_SAADEFS */
  2493.  
  2494.    /* Button control messages */
  2495.  
  2496.    #define BM_CLICK                   0x0120
  2497.    #define BM_QUERYCHECKINDEX         0x0121
  2498.    #define BM_QUERYHILITE             0x0122
  2499.    #define BM_SETHILITE               0x0123
  2500.    #define BM_QUERYCHECK              0x0124
  2501.    #define BM_SETCHECK                0x0125
  2502.    #define BM_SETDEFAULT              0x0126
  2503.  
  2504.    /* Button notification codes */
  2505.  
  2506.    #define BN_CLICKED                 1
  2507.    #define BN_DBLCLICKED              2
  2508.    #define BN_PAINT                   3
  2509.  
  2510.    /* BN_PAINT button draw state codes (must be in high byte) */
  2511.  
  2512.    #ifndef INCL_SAADEFS
  2513.       #define BDS_HILITED                0x0100
  2514.       #define BDS_DISABLED               0x0200
  2515.       #define BDS_DEFAULT                0x0400
  2516.  
  2517.    #endif /* !INCL_SAADEFS */
  2518.  
  2519. #endif /* INCL_WINBUTTONS */
  2520.  
  2521.  
  2522. #ifdef INCL_WINENTRYFIELDS
  2523.    /**** Entryfield controls Subsection */
  2524.  
  2525.    /* Entry field  styles */
  2526.  
  2527.    #define ES_LEFT                    0x00000000L
  2528.    #define ES_CENTER                  0x00000001L
  2529.    #define ES_RIGHT                   0x00000002L
  2530.  
  2531.    #ifndef INCL_SAADEFS
  2532.       #define ES_AUTOSCROLL              0x00000004L
  2533.    #endif /* !INCL_SAADEFS */
  2534.  
  2535.    #define ES_MARGIN                  0x00000008L
  2536.    #define ES_AUTOTAB                 0x00000010L
  2537.    #define ES_READONLY                0x00000020L
  2538.    #define ES_COMMAND                 0x00000040L
  2539.    #define ES_UNREADABLE              0x00000080L
  2540.    #define ES_AUTOSIZE                0x00000200L
  2541.  
  2542.    #ifdef INCL_NLS
  2543.       #define ES_ANY                     0x00000000L
  2544.       #define ES_SBCS                    0x00001000L
  2545.       #define ES_DBCS                    0x00002000L
  2546.       #define ES_MIXED                   0x00003000L
  2547.    #endif /* INCL_NLS */
  2548.  
  2549.  
  2550.    /*
  2551.    * combo box styles
  2552.    */
  2553.    #define CBS_SIMPLE                 0x0001L
  2554.    #define CBS_DROPDOWN               0x0002L
  2555.    #define CBS_DROPDOWNLIST           0x0004L
  2556.  
  2557.    /*
  2558.    * Use this bit for drop down combo boxes that do not want to
  2559.    * receive a CBN_ENTER on a single click in their list boxes.
  2560.    * This is for compatibility with releases prior to OS/2 2.0 which
  2561.    * did not send this message
  2562.    */
  2563.    #define CBS_COMPATIBLE             0x0008L
  2564.  
  2565.    /*
  2566.    * The following edit and listbox styles may be used in conjunction
  2567.    * with CBS_ styles
  2568.    * ES_AUTOTAB ES_ANY ES_SBCS ES_DBCS ES_MIXED LS_HORZSCROLL
  2569.    */
  2570.  
  2571.    /*
  2572.    * IDs of combobox entry field and listbox.
  2573.    */
  2574.    #define CBID_LIST                  0x029A
  2575.    #define CBID_EDIT                  0x029B
  2576.  
  2577.    #define CBM_SHOWLIST               0x0170
  2578.    #define CBM_HILITE                 0x0171
  2579.    #define CBM_ISLISTSHOWING          0x0172
  2580.  
  2581.    #define CBN_EFCHANGE               1
  2582.    #define CBN_EFSCROLL               2
  2583.    #define CBN_MEMERROR               3
  2584.    #define CBN_LBSELECT               4
  2585.    #define CBN_LBSCROLL               5
  2586.    #define CBN_SHOWLIST               6
  2587.    #define CBN_ENTER                  7
  2588.  
  2589.  
  2590.    #ifndef INCL_SAADEFS
  2591.       #pragma pack(2) /* force structure alignment packing */
  2592.  
  2593.       /* Binary resources may be bound into application executables or */
  2594.       /* passed as a parameter when creating a window or dialog        */
  2595.       /* Currently they must be the same for both 16-bit and 32-bit    */
  2596.       /* so we pack the structures.                                    */
  2597.  
  2598.       /*******************************************************************/
  2599.       /* Combobox control data structure                                 */
  2600.       /*******************************************************************/
  2601.       typedef struct _COMBOCDATA          /* combocdata */
  2602.       {
  2603.          ULONG   cbSize;             /* Size of control block             */
  2604.          ULONG   reserved;           /* reserved field                    */
  2605.          PVOID   pHWXCtlData;        /* reserved for Pen CtlData (penpm.h)*/
  2606.       } COMBOCDATA;
  2607.       typedef COMBOCDATA *PCOMBOCDATA;
  2608.  
  2609.       typedef struct _ENTRYFDATA {  /* efd */
  2610.          USHORT  cb;
  2611.          USHORT  cchEditLimit;
  2612.          USHORT  ichMinSel;
  2613.          USHORT  ichMaxSel;
  2614.          PVOID   pHWXCtlData;    /* reserved for Pen CtlData (penpm.h)  */
  2615.       } ENTRYFDATA;
  2616.       typedef ENTRYFDATA FAR *PENTRYFDATA;
  2617.  
  2618.       #pragma pack()  /* restore packing to default */
  2619.  
  2620.    #endif /* !INCL_SAADEFS */
  2621.  
  2622.    /* Entry Field  messages */
  2623.  
  2624.    #define EM_QUERYCHANGED            0x0140
  2625.    #define EM_QUERYSEL                0x0141
  2626.    #define EM_SETSEL                  0x0142
  2627.    #define EM_SETTEXTLIMIT            0x0143
  2628.  
  2629.    #ifndef INCL_SAADEFS
  2630.       #define EM_CUT                     0x0144
  2631.       #define EM_COPY                    0x0145
  2632.    #endif /* !INCL_SAADEFS */
  2633.    #define EM_CLEAR                   0x0146
  2634.    #ifndef INCL_SAADEFS
  2635.       #define EM_PASTE                   0x0147
  2636.    #endif /* !INCL_SAADEFS */
  2637.    #define EM_QUERYFIRSTCHAR          0x0148
  2638.    #define EM_SETFIRSTCHAR            0x0149
  2639.    #ifndef INCL_SAADEFS
  2640.       #define EM_QUERYREADONLY           0x014a
  2641.       #define EM_SETREADONLY             0x014b
  2642.       #define EM_SETINSERTMODE           0x014c
  2643.    #endif /* !INCL_SAADEFS */
  2644.  
  2645.    /* Entry Field notification messages */
  2646.  
  2647.    #define EN_SETFOCUS                0x0001
  2648.    #define EN_KILLFOCUS               0x0002
  2649.    #define EN_CHANGE                  0x0004
  2650.    #define EN_SCROLL                  0x0008
  2651.    #ifndef INCL_SAADEFS
  2652.       #define EN_MEMERROR                0x0010
  2653.       #define EN_OVERFLOW                0x0020
  2654.       #define EN_INSERTMODETOGGLE        0x0040
  2655.    #endif /* !INCL_SAADEFS */
  2656.  
  2657. #endif /* INCL_WINENTRYFIELDS */
  2658.  
  2659.  
  2660. /*  Multiple Line Entrys */
  2661. #ifdef INCL_WINMLE
  2662.    #include <pmmle.h>
  2663. #endif /* !INCL_WINMLE */
  2664. #ifdef INCL_WINLISTBOXES
  2665.  
  2666.    /**** Listboxes */
  2667.  
  2668.    /* List box styles */
  2669.  
  2670.    #define LS_MULTIPLESEL             0x00000001L
  2671.  
  2672.    #ifndef INCL_SAADEFS
  2673.       #define LS_OWNERDRAW               0x00000002L
  2674.    #endif /* !INCL_SAADEFS */
  2675.  
  2676.    #define LS_NOADJUSTPOS             0x00000004L
  2677.    #define LS_HORZSCROLL              0x00000008L
  2678.  
  2679.    #define LS_EXTENDEDSEL             0x00000010L
  2680.  
  2681.  
  2682.    /* List box notification messages */
  2683.  
  2684.    #define LN_SELECT                  1
  2685.    #define LN_SETFOCUS                2
  2686.    #define LN_KILLFOCUS               3
  2687.    #define LN_SCROLL                  4
  2688.    #define LN_ENTER                   5
  2689.  
  2690.    /* List box messages */
  2691.  
  2692.    #define LM_QUERYITEMCOUNT          0x0160
  2693.    #define LM_INSERTITEM              0x0161
  2694.    #define LM_SETTOPINDEX             0x0162
  2695.    #define LM_DELETEITEM              0x0163
  2696.    #define LM_SELECTITEM              0x0164
  2697.    #define LM_QUERYSELECTION          0x0165
  2698.    #define LM_SETITEMTEXT             0x0166
  2699.    #define LM_QUERYITEMTEXTLENGTH     0x0167
  2700.    #define LM_QUERYITEMTEXT           0x0168
  2701.  
  2702.    #define LM_SETITEMHANDLE           0x0169
  2703.    #define LM_QUERYITEMHANDLE         0x016a
  2704.    #define LM_SEARCHSTRING            0x016b
  2705.    #define LM_SETITEMHEIGHT           0x016c
  2706.    #define LM_QUERYTOPINDEX           0x016d
  2707.    #define LM_DELETEALL               0x016e
  2708.    #define LM_INSERTMULTITEMS         0x016f
  2709.    #define LM_SETITEMWIDTH            0x0660
  2710.  
  2711.  
  2712.    /* List box constants */
  2713.  
  2714.    #define LIT_CURSOR         (-4)
  2715.    #define LIT_ERROR                  (-3)
  2716.    #define LIT_MEMERROR               (-2)
  2717.    #define LIT_NONE                   (-1)
  2718.    #define LIT_FIRST                  (-1)
  2719.  
  2720.    /* For LM_INSERTITEM msg */
  2721.  
  2722.    #define LIT_END                    (-1)
  2723.    #define LIT_SORTASCENDING          (-2)
  2724.    #define LIT_SORTDESCENDING         (-3)
  2725.  
  2726.    /* For LM_SEARCHSTRING msg */
  2727.  
  2728.    #define LSS_SUBSTRING              0x0001
  2729.    #define LSS_PREFIX                 0x0002
  2730.    #define LSS_CASESENSITIVE          0x0004
  2731.  
  2732.    /*******************************************************************/
  2733.    /* Structure for use with LM_INSERTMULTITEMS                       */
  2734.    /*******************************************************************/
  2735.  
  2736.    typedef struct _LBOXINFO         /* lboxinfo */
  2737.    {
  2738.        LONG  lItemIndex;            /* Item index */
  2739.        ULONG ulItemCount;           /* Item count */
  2740.        ULONG reserved;              /* Reserved - must be zero */
  2741.        ULONG reserved2;             /* Reserved - must be zero */
  2742.    } LBOXINFO;
  2743.  
  2744.    typedef LBOXINFO * PLBOXINFO;
  2745.  
  2746.    /* Useful macros */
  2747.  
  2748.    /***************************************************************************
  2749.    * LONG/SHORT WinDeleteLboxItem(HWND hwndLbox, LONG/SHORT index)
  2750.    *    deletes item index from the listbox.
  2751.    *    returns the number of items left.
  2752.    ***************************************************************************/
  2753.    #ifdef INCL_32
  2754.       #define WinDeleteLboxItem(hwndLbox, index) \
  2755.       ((LONG)WinSendMsg(hwndLbox, LM_DELETEITEM, MPFROMLONG(index), \
  2756.       (MPARAM)NULL))
  2757.    #else
  2758.       #define WinDeleteLboxItem(hwndLbox, index) \
  2759.       ((SHORT)WinSendMsg(hwndLbox, LM_DELETEITEM, MPFROMSHORT(index), \
  2760.       (MPARAM)NULL))
  2761.    #endif
  2762.  
  2763.    /***************************************************************************
  2764.    * LONG/SHORT WinInsertLboxItem(HWND hwndLbox, LONG/SHORT index, PSZ psz)
  2765.    *    inserts psz into a listbox at index.  Index may be an LIT_ constant.
  2766.    *    returns the actual index where it was inserted.
  2767.    ***************************************************************************/
  2768.    #ifdef INCL_32
  2769.       #define WinInsertLboxItem(hwndLbox, index, psz) \
  2770.       ((LONG)WinSendMsg(hwndLbox, LM_INSERTITEM, MPFROMLONG(index), \
  2771.       MPFROMP(psz)))
  2772.    #else
  2773.       #define WinInsertLboxItem(hwndLbox, index, psz) \
  2774.       ((SHORT)WinSendMsg(hwndLbox, LM_INSERTITEM, MPFROMSHORT(index), \
  2775.       MPFROMP(psz)))
  2776.    #endif
  2777.  
  2778.    /***************************************************************************
  2779.    * LONG/SHORT WinQueryLboxCount(HWND hwndLbox)
  2780.    *    returns the number of items in the listbox.
  2781.    *
  2782.    ***************************************************************************/
  2783.    #ifdef INCL_32
  2784.       #define WinQueryLboxCount(hwndLbox) \
  2785.       ((LONG)WinSendMsg(hwndLbox, LM_QUERYITEMCOUNT, (MPARAM)NULL, \
  2786.       (MPARAM)NULL))
  2787.    #else
  2788.       #define WinQueryLboxCount(hwndLbox) \
  2789.       ((SHORT)WinSendMsg(hwndLbox, LM_QUERYITEMCOUNT, (MPARAM)NULL, \
  2790.       (MPARAM)NULL))
  2791.    #endif
  2792.  
  2793.    /***************************************************************************
  2794.    * LONG/SHORT WinQueryLboxItemText(HWND hwndLbox, LONG/SHORT index, PSZ psz, SHORT cchMax)
  2795.    *    fills psz with the text if item index.
  2796.    *    returns the text length copied.
  2797.    ***************************************************************************/
  2798.    #ifdef INCL_32
  2799.       #define WinQueryLboxItemText(hwndLbox, index, psz, cchMax) \
  2800.       ((LONG)WinSendMsg(hwndLbox, LM_QUERYITEMTEXT, \
  2801.       MPFROM2SHORT((index), (cchMax)), MPFROMP(psz)))
  2802.    #else
  2803.       #define WinQueryLboxItemText(hwndLbox, index, psz, cchMax) \
  2804.       ((SHORT)WinSendMsg(hwndLbox, LM_QUERYITEMTEXT, \
  2805.       MPFROM2SHORT((index), (cchMax)), MPFROMP(psz)))
  2806.    #endif
  2807.  
  2808.    /***************************************************************************
  2809.    * LONG/SHORT WinQueryLboxItemTextLength(HWND hwndLbox, LONG/SHORT index)
  2810.    *    returns the length of item index.
  2811.    *
  2812.    ***************************************************************************/
  2813.    #ifdef INCL_32
  2814.       #define WinQueryLboxItemTextLength(hwndLbox, index)         \
  2815.       ((SHORT)WinSendMsg(hwndLbox, LM_QUERYITEMTEXTLENGTH,    \
  2816.       MPFROMSHORT(index), (MPARAM)NULL))
  2817.    #else
  2818.       #define WinQueryLboxItemTextLength(hwndLbox, index)         \
  2819.       ((SHORT)WinSendMsg(hwndLbox, LM_QUERYITEMTEXTLENGTH,    \
  2820.       MPFROMSHORT(index), (MPARAM)NULL))
  2821.    #endif
  2822.  
  2823.    /***************************************************************************
  2824.    * BOOL WinSetLboxItemText(HWND hwndLbox, LONG/SHORT index, PSZ psz)
  2825.    *    sets the text of item index to psz.
  2826.    *    returns fSuccess.
  2827.    ***************************************************************************/
  2828.    #ifdef INCL_32
  2829.       #define WinSetLboxItemText(hwndLbox, index, psz) \
  2830.       ((BOOL)WinSendMsg(hwndLbox, LM_SETITEMTEXT, \
  2831.       MPFROMLONG(index), MPFROMP(psz)))
  2832.    #else
  2833.       #define WinSetLboxItemText(hwndLbox, index, psz) \
  2834.       ((BOOL)WinSendMsg(hwndLbox, LM_SETITEMTEXT, \
  2835.       MPFROMSHORT(index), MPFROMP(psz)))
  2836.    #endif
  2837.  
  2838.    /***************************************************************************
  2839.    * LONG/SHORT WinQueryLboxSelectedItem(HWND hwndLbox)
  2840.    *    returns the item index selected. (for single selection only)
  2841.    *
  2842.    ***************************************************************************/
  2843.    #ifdef INCL_32
  2844.       #define WinQueryLboxSelectedItem(hwndLbox) \
  2845.       ((LONG)WinSendMsg(hwndLbox, LM_QUERYSELECTION, MPFROMLONG(LIT_FIRST), \
  2846.       (MPARAM)NULL))
  2847.    #else
  2848.       #define WinQueryLboxSelectedItem(hwndLbox) \
  2849.       ((SHORT)WinSendMsg(hwndLbox, LM_QUERYSELECTION, MPFROMSHORT(LIT_FIRST), \
  2850.       (MPARAM)NULL))
  2851.    #endif
  2852.  
  2853. #endif /* INCL_WINLISTBOXES */
  2854.  
  2855.  
  2856. #ifdef INCL_WINMENUS
  2857.  
  2858.    /**** Menu Manager Subsection */
  2859.  
  2860.    /* Menu control styles */
  2861.  
  2862.    #define MS_ACTIONBAR               0x00000001L
  2863.    #define MS_TITLEBUTTON             0x00000002L
  2864.    #define MS_VERTICALFLIP            0x00000004L
  2865.  
  2866.    #define MS_CONDITIONALCASCADE      0x00000040L
  2867.  
  2868.    #ifdef INCL_32
  2869.       HWND APIENTRY WinLoadMenu(HWND hwndFrame,
  2870.                                 HMODULE hmod,
  2871.                                 ULONG idMenu);
  2872.    #else
  2873.       HWND APIENTRY WinLoadMenu(HWND hwndFrame,
  2874.                                 HMODULE hmod,
  2875.                                 USHORT idMenu);
  2876.    #endif
  2877.  
  2878.  
  2879.    /* Menu control messages */
  2880.  
  2881.    #define MM_INSERTITEM              0x0180
  2882.    #define MM_DELETEITEM              0x0181
  2883.    #define MM_QUERYITEM               0x0182
  2884.    #define MM_SETITEM                 0x0183
  2885.    #define MM_QUERYITEMCOUNT          0x0184
  2886.    #define MM_STARTMENUMODE           0x0185
  2887.    #define MM_ENDMENUMODE             0x0186
  2888.    #define MM_REMOVEITEM              0x0188
  2889.    #define MM_SELECTITEM              0x0189
  2890.    #define MM_QUERYSELITEMID          0x018a
  2891.    #define MM_QUERYITEMTEXT           0x018b
  2892.    #define MM_QUERYITEMTEXTLENGTH     0x018c
  2893.    #define MM_SETITEMHANDLE           0x018d
  2894.    #define MM_SETITEMTEXT             0x018e
  2895.    #define MM_ITEMPOSITIONFROMID      0x018f
  2896.    #define MM_ITEMIDFROMPOSITION      0x0190
  2897.    #define MM_QUERYITEMATTR           0x0191
  2898.    #define MM_SETITEMATTR             0x0192
  2899.    #define MM_ISITEMVALID             0x0193
  2900.    #define MM_QUERYITEMRECT           0x0194
  2901.  
  2902.    #define MM_QUERYDEFAULTITEMID      0x0431
  2903.    #define MM_SETDEFAULTITEMID        0x0432
  2904.  
  2905.    #ifndef MTI_INCLUDED
  2906.       #define MTI_INCLUDED
  2907.  
  2908.       typedef struct _mti {   /* mti */
  2909.          USHORT afStyle;      /* Style Flags      */
  2910.          USHORT pad;          /* pad for template */
  2911.          USHORT idItem;       /* Item ID          */
  2912.          CHAR   c[2];         /*                  */
  2913.       } MTI;
  2914.  
  2915.       typedef struct _mt {    /* mt */
  2916.          ULONG  len;          /* Length of template in bytes */
  2917.          USHORT codepage;     /* Codepage                    */
  2918.          USHORT reserved;     /* Reserved.                   */
  2919.          USHORT cMti;         /* Count of template items.    */
  2920.          MTI    rgMti[1];     /* Array of template items.    */
  2921.       } MT;
  2922.       typedef MT FAR * LPMT;
  2923.  
  2924.    #endif
  2925.  
  2926.    HWND APIENTRY WinCreateMenu(HWND hwndParent,
  2927.                                PVOID lpmt);
  2928.  
  2929.    /* Owner Item Structure (Also used for listboxes) */
  2930.  
  2931.    #ifndef INCL_SAADEFS
  2932.       #ifdef INCL_32
  2933.          typedef struct _OWNERITEM {  /* oi */
  2934.             HWND    hwnd;
  2935.             HPS     hps;
  2936.             ULONG   fsState;
  2937.             ULONG   fsAttribute;
  2938.             ULONG   fsStateOld;
  2939.             ULONG   fsAttributeOld;
  2940.             RECTL   rclItem;
  2941.             LONG    idItem; /* This field contains idItem for menus, iItem for lb. */
  2942.             ULONG   hItem;
  2943.          } OWNERITEM;
  2944.       #else
  2945.          typedef struct _OWNERITEM {  /* oi */
  2946.             HWND    hwnd;
  2947.             HPS     hps;
  2948.             USHORT  fsState;
  2949.             USHORT  fsAttribute;
  2950.             USHORT  fsStateOld;
  2951.             USHORT  fsAttributeOld;
  2952.             RECTL   rclItem;
  2953.             SHORT   idItem; /* This field contains idItem for menus, iItem for lb. */
  2954.             ULONG   hItem;
  2955.          } OWNERITEM;
  2956.       #endif
  2957.       typedef OWNERITEM FAR *POWNERITEM;
  2958.    #endif /* !INCL_SAADEFS */
  2959.  
  2960.    /* Menu item */
  2961.  
  2962.    #pragma pack(2) /* force structure alignment packing */
  2963.  
  2964.    /* Binary resources may be bound into application executables or */
  2965.    /* passed as a parameter when creating a window or dialog        */
  2966.    /* Currently they must be the same for both 16-bit and 32-bit    */
  2967.    /* so we pack the structures.                                    */
  2968.    typedef struct _MENUITEM {  /* mi */
  2969.       SHORT   iPosition;
  2970.       USHORT  afStyle;
  2971.       USHORT  afAttribute;
  2972.       USHORT  id;
  2973.       HWND    hwndSubMenu;
  2974.       ULONG   hItem;
  2975.    } MENUITEM;
  2976.    typedef MENUITEM FAR *PMENUITEM;
  2977.  
  2978.    #pragma pack()  /* restore packing to default */
  2979.  
  2980.    #define MIT_END                    (-1)
  2981.    #define MIT_NONE                   (-1)
  2982.    #define MIT_MEMERROR               (-1)
  2983.    #define MIT_ERROR                  (-1)
  2984.    #define MIT_FIRST                  (-2)
  2985.    #define MIT_LAST                   (-3)
  2986.    #define MID_NONE                   MIT_NONE
  2987.    #define MID_ERROR                  (-1)
  2988.  
  2989.    /* Menu item styles & attributes */
  2990.  
  2991.    #define MIS_TEXT                   0x0001
  2992.  
  2993.    #ifndef INCL_SAADEFS
  2994.       #define MIS_BITMAP                 0x0002
  2995.    #endif /* !INCL_SAADEFS */
  2996.    #define MIS_SEPARATOR              0x0004
  2997.  
  2998.    #ifndef INCL_SAADEFS
  2999.       #define MIS_OWNERDRAW              0x0008
  3000.    #endif /* !INCL_SAADEFS */
  3001.  
  3002.    #define MIS_SUBMENU                0x0010
  3003.    #define MIS_MULTMENU               0x0020      /* multiple choice submenu     */
  3004.    #define MIS_SYSCOMMAND             0x0040
  3005.    #define MIS_HELP                   0x0080
  3006.    #define MIS_STATIC                 0x0100
  3007.    #define MIS_BUTTONSEPARATOR        0x0200
  3008.    #define MIS_BREAK                  0x0400
  3009.    #define MIS_BREAKSEPARATOR         0x0800
  3010.    #define MIS_GROUP                  0x1000      /* multiple choice group start */
  3011.    /* In multiple choice submenus a style of 'single' denotes the item is a
  3012.    ** radiobutton.  Absence of this style defaults the item to a checkbox.       */
  3013.    #define MIS_SINGLE                 0x2000
  3014.  
  3015.    #define MIA_NODISMISS              0x0020
  3016.    #define MIA_FRAMED                 0x1000
  3017.    #define MIA_CHECKED                0x2000
  3018.    #define MIA_DISABLED               0x4000
  3019.    #define MIA_HILITED                0x8000
  3020.  
  3021.  
  3022.    #ifdef INCL_32
  3023.       BOOL APIENTRY WinPopupMenu(HWND hwndParent,
  3024.                                  HWND hwndOwner,
  3025.                                  HWND hwndMenu,
  3026.                                  LONG x,
  3027.                                  LONG y,
  3028.                                  LONG idItem,
  3029.                                  ULONG fs);
  3030.    #else
  3031.       BOOL APIENTRY WinPopupMenu(HWND hwndParent,
  3032.                                  HWND hwndOwner,
  3033.                                  HWND hwndMenu,
  3034.                                  SHORT x,
  3035.                                  SHORT y,
  3036.                                  SHORT idItem,
  3037.                                  USHORT fs);
  3038.    #endif
  3039.  
  3040.    /* Values of fs in WinPopupMenu call */
  3041.  
  3042.    #define PU_POSITIONONITEM          0x0001 /* Need idItem parameter */
  3043.  
  3044.    #define PU_HCONSTRAIN              0x0002 /* Keep menu on left and right edge */
  3045.    #define PU_VCONSTRAIN              0x0004 /* Keep menu on top and bottom edge */
  3046.  
  3047.    #define PU_NONE                    0x0000 /* If invoked by keyboard */
  3048.    #define PU_MOUSEBUTTON1DOWN        0x0008 /* If invoked by button 1 */
  3049.    #define PU_MOUSEBUTTON2DOWN        0x0010 /* If invoked by button 2 */
  3050.    #define PU_MOUSEBUTTON3DOWN        0x0018 /* If invoked by button 3 */
  3051.  
  3052.    #define PU_SELECTITEM              0x0020 /* Set selected item (use with kbd) */
  3053.  
  3054.    #define PU_MOUSEBUTTON1            0x0040 /* If button1 use allowed */
  3055.    #define PU_MOUSEBUTTON2            0x0080 /* If button2 use allowed */
  3056.    #define PU_MOUSEBUTTON3            0x0100 /* If button3 use allowed */
  3057.    #define PU_KEYBOARD                0x0200 /* If keyboard use allowed */
  3058.  
  3059.  
  3060.    /* Useful macros */
  3061.  
  3062.    /***************************************************************************
  3063.    * BOOL WinCheckMenuItem(HWND hwndMenu, ULONG/USHORT id, BOOL fcheck)
  3064.    *    Sets the check state of menuitem #id to fcheck.
  3065.    *    returns fSuccess.
  3066.    ***************************************************************************/
  3067.    #define WinCheckMenuItem(hwndMenu, id, fcheck) \
  3068.    ((BOOL)WinSendMsg(hwndMenu, MM_SETITEMATTR, \
  3069.    MPFROM2SHORT(id, TRUE), \
  3070.    MPFROM2SHORT(MIA_CHECKED, (USHORT)(fcheck) ? MIA_CHECKED : 0)))
  3071.  
  3072.    /***************************************************************************
  3073.    * BOOL WinIsMenuItemChecked(HWND hwndMenu, USHORT/ULONG id)
  3074.    *    returns the check state of menuitem #id.
  3075.    *
  3076.    ***************************************************************************/
  3077.    #ifdef INCL_32
  3078.       #define WinIsMenuItemChecked(hwndMenu, id) \
  3079.       ((BOOL)WinSendMsg(hwndMenu, MM_QUERYITEMATTR, \
  3080.       MPFROM2SHORT(id, TRUE), \
  3081.       MPFROMLONG(MIA_CHECKED)))
  3082.    #else
  3083.       #define WinIsMenuItemChecked(hwndMenu, id) \
  3084.       ((BOOL)WinSendMsg(hwndMenu, MM_QUERYITEMATTR, \
  3085.       MPFROM2SHORT(id, TRUE), \
  3086.       MPFROMSHORT(MIA_CHECKED)))
  3087.    #endif
  3088.  
  3089.    /***************************************************************************
  3090.    * BOOL WinEnableMenuItem(HWND hwndMenu, ULONG/USHORT id, BOOL fenable)
  3091.    *    sets the enable state of menuitem #id to fenable.
  3092.    *    returns fSuccess.
  3093.    ***************************************************************************/
  3094.    #define WinEnableMenuItem(hwndMenu, id, fEnable) \
  3095.    ((BOOL)WinSendMsg(hwndMenu, MM_SETITEMATTR, \
  3096.    MPFROM2SHORT(id, TRUE), \
  3097.    MPFROM2SHORT(MIA_DISABLED, (USHORT)(fEnable) ? 0 : MIA_DISABLED)))
  3098.  
  3099.    /***************************************************************************
  3100.    * BOOL WinIsMenuItemEnabled(HWND hwndMenu, USHORT/ULONG id)
  3101.    *    returns the enable state of menuitem #id.
  3102.    *
  3103.    ***************************************************************************/
  3104.    #ifdef INCL_32
  3105.       #define WinIsMenuItemEnabled(hwndMenu, id)  \
  3106.       (!(BOOL)WinSendMsg(hwndMenu, MM_QUERYITEMATTR, \
  3107.       MPFROM2SHORT(id, TRUE), \
  3108.       MPFROMLONG(MIA_DISABLED)))
  3109.    #else
  3110.       #define WinIsMenuItemEnabled(hwndMenu, id)  \
  3111.       (!(BOOL)WinSendMsg(hwndMenu, MM_QUERYITEMATTR, \
  3112.       MPFROM2SHORT(id, TRUE), \
  3113.       MPFROMSHORT(MIA_DISABLED)))
  3114.    #endif
  3115.  
  3116.    /***************************************************************************
  3117.    * BOOL WinSetMenuItemText(HWND hwndMenu, ULONG/USHORT id, PSZ psz)
  3118.    *    sets the text of menuitem #id.
  3119.    *    returns fSuccess.
  3120.    ***************************************************************************/
  3121.    #ifdef INCL_32
  3122.       #define WinSetMenuItemText(hwndMenu, id, psz) \
  3123.       ((BOOL)WinSendMsg(hwndMenu, MM_SETITEMTEXT, \
  3124.       MPFROMLONG(id), MPFROMP(psz)))
  3125.    #else
  3126.       #define WinSetMenuItemText(hwndMenu, id, psz) \
  3127.       ((BOOL)WinSendMsg(hwndMenu, MM_SETITEMTEXT, \
  3128.       MPFROMSHORT(id), MPFROMP(psz)))
  3129.    #endif
  3130.  
  3131.    /***************************************************************************
  3132.    * BOOL WinIsMenuItemValid(HWND hwndMenu, ULONG/USHORT id)
  3133.    *    Returns TRUE if the specified item is a valid choice.
  3134.    ***************************************************************************/
  3135.    #ifdef INCL_32
  3136.       #define WinIsMenuItemValid(hwndMenu, id) \
  3137.       ((BOOL)WinSendMsg(hwndMenu, MM_ISITEMVALID, \
  3138.       MPFROM2SHORT(id, TRUE), MPFROMLONG(FALSE)))
  3139.    #else
  3140.       #define WinIsMenuItemValid(hwndMenu, id) \
  3141.       ((BOOL)WinSendMsg(hwndMenu, MM_ISITEMVALID, \
  3142.       MPFROM2SHORT(id, TRUE), MPFROMSHORT(FALSE)))
  3143.    #endif
  3144.  
  3145. #endif /* INCL_WINMENUS */
  3146.  
  3147.  
  3148. #ifdef INCL_WINSCROLLBARS
  3149.  
  3150.    /*** Scroll Bar controls Subsection */
  3151.  
  3152.    /* Scroll Bar styles */
  3153.  
  3154.    #define SBS_HORZ                   0L
  3155.    #define SBS_VERT                   1L
  3156.    #define SBS_THUMBSIZE              2L
  3157.    #define SBS_AUTOTRACK              4L
  3158.    #define SBS_AUTOSIZE        0x2000L
  3159.  
  3160.  
  3161.  
  3162.    /* Scroll Bar messages */
  3163.  
  3164.    #define SBM_SETSCROLLBAR           0x01a0
  3165.    #define SBM_SETPOS                 0x01a1
  3166.    #define SBM_QUERYPOS               0x01a2
  3167.    #define SBM_QUERYRANGE             0x01a3
  3168.    #define SBM_SETTHUMBSIZE           0x01a6
  3169.  
  3170.    /* Scroll Bar Commands */
  3171.  
  3172.    #define SB_LINEUP                  1
  3173.    #define SB_LINEDOWN                2
  3174.    #define SB_LINELEFT                1
  3175.    #define SB_LINERIGHT               2
  3176.    #define SB_PAGEUP                  3
  3177.    #define SB_PAGEDOWN                4
  3178.    #define SB_PAGELEFT                3
  3179.    #define SB_PAGERIGHT               4
  3180.    #define SB_SLIDERTRACK             5
  3181.    #define SB_SLIDERPOSITION          6
  3182.    #define SB_ENDSCROLL               7
  3183.  
  3184.  
  3185.    #ifndef INCL_SAADEFS
  3186.       #pragma pack(2) /* force structure alignment packing */
  3187.  
  3188.       /* Binary resources may be bound into application executables or */
  3189.       /* passed as a parameter when creating a window or dialog        */
  3190.       /* Currently they must be the same for both 16-bit and 32-bit    */
  3191.       /* so we pack the structures.                                    */
  3192.       typedef struct _SBCDATA {  /* sbcd */
  3193.          USHORT  cb;
  3194.          USHORT  sHilite;      /* reserved, should be set to zero */
  3195.          SHORT   posFirst;
  3196.          SHORT   posLast;
  3197.          SHORT   posThumb;
  3198.          SHORT   cVisible;
  3199.          SHORT   cTotal;
  3200.       } SBCDATA;
  3201.       typedef SBCDATA FAR *PSBCDATA;
  3202.  
  3203.       #pragma pack()  /* restore packing to default */
  3204.    #endif /* !INCL_SAADEFS */
  3205.  
  3206. #endif /* INCL_WINSCROLLBARS */
  3207.  
  3208.  
  3209. #if (defined(INCL_WINFRAMEMGR) || !defined(INCL_NOCOMMON))
  3210.    /*** Frame Manager Common subsection */
  3211.  
  3212.    #pragma pack(2) /* force structure alignment packing */
  3213.  
  3214.    /* Binary resources may be bound into application executables or */
  3215.    /* passed as a parameter when creating a window or dialog        */
  3216.    /* Currently they must be the same for both 16-bit and 32-bit    */
  3217.    /* so we pack the structures.                                    */
  3218.    typedef struct _FRAMECDATA {  /* fcdata */
  3219.       USHORT  cb;
  3220.       ULONG   flCreateFlags;
  3221.       USHORT  hmodResources;
  3222.       USHORT  idResources;
  3223.    } FRAMECDATA;
  3224.    typedef FRAMECDATA FAR *PFRAMECDATA;
  3225.  
  3226.    #pragma pack()  /* restore packing to default */
  3227.  
  3228.    /* Frame window styles */
  3229.    /* All unused FCF_xxx bits are reserved */
  3230.    #define FCF_TITLEBAR               0x00000001L
  3231.    #define FCF_SYSMENU                0x00000002L
  3232.    #define FCF_MENU                   0x00000004L
  3233.    #define FCF_SIZEBORDER             0x00000008L
  3234.    #define FCF_MINBUTTON              0x00000010L
  3235.    #define FCF_MAXBUTTON              0x00000020L
  3236.    #define FCF_MINMAX                 0x00000030L /* minmax means BOTH buttons */
  3237.    #define FCF_VERTSCROLL             0x00000040L
  3238.    #define FCF_HORZSCROLL             0x00000080L
  3239.    #define FCF_DLGBORDER              0x00000100L
  3240.    #define FCF_BORDER                 0x00000200L
  3241.    #define FCF_SHELLPOSITION          0x00000400L
  3242.    #define FCF_TASKLIST               0x00000800L
  3243.    #define FCF_NOBYTEALIGN            0x00001000L
  3244.    #define FCF_NOMOVEWITHOWNER        0x00002000L
  3245.    #define FCF_ICON                   0x00004000L
  3246.    #define FCF_ACCELTABLE             0x00008000L
  3247.    #define FCF_SYSMODAL               0x00010000L
  3248.    #define FCF_SCREENALIGN            0x00020000L
  3249.    #define FCF_MOUSEALIGN             0x00040000L
  3250.    #define FCF_HIDEBUTTON             0x01000000L
  3251.    #define FCF_HIDEMAX                0x01000020L /* hidemax means BOTH buttons */
  3252.    #ifdef INCL_16
  3253.       /* New values to enable multiple palettes.  Note that if none of the four   */
  3254.       /* styles specified below are used then we default to the 'system' palette  */
  3255.       #define FCF_PALETTE_NORMAL      0x00080000L /* normal palette            */
  3256.       #define FCF_PALETTE_HELP        0x00100000L /* help palette              */
  3257.       #define FCF_PALETTE_POPUPODD    0x00200000L /* odd level popup palette   */
  3258.       #define FCF_PALETTE_POPUPEVEN   0x00400000L /* even level popup palette  */
  3259.    #endif
  3260.    #ifdef INCL_NLS
  3261.       #define FCF_DBE_APPSTAT         0x80000000L
  3262.    #endif /* INCL_NLS */
  3263.    #define FCF_AUTOICON               0x40000000L
  3264.  
  3265.    #ifdef INCL_32
  3266.       /* FCF_TITLEBAR | FCF_SYSMENU | FCF_MENU | FCF_SIZEBORDER | FCF_MINMAX |
  3267.       FCF_ICON | FCF_ACCELTABLE | FCF_SHELLPOSITION | FCF_TASKLIST */
  3268.       #define FCF_STANDARD            0x0000CC3FL
  3269.    #else
  3270.       /* FCF_TITLEBAR | FCF_SYSMENU | FCF_MENU | FCF_SIZEBORDER | FCF_MINMAX |
  3271.       FCF_ICON | FCF_ACCELTABLE | FCF_SHELLPOSITION | FCF_TASKLIST | FCF_PALETTE_NORMAL */
  3272.       #define FCF_STANDARD            0x0008CC3FL
  3273.    #endif
  3274.  
  3275.  
  3276.    #define FS_ICON                    0x00000001L
  3277.    #define FS_ACCELTABLE              0x00000002L
  3278.  
  3279.    #ifndef INCL_SAADEFS
  3280.       #define FS_SHELLPOSITION        0x00000004L
  3281.    #endif /* !INCL_SAADEFS */
  3282.  
  3283.    #define FS_TASKLIST                0x00000008L
  3284.    #define FS_NOBYTEALIGN             0x00000010L
  3285.    #define FS_NOMOVEWITHOWNER         0x00000020L
  3286.    #define FS_SYSMODAL                0x00000040L
  3287.    #define FS_DLGBORDER               0x00000080L
  3288.    #define FS_BORDER                  0x00000100L
  3289.    #define FS_SCREENALIGN             0x00000200L
  3290.    #define FS_MOUSEALIGN              0x00000400L
  3291.    #define FS_SIZEBORDER              0x00000800L
  3292.    #define FS_AUTOICON                0x00001000L
  3293.    #ifdef INCL_NLS
  3294.       #define FS_DBE_APPSTAT          0x00008000L
  3295.    #endif /* INCL_NLS */
  3296.  
  3297.    /* FS_ICON | FS_ACCELTABLE | FS_SHELLPOSITION | FS_TASKLIST */
  3298.    #define FS_STANDARD                0x0000000FL
  3299.  
  3300.  
  3301.    /* Frame Window Flags accessed via WinSet/QueryWindowUShort(QWS_FLAGS) */
  3302.  
  3303.    #ifndef INCL_SAADEFS
  3304.       #define FF_FLASHWINDOW             0x0001
  3305.       #define FF_ACTIVE                  0x0002
  3306.       #define FF_FLASHHILITE             0x0004
  3307.       #define FF_OWNERHIDDEN             0x0008
  3308.       #define FF_DLGDISMISSED            0x0010
  3309.       #define FF_OWNERDISABLED           0x0020
  3310.       #define FF_SELECTED                0x0040
  3311.       #define FF_NOACTIVATESWP           0x0080
  3312.       #define FF_DIALOGBOX               0x0100
  3313.  
  3314.    #endif /* !INCL_SAADEFS */
  3315.  
  3316.  
  3317.    #ifdef INCL_32
  3318.       HWND  APIENTRY WinCreateStdWindow(HWND hwndParent,
  3319.                                         ULONG flStyle,
  3320.                                         PULONG pflCreateFlags,
  3321.                                         PSZ pszClientClass,
  3322.                                         PSZ pszTitle,
  3323.                                         ULONG styleClient,
  3324.                                         HMODULE hmod,
  3325.                                         ULONG idResources,
  3326.                                         PHWND phwndClient);
  3327.    #else
  3328.       HWND  APIENTRY WinCreateStdWindow(HWND hwndParent,
  3329.                                         ULONG flStyle,
  3330.                                         PULONG pflCreateFlags,
  3331.                                         PSZ pszClientClass,
  3332.                                         PSZ pszTitle,
  3333.                                         ULONG styleClient,
  3334.                                         HMODULE hmod,
  3335.                                         USHORT idResources,
  3336.                                         PHWND phwndClient);
  3337.    #endif
  3338.  
  3339.  
  3340. #endif /* Frame Manager Common subsection */
  3341.  
  3342.  
  3343. #ifdef INCL_WINFRAMEMGR
  3344.  
  3345.    BOOL  APIENTRY WinFlashWindow(HWND hwndFrame,
  3346.                                  BOOL fFlash);
  3347.  
  3348.    /* Frame window related messages */
  3349.  
  3350.    #define WM_FLASHWINDOW             0x0040
  3351.    #define WM_FORMATFRAME             0x0041
  3352.    #define WM_UPDATEFRAME             0x0042
  3353.    #define WM_FOCUSCHANGE             0x0043
  3354.  
  3355.    #define WM_SETBORDERSIZE           0x0044
  3356.    #define WM_TRACKFRAME              0x0045
  3357.    #define WM_MINMAXFRAME             0x0046
  3358.    #define WM_SETICON                 0x0047
  3359.    #define WM_QUERYICON               0x0048
  3360.    #define WM_SETACCELTABLE           0x0049
  3361.    #define WM_QUERYACCELTABLE         0x004a
  3362.    #define WM_TRANSLATEACCEL          0x004b
  3363.    #define WM_QUERYTRACKINFO          0x004c
  3364.    #define WM_QUERYBORDERSIZE         0x004d
  3365.    #define WM_NEXTMENU                0x004e
  3366.    #define WM_ERASEBACKGROUND         0x004f
  3367.    #define WM_QUERYFRAMEINFO          0x0050
  3368.    #define WM_QUERYFOCUSCHAIN         0x0051
  3369.    #define WM_OWNERPOSCHANGE          0x0052
  3370.    #define WM_CALCFRAMERECT           0x0053
  3371.    /* Note 0x0054 is reserved */
  3372.    #define WM_WINDOWPOSCHANGED        0x0055
  3373.    #define WM_ADJUSTFRAMEPOS          0x0056
  3374.    #define WM_QUERYFRAMECTLCOUNT      0x0059
  3375.    #ifndef INCL_SAADEFS
  3376.       /* Note 0x005A is reserved */
  3377.       #define WM_QUERYHELPINFO        0x005B
  3378.       #define WM_SETHELPINFO          0x005C
  3379.       #define WM_ERROR                0x005D
  3380.       #define WM_REALIZEPALETTE       0x005E
  3381.  
  3382.  
  3383.       /* WM_QUERYFRAMEINFO constants */
  3384.  
  3385.       #define FI_FRAME                0x00000001L
  3386.       #define FI_OWNERHIDE            0x00000002L
  3387.       #define FI_ACTIVATEOK           0x00000004L
  3388.       #define FI_NOMOVEWITHOWNER      0x00000008L
  3389.  
  3390.  
  3391.    #endif /* !INCL_SAADEFS */
  3392.  
  3393.  
  3394.    BOOL  APIENTRY WinCreateFrameControls(HWND hwndFrame,
  3395.                                          PFRAMECDATA pfcdata,
  3396.                                          PSZ pszTitle);
  3397.  
  3398.    BOOL  APIENTRY WinCalcFrameRect(HWND hwndFrame,
  3399.                                    PRECTL prcl,
  3400.                                    BOOL fClient);
  3401.  
  3402.    BOOL  APIENTRY WinGetMinPosition(HWND hwnd,
  3403.                                     PSWP pswp,
  3404.                                     PPOINTL pptl);
  3405.    #ifndef INCL_SAADEFS
  3406.       BOOL  APIENTRY WinGetMaxPosition(HWND hwnd,
  3407.                                        PSWP pswp);
  3408.    #endif /* !INCL_SAADEFS */
  3409.  
  3410.    typedef LHANDLE HSAVEWP;      /* hsvwp */
  3411.  
  3412.    #ifdef INCL_32
  3413.       BOOL APIENTRY WinSaveWindowPos(HSAVEWP hsvwp,
  3414.                                      PSWP pswp,
  3415.                                      ULONG cswp);
  3416.    #else
  3417.       BOOL APIENTRY WinSaveWindowPos(HSAVEWP hsvwp,
  3418.                                      PSWP pswp,
  3419.                                      USHORT cswp);
  3420.    #endif
  3421.  
  3422.    /* Frame control IDs    */
  3423.  
  3424.    #define FID_SYSMENU                0x8002
  3425.    #define FID_TITLEBAR               0x8003
  3426.    #define FID_MINMAX                 0x8004
  3427.    #define FID_MENU                   0x8005
  3428.    #define FID_VERTSCROLL             0x8006
  3429.    #define FID_HORZSCROLL             0x8007
  3430.    #define FID_CLIENT                 0x8008
  3431.    /* Note 0x8009 is reserved */
  3432.  
  3433.    #define FID_DBE_APPSTAT            0x8010
  3434.    #define FID_DBE_KBDSTAT            0x8011
  3435.    #define FID_DBE_PECIC              0x8012
  3436.    #define FID_DBE_KKPOPUP            0x8013
  3437.  
  3438.    /* Standard WM_SYSCOMMAND command values */
  3439.  
  3440.    #define SC_SIZE                    0x8000
  3441.    #define SC_MOVE                    0x8001
  3442.    #define SC_MINIMIZE                0x8002
  3443.    #define SC_MAXIMIZE                0x8003
  3444.    #define SC_CLOSE                   0x8004
  3445.    #define SC_NEXT                    0x8005
  3446.    #define SC_APPMENU                 0x8006
  3447.    #define SC_SYSMENU                 0x8007
  3448.    #define SC_RESTORE                 0x8008
  3449.    #define SC_NEXTFRAME               0x8009
  3450.    #define SC_NEXTWINDOW              0x8010
  3451.    #ifndef INCL_SAADEFS
  3452.       #define SC_TASKMANAGER             0x8011
  3453.       #define SC_HELPKEYS                0x8012
  3454.       #define SC_HELPINDEX               0x8013
  3455.       #define SC_HELPEXTENDED            0x8014
  3456.       #define SC_SWITCHPANELIDS          0x8015
  3457.       #define SC_DBE_FIRST               0x8018
  3458.       #define SC_DBE_LAST                0x801F
  3459.  
  3460.       #define SC_BEGINDRAG               0x8020
  3461.       #define SC_ENDDRAG                 0x8021
  3462.       #define SC_SELECT                  0x8022
  3463.       #define SC_OPEN                    0x8023
  3464.       #define SC_CONTEXTMENU             0x8024
  3465.       #define SC_CONTEXTHELP             0x8025
  3466.       #define SC_TEXTEDIT                0x8026
  3467.       #define SC_BEGINSELECT             0x8027
  3468.       #define SC_ENDSELECT               0x8028
  3469.       #define SC_WINDOW                  0x8029
  3470.       #define SC_HIDE                    0x802a
  3471.  
  3472.  
  3473.    #endif /* !INCL_SAADEFS */
  3474.  
  3475. #endif /* INCL_WINFRAMEMGR */
  3476.  
  3477. /*** Frame controls */
  3478.  
  3479. #ifdef INCL_WINFRAMECTLS
  3480.  
  3481.    /** Title bar controls */
  3482.  
  3483.  
  3484.    /* Title bar control messages */
  3485.  
  3486.    #define TBM_SETHILITE              0x01e3
  3487.    #define TBM_QUERYHILITE            0x01e4
  3488.  
  3489.    #ifdef INCL_16
  3490.       #define TBM_TRACKMOVE              0x01e5
  3491.    #endif /* INCL_16 */
  3492.  
  3493. #endif /* INCL_WINFRAMECTLS */
  3494.  
  3495. #ifdef INCL_WINRECTANGLES
  3496.    /*** Rectangle routines */
  3497.  
  3498.    BOOL APIENTRY WinCopyRect(HAB hab,
  3499.                              PRECTL prclDst,
  3500.                              PRECTL prclSrc);
  3501.  
  3502.    #ifndef INCL_SAADEFS
  3503.       #ifdef INCL_32
  3504.          BOOL APIENTRY WinSetRect(HAB hab,
  3505.                                   PRECTL prcl,
  3506.                                   LONG xLeft,
  3507.                                   LONG yBottom,
  3508.                                   LONG xRight,
  3509.                                   LONG yTop);
  3510.       #else
  3511.          BOOL APIENTRY WinSetRect(HAB hab,
  3512.                                   PRECTL prcl,
  3513.                                   SHORT xLeft,
  3514.                                   SHORT yBottom,
  3515.                                   SHORT xRight,
  3516.                                   SHORT yTop);
  3517.       #endif
  3518.       BOOL APIENTRY WinIsRectEmpty(HAB hab,
  3519.                                    PRECTL prcl);
  3520.       BOOL APIENTRY WinEqualRect(HAB hab,
  3521.                                  PRECTL prcl1,
  3522.                                  PRECTL prcl2);
  3523.       BOOL APIENTRY WinSetRectEmpty(HAB hab,
  3524.                                     PRECTL prcl);
  3525.       #ifdef INCL_32
  3526.          BOOL APIENTRY WinOffsetRect(HAB hab,
  3527.                                      PRECTL prcl,
  3528.                                      LONG cx,
  3529.                                      LONG cy);
  3530.          BOOL APIENTRY WinInflateRect(HAB hab,
  3531.                                       PRECTL prcl,
  3532.                                       LONG cx,
  3533.                                       LONG cy);
  3534.       #else
  3535.          BOOL APIENTRY WinOffsetRect(HAB hab,
  3536.                                      PRECTL prcl,
  3537.                                      SHORT cx,
  3538.                                      SHORT cy);
  3539.          BOOL APIENTRY WinInflateRect(HAB hab,
  3540.                                       PRECTL prcl,
  3541.                                       SHORT cx,
  3542.                                       SHORT cy);
  3543.       #endif
  3544.       BOOL APIENTRY WinPtInRect(HAB hab,
  3545.                                 PRECTL prcl,
  3546.                                 PPOINTL pptl);
  3547.       BOOL APIENTRY WinIntersectRect(HAB hab,
  3548.                                      PRECTL prclDst,
  3549.                                      PRECTL prclSrc1,
  3550.                                      PRECTL prclSrc2);
  3551.       BOOL APIENTRY WinUnionRect(HAB hab,
  3552.                                  PRECTL prclDst,
  3553.                                  PRECTL prclSrc1,
  3554.                                  PRECTL prclSrc2);
  3555.       BOOL APIENTRY WinSubtractRect(HAB hab,
  3556.                                     PRECTL prclDst,
  3557.                                     PRECTL prclSrc1,
  3558.                                     PRECTL prclSrc2);
  3559.       #ifdef INCL_32
  3560.          BOOL APIENTRY WinMakeRect(HAB hab,
  3561.                                    PRECTL pwrc);
  3562.          BOOL APIENTRY WinMakePoints(HAB hab,
  3563.                                      PPOINTL pwpt,
  3564.                                      ULONG cwpt);
  3565.       #else
  3566.          BOOL APIENTRY WinMakeRect(HAB hab,
  3567.                                    PWRECT pwrc);
  3568.          BOOL APIENTRY WinMakePoints(HAB hab,
  3569.                                      PWPOINT pwpt,
  3570.                                      USHORT cwpt);
  3571.       #endif
  3572.    #endif /* !INCL_SAADEFS */
  3573.  
  3574. #endif /* INCL_WINRECTANGLES */
  3575.  
  3576.  
  3577. #ifdef INCL_WINSYS
  3578.  
  3579.    /*** System values */
  3580.  
  3581.    #ifdef INCL_32
  3582.       LONG APIENTRY WinQuerySysValue(HWND hwndDesktop,
  3583.                                      LONG iSysValue);
  3584.       BOOL  APIENTRY WinSetSysValue(HWND hwndDesktop,
  3585.                                     LONG iSysValue,
  3586.                                     LONG lValue);
  3587.    #else
  3588.       LONG APIENTRY WinQuerySysValue(HWND hwndDesktop,
  3589.                                      SHORT iSysValue);
  3590.       BOOL  APIENTRY WinSetSysValue(HWND hwndDesktop,
  3591.                                     SHORT iSysValue,
  3592.                                     LONG lValue);
  3593.    #endif
  3594.  
  3595.    #define SV_SWAPBUTTON              0
  3596.    #define SV_DBLCLKTIME              1
  3597.    #define SV_CXDBLCLK                2
  3598.    #define SV_CYDBLCLK                3
  3599.    #define SV_CXSIZEBORDER            4
  3600.    #define SV_CYSIZEBORDER            5
  3601.    #define SV_ALARM                   6
  3602.  
  3603.    #ifndef INCL_SAADEFS
  3604.       #define SV_RESERVEDFIRST1          7
  3605.       #define SV_RESERVEDLAST1           8
  3606.    #endif /* !INCL_SAADEFS */
  3607.  
  3608.    #define SV_CURSORRATE              9
  3609.    #define SV_FIRSTSCROLLRATE         10
  3610.    #define SV_SCROLLRATE              11
  3611.    #define SV_NUMBEREDLISTS           12
  3612.    #define SV_WARNINGFREQ             13
  3613.    #define SV_NOTEFREQ                14
  3614.    #define SV_ERRORFREQ               15
  3615.    #define SV_WARNINGDURATION         16
  3616.    #define SV_NOTEDURATION            17
  3617.    #define SV_ERRORDURATION           18
  3618.  
  3619.    #ifndef INCL_SAADEFS
  3620.       #define SV_RESERVEDFIRST           19
  3621.       #define SV_RESERVEDLAST            19
  3622.    #endif /* !INCL_SAADEFS */
  3623.  
  3624.    #define SV_CXSCREEN                20
  3625.    #define SV_CYSCREEN                21
  3626.    #define SV_CXVSCROLL               22
  3627.    #define SV_CYHSCROLL               23
  3628.    #define SV_CYVSCROLLARROW          24
  3629.    #define SV_CXHSCROLLARROW          25
  3630.    #define SV_CXBORDER                26
  3631.    #define SV_CYBORDER                27
  3632.    #define SV_CXDLGFRAME              28
  3633.    #define SV_CYDLGFRAME              29
  3634.    #define SV_CYTITLEBAR              30
  3635.    #define SV_CYVSLIDER               31
  3636.    #define SV_CXHSLIDER               32
  3637.    #define SV_CXMINMAXBUTTON          33
  3638.    #define SV_CYMINMAXBUTTON          34
  3639.    #define SV_CYMENU                  35
  3640.    #define SV_CXFULLSCREEN            36
  3641.    #define SV_CYFULLSCREEN            37
  3642.    #define SV_CXICON                  38
  3643.    #define SV_CYICON                  39
  3644.    #define SV_CXPOINTER               40
  3645.    #define SV_CYPOINTER               41
  3646.  
  3647.    #define SV_DEBUG                   42
  3648.    #define SV_CMOUSEBUTTONS           43
  3649.    #define SV_CPOINTERBUTTONS         43
  3650.    #define SV_POINTERLEVEL            44
  3651.    #define SV_CURSORLEVEL             45
  3652.    #define SV_TRACKRECTLEVEL          46
  3653.  
  3654.    #ifndef INCL_SAADEFS
  3655.       #define SV_CTIMERS                 47
  3656.    #endif /* !INCL_SAADEFS */
  3657.  
  3658.    #define SV_MOUSEPRESENT            48
  3659.  
  3660.    #define SV_CXBYTEALIGN             49
  3661.    #define SV_CXALIGN                 49
  3662.    #define SV_CYBYTEALIGN             50
  3663.    #define SV_CYALIGN                 50
  3664.  
  3665.    /* The following value enables any greater value to be set by WinSetSysVlaue. */
  3666.    /* Values of 51-55 are spare for extra non-settable system values             */
  3667.    /* This is to enable the setting of SV_EXTRAKEYBEEP by applications.          */
  3668.  
  3669.    #define SV_NOTRESERVED             56
  3670.    #define SV_EXTRAKEYBEEP            57
  3671.  
  3672.    /* The following system value controls whether PM controls the keyboard      */
  3673.    /* lights for light key keystrokes (else applications will)                  */
  3674.    #define SV_SETLIGHTS               58
  3675.    #define SV_INSERTMODE              59
  3676.  
  3677.  
  3678.    #define SV_MENUROLLDOWNDELAY       64
  3679.    #define SV_MENUROLLUPDELAY         65
  3680.    #define SV_ALTMNEMONIC             66
  3681.    #define SV_TASKLISTMOUSEACCESS     67
  3682.  
  3683.    #define SV_CXICONTEXTWIDTH         68
  3684.    #define SV_CICONTEXTLINES          69
  3685.  
  3686.    #define SV_CHORDTIME               70
  3687.    #define SV_CXCHORD                 71
  3688.    #define SV_CYCHORD                 72
  3689.    #define SV_CXMOTIONSTART           73
  3690.    #define SV_CYMOTIONSTART           74
  3691.  
  3692.    #define SV_BEGINDRAG               75
  3693.    #define SV_ENDDRAG                 76
  3694.    #define SV_SINGLESELECT            77
  3695.    #define SV_OPEN                    78
  3696.    #define SV_CONTEXTMENU             79
  3697.    #define SV_CONTEXTHELP             80
  3698.    #define SV_TEXTEDIT                81
  3699.    #define SV_BEGINSELECT             82
  3700.    #define SV_ENDSELECT               83
  3701.  
  3702.    #define SV_BEGINDRAGKB             84
  3703.    #define SV_ENDDRAGKB               85
  3704.    #define SV_SELECTKB                86
  3705.    #define SV_OPENKB                  87
  3706.    #define SV_CONTEXTMENUKB           88
  3707.    #define SV_CONTEXTHELPKB           89
  3708.    #define SV_TEXTEDITKB              90
  3709.    #define SV_BEGINSELECTKB           91
  3710.    #define SV_ENDSELECTKB             92
  3711.  
  3712.    #define SV_ANIMATION               93
  3713.    #define SV_ANIMATIONSPEED          94
  3714.  
  3715.    #define SV_MONOICONS               95
  3716.  
  3717.    #define SV_KBDALTERED              96
  3718.  
  3719.    #define SV_PRINTSCREEN             97
  3720.  
  3721.    #define SV_LOCKSTARTINPUT          98
  3722.  
  3723.    #define SV_CSYSVALUES              99
  3724.  
  3725.  
  3726.    /*
  3727.    * Presentation parameter structures.
  3728.    */
  3729.    typedef struct _PARAM {  /* param */
  3730.       ULONG   id;
  3731.       ULONG   cb;
  3732.       BYTE    ab[1];
  3733.    } PARAM;
  3734.    typedef PARAM NEAR *NPPARAM;
  3735.    typedef PARAM FAR  *PPARAM;
  3736.  
  3737.    typedef struct _PRESPARAMS {  /* pres */
  3738.       ULONG   cb;
  3739.       PARAM   aparam[1];
  3740.    } PRESPARAMS;
  3741.    typedef PRESPARAMS NEAR *NPPRESPARAMS;
  3742.    typedef PRESPARAMS FAR  *PPRESPARAMS;
  3743.  
  3744.    /*
  3745.    * Presentation parameter APIs
  3746.    */
  3747.    BOOL  APIENTRY WinSetPresParam(HWND hwnd,
  3748.                                   ULONG id,
  3749.                                   ULONG cbParam,
  3750.                                   PVOID pbParam);
  3751.    #ifdef INCL_32
  3752.       ULONG APIENTRY WinQueryPresParam(HWND hwnd,
  3753.                                        ULONG id1,
  3754.                                        ULONG id2,
  3755.                                        PULONG pulId,
  3756.                                        ULONG cbBuf,
  3757.                                        PVOID pbBuf,
  3758.                                        ULONG fs);
  3759.    #else
  3760.       ULONG APIENTRY WinQueryPresParam(HWND hwnd,
  3761.                                        ULONG id1,
  3762.                                        ULONG id2,
  3763.                                        PULONG pulId,
  3764.                                        ULONG cbBuf,
  3765.                                        PVOID pbBuf,
  3766.                                        USHORT fs);
  3767.    #endif
  3768.    BOOL  APIENTRY WinRemovePresParam(HWND hwnd,
  3769.                                      ULONG id);
  3770.  
  3771.    /*
  3772.    * Presentation parameter types.
  3773.    */
  3774.  
  3775.    #define PP_FOREGROUNDCOLOR                      1L
  3776.    #define PP_FOREGROUNDCOLORINDEX                 2L
  3777.    #define PP_BACKGROUNDCOLOR                      3L
  3778.    #define PP_BACKGROUNDCOLORINDEX                 4L
  3779.    #define PP_HILITEFOREGROUNDCOLOR                5L
  3780.    #define PP_HILITEFOREGROUNDCOLORINDEX           6L
  3781.    #define PP_HILITEBACKGROUNDCOLOR                7L
  3782.    #define PP_HILITEBACKGROUNDCOLORINDEX           8L
  3783.    #define PP_DISABLEDFOREGROUNDCOLOR              9L
  3784.    #define PP_DISABLEDFOREGROUNDCOLORINDEX         10L
  3785.    #define PP_DISABLEDBACKGROUNDCOLOR              11L
  3786.    #define PP_DISABLEDBACKGROUNDCOLORINDEX         12L
  3787.    #define PP_BORDERCOLOR                          13L
  3788.    #define PP_BORDERCOLORINDEX                     14L
  3789.    #define PP_FONTNAMESIZE                         15L
  3790.    #define PP_FONTHANDLE                           16L
  3791.    #define PP_RESERVED                             17L
  3792.    #define PP_ACTIVECOLOR                          18L
  3793.    #define PP_ACTIVECOLORINDEX                     19L
  3794.    #define PP_INACTIVECOLOR                        20L
  3795.    #define PP_INACTIVECOLORINDEX                   21L
  3796.    #define PP_ACTIVETEXTFGNDCOLOR                  22L
  3797.    #define PP_ACTIVETEXTFGNDCOLORINDEX             23L
  3798.    #define PP_ACTIVETEXTBGNDCOLOR                  24L
  3799.    #define PP_ACTIVETEXTBGNDCOLORINDEX             25L
  3800.    #define PP_INACTIVETEXTFGNDCOLOR                26L
  3801.    #define PP_INACTIVETEXTFGNDCOLORINDEX           27L
  3802.    #define PP_INACTIVETEXTBGNDCOLOR                28L
  3803.    #define PP_INACTIVETEXTBGNDCOLORINDEX           29L
  3804.    #define PP_SHADOW                               30L
  3805.    #define PP_MENUFOREGROUNDCOLOR                  31L
  3806.    #define PP_MENUFOREGROUNDCOLORINDEX             32L
  3807.    #define PP_MENUBACKGROUNDCOLOR                  33L
  3808.    #define PP_MENUBACKGROUNDCOLORINDEX             34L
  3809.    #define PP_MENUHILITEFGNDCOLOR                  35L
  3810.    #define PP_MENUHILITEFGNDCOLORINDEX             36L
  3811.    #define PP_MENUHILITEBGNDCOLOR                  37L
  3812.    #define PP_MENUHILITEBGNDCOLORINDEX             38L
  3813.    #define PP_MENUDISABLEDFGNDCOLOR                39L
  3814.    #define PP_MENUDISABLEDFGNDCOLORINDEX           40L
  3815.    #define PP_MENUDISABLEDBGNDCOLOR                41L
  3816.    #define PP_MENUDISABLEDBGNDCOLORINDEX           42L
  3817.    #define PP_SHADOWTEXTCOLOR                      43L
  3818.    #define PP_SHADOWTEXTCOLORINDEX                 44L
  3819.    #define PP_SHADOWHILITEFGNDCOLOR                45L
  3820.    #define PP_SHADOWHILITEFGNDCOLORINDEX           46L
  3821.    #define PP_SHADOWHILITEBGNDCOLOR                47L
  3822.    #define PP_SHADOWHILITEBGNDCOLORINDEX           48L
  3823.    #define PP_ICONTEXTBACKGROUNDCOLOR              49L
  3824.    #define PP_ICONTEXTBACKGROUNDCOLORINDEX         50L
  3825.  
  3826.    /* PP_ values 0x100 - 0x012F are reserved*/
  3827.    /* for bidirectional language support.   */
  3828.  
  3829.    #define PP_BIDI_FIRST                           0x0100L
  3830.    #define PP_BIDI_LAST                            0x012FL
  3831.  
  3832.    #define PP_USER                                 0x8000L
  3833.  
  3834.    /*
  3835.    * Flags for WinQueryPresParams()
  3836.    */
  3837.    #define QPF_NOINHERIT            0x0001 /* Don't inherit                      */
  3838.    #define QPF_ID1COLORINDEX        0x0002 /* Convert id1 color index into RGB   */
  3839.    #define QPF_ID2COLORINDEX        0x0004 /* Convert id2 color index into RGB   */
  3840.    #define QPF_PURERGBCOLOR         0x0008 /* Return pure RGB colors             */
  3841.    #define QPF_VALIDFLAGS           0x000F /* Valid WinQueryPresParams() flags.  */
  3842.  
  3843.    /*** System color functions */
  3844.  
  3845.    LONG APIENTRY WinQuerySysColor(HWND hwndDesktop,
  3846.                                   LONG clr,
  3847.                                   LONG lReserved);
  3848.    BOOL APIENTRY WinSetSysColors(HWND hwndDesktop,
  3849.                                  ULONG flOptions,
  3850.                                  ULONG flFormat,
  3851.                                  LONG clrFirst,
  3852.                                  ULONG cclr,
  3853.                                  PLONG pclr);
  3854.  
  3855.    #define SYSCLR_SHADOWHILITEBGND         (-50L)
  3856.    #define SYSCLR_SHADOWHILITEFGND         (-49L)
  3857.    #define SYSCLR_SHADOWTEXT               (-48L)
  3858.    #define SYSCLR_ENTRYFIELD               (-47L)
  3859.    #define SYSCLR_MENUDISABLEDTEXT         (-46L)
  3860.    #define SYSCLR_MENUHILITE               (-45L)
  3861.    #define SYSCLR_MENUHILITEBGND           (-44L)
  3862.    #define SYSCLR_PAGEBACKGROUND           (-43L)
  3863.    #define SYSCLR_FIELDBACKGROUND          (-42L)
  3864.    #define SYSCLR_BUTTONLIGHT              (-41L)
  3865.    #define SYSCLR_BUTTONMIDDLE             (-40L)
  3866.    #define SYSCLR_BUTTONDARK               (-39L)
  3867.    #define SYSCLR_BUTTONDEFAULT            (-38L)
  3868.    #define SYSCLR_TITLEBOTTOM              (-37L)
  3869.    #define SYSCLR_SHADOW                   (-36L)
  3870.    #define SYSCLR_ICONTEXT                 (-35L)
  3871.    #define SYSCLR_DIALOGBACKGROUND         (-34L)
  3872.    #define SYSCLR_HILITEFOREGROUND         (-33L)
  3873.    #define SYSCLR_HILITEBACKGROUND         (-32L)
  3874.    #define SYSCLR_INACTIVETITLETEXTBGND    (-31L)
  3875.    #define SYSCLR_ACTIVETITLETEXTBGND      (-30L)
  3876.    #define SYSCLR_INACTIVETITLETEXT        (-29L)
  3877.    #define SYSCLR_ACTIVETITLETEXT          (-28L)
  3878.    #define SYSCLR_OUTPUTTEXT               (-27L)
  3879.    #define SYSCLR_WINDOWSTATICTEXT         (-26L)
  3880.    #define SYSCLR_SCROLLBAR                (-25L)
  3881.    #define SYSCLR_BACKGROUND               (-24L)
  3882.    #define SYSCLR_ACTIVETITLE              (-23L)
  3883.    #define SYSCLR_INACTIVETITLE            (-22L)
  3884.    #define SYSCLR_MENU                     (-21L)
  3885.    #define SYSCLR_WINDOW                   (-20L)
  3886.    #define SYSCLR_WINDOWFRAME              (-19L)
  3887.    #define SYSCLR_MENUTEXT                 (-18L)
  3888.    #define SYSCLR_WINDOWTEXT               (-17L)
  3889.    #define SYSCLR_TITLETEXT                (-16L)
  3890.    #define SYSCLR_ACTIVEBORDER             (-15L)
  3891.    #define SYSCLR_INACTIVEBORDER           (-14L)
  3892.    #define SYSCLR_APPWORKSPACE             (-13L)
  3893.    #define SYSCLR_HELPBACKGROUND           (-12L)
  3894.    #define SYSCLR_HELPTEXT                 (-11L)
  3895.    #define SYSCLR_HELPHILITE               (-10L)
  3896.  
  3897.    #define SYSCLR_CSYSCOLORS               41L
  3898.  
  3899. #endif /* INCL_WINSYS */
  3900.  
  3901.  
  3902. #ifdef INCL_WINTIMER
  3903.    /**** Timer manager */
  3904.  
  3905.    #ifndef INCL_SAADEFS
  3906.  
  3907.       #ifdef INCL_32
  3908.  
  3909.          ULONG APIENTRY WinStartTimer(HAB hab,
  3910.                                       HWND hwnd,
  3911.                                       ULONG idTimer,
  3912.                                       ULONG dtTimeout);
  3913.          BOOL   APIENTRY WinStopTimer(HAB hab,
  3914.                                       HWND hwnd,
  3915.                                       ULONG idTimer);
  3916.  
  3917.       #else /* not INCL_32 */
  3918.  
  3919.          USHORT APIENTRY WinStartTimer(HAB hab,
  3920.                                        HWND hwnd,
  3921.                                        USHORT idTimer,
  3922.                                        USHORT dtTimeout);
  3923.          BOOL   APIENTRY WinStopTimer(HAB hab,
  3924.                                       HWND hwnd,
  3925.                                       USHORT idTimer);
  3926.  
  3927.       #endif /* INCL_32 */
  3928.  
  3929.       ULONG  APIENTRY WinGetCurrentTime(HAB hab);
  3930.  
  3931.       #define TID_CURSOR          0xffff  /* Reserved cursor timer ID              */
  3932.       #define TID_SCROLL          0xfffe  /* Reserved scrolling timer ID           */
  3933.       #define TID_FLASHWINDOW     0xfffd  /* Reserved for window flashing timer ID */
  3934.       #define TID_USERMAX         0x7fff  /* Maximum user timer ID                 */
  3935.    #endif /* !INCL_SAADEFS */
  3936.  
  3937. #endif /* INCL_WINTIMER */
  3938.  
  3939. typedef LHANDLE HACCEL; /* haccel */
  3940.  
  3941. #ifdef INCL_WINACCELERATORS
  3942.    /**** Accelerator functions */
  3943.  
  3944.    /* ACCEL fs bits
  3945.    *
  3946.    * NOTE: the first six AF_ code bits have the same value
  3947.    * as their KC_ counterparts
  3948.    */
  3949.    #ifndef INCL_SAADEFS
  3950.       #define AF_CHAR                    0x0001
  3951.       #define AF_VIRTUALKEY              0x0002
  3952.       #define AF_SCANCODE                0x0004
  3953.       #define AF_SHIFT                   0x0008
  3954.       #define AF_CONTROL                 0x0010
  3955.       #define AF_ALT                     0x0020
  3956.       #define AF_LONEKEY                 0x0040
  3957.       #define AF_SYSCOMMAND              0x0100
  3958.       #define AF_HELP                    0x0200
  3959.    #endif /* !INCL_SAADEFS */
  3960.  
  3961.    #pragma pack(2) /* force structure alignment packing */
  3962.  
  3963.    /* Binary resources may be bound into application executables or */
  3964.    /* passed as a parameter when creating a window or dialog        */
  3965.    /* Currently they must be the same for both 16-bit and 32-bit    */
  3966.    /* so we pack the structures.                                    */
  3967.    typedef struct _ACCEL {  /* acc */
  3968.       USHORT  fs;
  3969.       USHORT  key;
  3970.       USHORT  cmd;
  3971.    } ACCEL;
  3972.    typedef ACCEL FAR *PACCEL;
  3973.  
  3974.    /* Binary resources may be bound into application executables or */
  3975.    /* passed as a parameter when creating a window or dialog        */
  3976.    /* Currently they must be the same for both 16-bit and 32-bit    */
  3977.    /* so we pack the structures.                                    */
  3978.    typedef struct _ACCELTABLE {  /* acct  */
  3979.       USHORT  cAccel;
  3980.       USHORT  codepage;
  3981.       ACCEL   aaccel[1];
  3982.    } ACCELTABLE;
  3983.    typedef ACCELTABLE FAR *PACCELTABLE;
  3984.  
  3985.    #pragma pack()  /* restore packing to default */
  3986.  
  3987.    #ifdef INCL_32
  3988.       HACCEL APIENTRY WinLoadAccelTable(HAB hab,
  3989.                                         HMODULE hmod,
  3990.                                         ULONG idAccelTable);
  3991.       ULONG APIENTRY WinCopyAccelTable(HACCEL haccel,
  3992.                                        PACCELTABLE pAccelTable,
  3993.                                        ULONG cbCopyMax);
  3994.    #else
  3995.       HACCEL APIENTRY WinLoadAccelTable(HAB hab,
  3996.                                         HMODULE hmod,
  3997.                                         USHORT idAccelTable);
  3998.       USHORT APIENTRY WinCopyAccelTable(HACCEL haccel,
  3999.                                         PACCELTABLE pAccelTable,
  4000.                                         USHORT cbCopyMax);
  4001.    #endif
  4002.    HACCEL APIENTRY WinCreateAccelTable(HAB hab,
  4003.                                        PACCELTABLE pAccelTable);
  4004.    BOOL   APIENTRY WinDestroyAccelTable(HACCEL haccel);
  4005.    BOOL   APIENTRY WinTranslateAccel(HAB hab,
  4006.                                      HWND hwnd,
  4007.                                      HACCEL haccel,
  4008.                                      PQMSG pqmsg);
  4009.    BOOL   APIENTRY WinSetAccelTable(HAB hab,
  4010.                                     HACCEL haccel,
  4011.                                     HWND hwndFrame);
  4012.    HACCEL APIENTRY WinQueryAccelTable(HAB hab,
  4013.                                       HWND hwndFrame);
  4014.  
  4015. #endif /* INCL_WINACCELERATORS */
  4016.  
  4017. /**** Extended Attribute Flags (Association Table) */
  4018.  
  4019. #define EAF_DEFAULTOWNER           0x0001
  4020. #define EAF_UNCHANGEABLE           0x0002
  4021. #define EAF_REUSEICON              0x0004
  4022.  
  4023. /*** WinTrackRect() information */
  4024.  
  4025. #ifdef INCL_WINTRACKRECT
  4026.  
  4027.    /* WinTrackRect() tracking information structure */
  4028.  
  4029.    #ifdef INCL_32
  4030.       typedef struct _TRACKINFO {  /* ti */
  4031.          LONG    cxBorder;
  4032.          LONG    cyBorder;
  4033.          LONG    cxGrid;
  4034.          LONG    cyGrid;
  4035.          LONG    cxKeyboard;
  4036.          LONG    cyKeyboard;
  4037.          RECTL   rclTrack;
  4038.          RECTL   rclBoundary;
  4039.          POINTL  ptlMinTrackSize;
  4040.          POINTL  ptlMaxTrackSize;
  4041.          ULONG   fs;
  4042.       } TRACKINFO;
  4043.    #else
  4044.       typedef struct _TRACKINFO {  /* ti */
  4045.          SHORT   cxBorder;
  4046.          SHORT   cyBorder;
  4047.          SHORT   cxGrid;
  4048.          SHORT   cyGrid;
  4049.          SHORT   cxKeyboard;
  4050.          SHORT   cyKeyboard;
  4051.          RECTL   rclTrack;
  4052.          RECTL   rclBoundary;
  4053.          POINTL  ptlMinTrackSize;
  4054.          POINTL  ptlMaxTrackSize;
  4055.          USHORT  fs;
  4056.       } TRACKINFO;
  4057.    #endif
  4058.    typedef TRACKINFO FAR *PTRACKINFO;
  4059.  
  4060.    #ifndef INCL_SAADEFS
  4061.       BOOL APIENTRY WinTrackRect(HWND hwnd,
  4062.                                  HPS hps,
  4063.                                  PTRACKINFO pti);
  4064.       BOOL APIENTRY WinShowTrackRect(HWND hwnd,
  4065.                                      BOOL fShow);
  4066.  
  4067.       /* WinTrackRect() flags */
  4068.  
  4069.       #define TF_LEFT                    0x0001
  4070.       #define TF_TOP                     0x0002
  4071.       #define TF_RIGHT                   0x0004
  4072.       #define TF_BOTTOM                  0x0008
  4073.       /* TF_MOVE = TF_LEFT | TF_TOP | TF_RIGHT | TF_BOTTOM */
  4074.       #define TF_MOVE                    0x000F
  4075.  
  4076.       #define TF_SETPOINTERPOS           0x0010
  4077.       #define TF_GRID                    0x0020
  4078.       #define TF_STANDARD                0x0040
  4079.       #define TF_ALLINBOUNDARY           0x0080
  4080.       #define TF_VALIDATETRACKRECT       0x0100
  4081.       #define TF_PARTINBOUNDARY          0x0200
  4082.  
  4083.    #endif /* !INCL_SAADEFS */
  4084.  
  4085. #endif /* INCL_WINTRACKRECT */
  4086.  
  4087.  
  4088. /**** Clipboard Manager */
  4089.  
  4090. #if (defined(INCL_WINCLIPBOARD) || defined(INCL_WINDDE))
  4091.    #ifndef INCL_SAADEFS
  4092.  
  4093.       /* Clipboard messages */
  4094.  
  4095.       #define WM_RENDERFMT               0x0060
  4096.       #define WM_RENDERALLFMTS           0x0061
  4097.       #define WM_DESTROYCLIPBOARD        0x0062
  4098.       #define WM_PAINTCLIPBOARD          0x0063
  4099.       #define WM_SIZECLIPBOARD           0x0064
  4100.       #define WM_HSCROLLCLIPBOARD        0x0065
  4101.       #define WM_VSCROLLCLIPBOARD        0x0066
  4102.       #define WM_DRAWCLIPBOARD           0x0067
  4103.  
  4104.       /*
  4105.       * Standard Clipboard formats
  4106.       */
  4107.       #define CF_TEXT                    1
  4108.       #define CF_BITMAP                  2
  4109.       #define CF_DSPTEXT                 3
  4110.       #define CF_DSPBITMAP               4
  4111.       #define CF_METAFILE                5
  4112.       #define CF_DSPMETAFILE             6
  4113.       #define CF_PALETTE                 9
  4114.       #define CF_MMPMFIRST              10
  4115.       #define CF_MMPMLAST               19
  4116.       /*
  4117.       * standard DDE and clipboard format stings
  4118.       */
  4119.       #define SZFMT_TEXT                   "#1"
  4120.       #define SZFMT_BITMAP                 "#2"
  4121.       #define SZFMT_DSPTEXT                "#3"
  4122.       #define SZFMT_DSPBITMAP              "#4"
  4123.       #define SZFMT_METAFILE               "#5"
  4124.       #define SZFMT_DSPMETAFILE            "#6"
  4125.       #define SZFMT_PALETTE                "#9"
  4126.       #define SZFMT_SYLK                   "Sylk"
  4127.       #define SZFMT_DIF                    "Dif"
  4128.       #define SZFMT_TIFF                   "Tiff"
  4129.       #define SZFMT_OEMTEXT                "OemText"
  4130.       #define SZFMT_DIB                    "Dib"
  4131.       #define SZFMT_OWNERDISPLAY           "OwnerDisplay"
  4132.       #define SZFMT_LINK                   "Link"
  4133.       #define SZFMT_METAFILEPICT           "MetaFilePict"
  4134.       #define SZFMT_DSPMETAFILEPICT        "DspMetaFilePict"
  4135.       #define SZFMT_CPTEXT                 "Codepage Text"
  4136.       #define SZDDEFMT_RTF                 "Rich Text Format"
  4137.       #define SZDDEFMT_PTRPICT             "Printer_Picture"
  4138.  
  4139.       #pragma pack(2) /* force structure alignment packing */
  4140.  
  4141.       /* Metafiles are the same no matter whether they are used in     */
  4142.       /* 16-bit or 32-bit applications. While not strictly necessary   */
  4143.       /* because of inherent alignment we force packing on a 2 byte    */
  4144.       /* boundary to avoid any confusion.                              */
  4145.       typedef struct _MFP {  /* mfp */
  4146.          POINTL sizeBounds;  /* metafile notional grid size      */
  4147.          POINTL sizeMM;      /* metafile size high metric units  */
  4148.          ULONG  cbLength;    /* length of metafile data          */
  4149.          USHORT mapMode;     /* a PM metaflie map mode           */
  4150.          USHORT reserved;
  4151.          BYTE   abData[1];   /* metafile Data                    */
  4152.       } MFP;
  4153.       typedef MFP FAR *PMFP;
  4154.  
  4155.       /* CPTEXT DDE data are the same no matter whether they are used  */
  4156.       /* in 16-bit or 32-bit applications. While not strictly necessary*/
  4157.       /* because of inherent alignment we force packing on a 2 byte    */
  4158.       /* boundary to avoid any confusion.                              */
  4159.       typedef struct _CPTEXT {  /* cptxt */
  4160.          USHORT idCountry;
  4161.          USHORT usCodepage;
  4162.          USHORT usLangID;
  4163.          USHORT usSubLangID;
  4164.          BYTE   abText[1];   /* text string starts here          */
  4165.       } CPTEXT;
  4166.       typedef CPTEXT FAR *PCPTEXT;
  4167.  
  4168.       #pragma pack()  /* restore packing to default */
  4169.  
  4170.    #endif /* not INCL_SAADEFS */
  4171. #endif /* INCL_WINCLIPBOARD | INCL_WINDDE */
  4172.  
  4173. #ifdef INCL_WINCLIPBOARD
  4174.    #ifndef INCL_SAADEFS
  4175.       BOOL   APIENTRY WinSetClipbrdOwner(HAB hab,
  4176.                                          HWND hwnd);
  4177.       #ifdef INCL_32
  4178.          BOOL   APIENTRY WinSetClipbrdData(HAB hab,
  4179.                                            ULONG ulData,
  4180.                                            ULONG fmt,
  4181.                                            ULONG rgfFmtInfo);
  4182.          ULONG  APIENTRY WinQueryClipbrdData(HAB hab,
  4183.                                              ULONG fmt);
  4184.          BOOL   APIENTRY WinQueryClipbrdFmtInfo(HAB hab,
  4185.                                                 ULONG fmt,
  4186.                                                 PULONG prgfFmtInfo);
  4187.       #else
  4188.          BOOL   APIENTRY WinSetClipbrdData(HAB hab,
  4189.                                            ULONG ulData,
  4190.                                            USHORT fmt,
  4191.                                            USHORT rgfFmtInfo);
  4192.          ULONG  APIENTRY WinQueryClipbrdData(HAB hab,
  4193.                                              USHORT fmt);
  4194.          BOOL   APIENTRY WinQueryClipbrdFmtInfo(HAB hab,
  4195.                                                 USHORT fmt,
  4196.                                                 PUSHORT prgfFmtInfo);
  4197.       #endif
  4198.       BOOL   APIENTRY WinSetClipbrdViewer(HAB hab,
  4199.                                           HWND hwndNewClipViewer);
  4200.  
  4201.       /* WinSetClipbrdData() flags */
  4202.  
  4203.       #define CFI_OWNERFREE              0x0001
  4204.       #define CFI_OWNERDISPLAY           0x0002
  4205.       #ifdef INCL_32
  4206.          #define CFI_POINTER                0x0400
  4207.       #else
  4208.          #define CFI_SELECTOR               0x0100
  4209.       #endif
  4210.       #define CFI_HANDLE                 0x0200
  4211.  
  4212.    #endif /* !INCL_SAADEFS */
  4213.  
  4214.    #ifdef INCL_32
  4215.       ULONG APIENTRY WinEnumClipbrdFmts(HAB hab,
  4216.                                         ULONG fmt);
  4217.    #else
  4218.       USHORT APIENTRY WinEnumClipbrdFmts(HAB hab,
  4219.                                          USHORT fmt);
  4220.    #endif
  4221.    BOOL   APIENTRY WinEmptyClipbrd(HAB hab);
  4222.    BOOL   APIENTRY WinOpenClipbrd(HAB hab);
  4223.    BOOL   APIENTRY WinCloseClipbrd(HAB hab);
  4224.  
  4225.    #ifdef INCL_32
  4226.       HWND   APIENTRY WinQueryClipbrdOwner(HAB hab);
  4227.       HWND   APIENTRY WinQueryClipbrdViewer(HAB hab);
  4228.    #else
  4229.       HWND   APIENTRY WinQueryClipbrdOwner(HAB hab,
  4230.                                            BOOL fLock);
  4231.       HWND   APIENTRY WinQueryClipbrdViewer(HAB hab,
  4232.                                             BOOL fLock);
  4233.    #endif  /* INCL_32 */
  4234.  
  4235. #endif /* INCL_WINCLIPBOARD */
  4236.  
  4237.  
  4238. #if (defined(INCL_WINCURSORS) || !defined(INCL_NOCOMMON))
  4239.    /**** Cursor manager common subsection */
  4240.  
  4241.    BOOL APIENTRY WinDestroyCursor(HWND hwnd);
  4242.    BOOL APIENTRY WinShowCursor(HWND hwnd,
  4243.                                BOOL fShow);
  4244.    #ifdef INCL_32
  4245.       BOOL APIENTRY WinCreateCursor(HWND hwnd,
  4246.                                     LONG x,
  4247.                                     LONG y,
  4248.                                     LONG cx,
  4249.                                     LONG cy,
  4250.                                     ULONG fs,
  4251.                                     PRECTL prclClip);
  4252.    #else
  4253.       BOOL APIENTRY WinCreateCursor(HWND hwnd,
  4254.                                     SHORT x,
  4255.                                     SHORT y,
  4256.                                     SHORT cx,
  4257.                                     SHORT cy,
  4258.                                     USHORT fs,
  4259.                                     PRECTL prclClip);
  4260.    #endif
  4261.  
  4262.    /* WinCreateCursor() flags */
  4263.  
  4264.    #define CURSOR_SOLID               0x0000
  4265.    #define CURSOR_HALFTONE            0x0001
  4266.    #define CURSOR_FRAME               0x0002
  4267.    #define CURSOR_FLASH               0x0004
  4268.    #define CURSOR_SETPOS              0x8000
  4269.  
  4270.    /* Cursor flags 0x0100 and 0x0200 reserved */
  4271.    /* for bidirectional language support.     */
  4272.  
  4273.    #define CURSOR_BIDI_FIRST          0x0100
  4274.    #define CURSOR_BIDI_LAST           0x0200
  4275.  
  4276.  
  4277. #endif /* Cursor manager common subsection */
  4278.  
  4279. #ifdef INCL_WINCURSORS
  4280.  
  4281.    #ifdef INCL_32
  4282.       typedef struct _CURSORINFO {  /* csri */
  4283.          HWND    hwnd;
  4284.          LONG    x;
  4285.          LONG    y;
  4286.          LONG    cx;
  4287.          LONG    cy;
  4288.          ULONG   fs;
  4289.          RECTL   rclClip;
  4290.       } CURSORINFO;
  4291.    #else
  4292.       typedef struct _CURSORINFO {  /* csri */
  4293.          HWND    hwnd;
  4294.          SHORT   x;
  4295.          SHORT   y;
  4296.          SHORT   cx;
  4297.          SHORT   cy;
  4298.          USHORT  fs;
  4299.          RECTL   rclClip;
  4300.       } CURSORINFO;
  4301.    #endif
  4302.    typedef CURSORINFO FAR *PCURSORINFO;
  4303.  
  4304.    BOOL APIENTRY WinQueryCursorInfo(HWND hwndDesktop,
  4305.                                     PCURSORINFO pCursorInfo);
  4306.  
  4307. #endif /* INCL_WINCURSORS */
  4308.  
  4309.  
  4310. #ifdef INCL_WINPOINTERS
  4311.    /**** Pointer manager */
  4312.  
  4313.    BOOL     APIENTRY WinSetPointer(HWND hwndDesktop,
  4314.                                    HPOINTER hptrNew);
  4315.    BOOL     APIENTRY WinSetPointerOwner(HPOINTER hptr,
  4316.                                         PID pid,
  4317.                                         BOOL fDestroy);
  4318.    BOOL     APIENTRY WinShowPointer(HWND hwndDesktop,
  4319.                                     BOOL fShow);
  4320.    #ifdef INCL_32
  4321.    BOOL     APIENTRY WinLockPointerUpdate(HWND hwndDesktop,
  4322.                                           HPOINTER hptrNew,
  4323.                                           ULONG ulTimeInterval);
  4324.       HPOINTER APIENTRY WinQuerySysPointer(HWND hwndDesktop,
  4325.                                            LONG iptr,
  4326.                                            BOOL fLoad);
  4327.    #else
  4328.    BOOL     APIENTRY WinLockPointerUpdate(HWND hwndDesktop,
  4329.                                           HPOINTER hptrNew,
  4330.                                           USHORT usTimeInterval);
  4331.       HPOINTER APIENTRY WinQuerySysPointer(HWND hwndDesktop,
  4332.                                            SHORT iptr,
  4333.                                            BOOL fLoad);
  4334.    #endif
  4335.  
  4336.    #ifdef INCL_32
  4337.       BOOL APIENTRY WinQuerySysPointerData(HWND hwndDesktop,
  4338.                                            ULONG iptr,
  4339.                                            PICONINFO pIconInfo);
  4340.       BOOL APIENTRY WinSetSysPointerData(HWND hwndDesktop,
  4341.                                          ULONG iptr,
  4342.                                          PICONINFO pIconInfo);
  4343.    #endif
  4344.  
  4345.    /* System pointers (NOTE: these are 1-based) */
  4346.  
  4347.    #define SPTR_ARROW                 1
  4348.    #define SPTR_TEXT                  2
  4349.    #define SPTR_WAIT                  3
  4350.    #define SPTR_SIZE                  4
  4351.    #define SPTR_MOVE                  5
  4352.    #define SPTR_SIZENWSE              6
  4353.    #define SPTR_SIZENESW              7
  4354.    #define SPTR_SIZEWE                8
  4355.    #define SPTR_SIZENS                9
  4356.    #define SPTR_APPICON               10
  4357.  
  4358.    #define SPTR_ICONINFORMATION       11
  4359.    #define SPTR_ICONQUESTION          12
  4360.    #define SPTR_ICONERROR             13
  4361.    #define SPTR_ICONWARNING           14
  4362.  
  4363.    #define SPTR_ILLEGAL               18
  4364.    #define SPTR_FILE                  19
  4365.    #define SPTR_FOLDER                20
  4366.    #define SPTR_MULTFILE              21
  4367.    #define SPTR_PROGRAM               22
  4368.    #define SPTR_DISPLAY_PTRS          22
  4369.    #define SPTR_PENFIRST              23
  4370.    #define SPTR_PENLAST               39
  4371.    #define SPTR_CPTR                  39  /* total # of system pointers */
  4372.  
  4373.    /* backward compatibility */
  4374.    #define SPTR_HANDICON         SPTR_ICONERROR
  4375.    #define SPTR_QUESICON         SPTR_ICONQUESTION
  4376.    #define SPTR_BANGICON         SPTR_ICONWARNING
  4377.    #define SPTR_NOTEICON         SPTR_ICONINFORMATION
  4378.  
  4379.  
  4380.    #ifdef INCL_32
  4381.       HPOINTER APIENTRY WinLoadPointer(HWND hwndDesktop,
  4382.                                        HMODULE hmod,
  4383.                                        ULONG idres);
  4384.       HPOINTER APIENTRY WinCreatePointer(HWND hwndDesktop,
  4385.                                          HBITMAP hbmPointer,
  4386.                                          BOOL fPointer,
  4387.                                          LONG xHotspot,
  4388.                                          LONG yHotspot);
  4389.       BOOL     APIENTRY WinSetPointerPos(HWND hwndDesktop,
  4390.                                          LONG x,
  4391.                                          LONG y);
  4392.    #else
  4393.       HPOINTER APIENTRY WinLoadPointer(HWND hwndDesktop,
  4394.                                        HMODULE hmod,
  4395.                                        USHORT idres);
  4396.       HPOINTER APIENTRY WinCreatePointer(HWND hwndDesktop,
  4397.                                          HBITMAP hbmPointer,
  4398.                                          BOOL fPointer,
  4399.                                          SHORT xHotspot,
  4400.                                          SHORT yHotspot);
  4401.       BOOL     APIENTRY WinSetPointerPos(HWND hwndDesktop,
  4402.                                          SHORT x,
  4403.                                          SHORT y);
  4404.    #endif
  4405.    BOOL     APIENTRY WinDestroyPointer(HPOINTER hptr);
  4406.  
  4407.    HPOINTER APIENTRY WinQueryPointer(HWND hwndDesktop);
  4408.    BOOL     APIENTRY WinQueryPointerPos(HWND hwndDesktop,
  4409.                                         PPOINTL pptl);
  4410.  
  4411.    #ifdef INCL_32
  4412.       typedef struct _POINTERINFO {  /* ptri */
  4413.          ULONG   fPointer;
  4414.          LONG    xHotspot;
  4415.          LONG    yHotspot;
  4416.          HBITMAP hbmPointer;
  4417.          HBITMAP hbmColor;
  4418.          HBITMAP hbmMiniPointer;
  4419.          HBITMAP hbmMiniColor;
  4420.       } POINTERINFO;
  4421.    #else
  4422.       typedef struct _POINTERINFO {  /* ptri */
  4423.          USHORT  fPointer;
  4424.          SHORT   xHotspot;
  4425.          SHORT   yHotspot;
  4426.          HBITMAP hbmPointer;
  4427.          HBITMAP hbmColor;
  4428.       } POINTERINFO;
  4429.    #endif
  4430.    typedef POINTERINFO FAR *PPOINTERINFO;
  4431.  
  4432.    HPOINTER APIENTRY WinCreatePointerIndirect(HWND hwndDesktop,
  4433.                                               PPOINTERINFO pptri);
  4434.    BOOL     APIENTRY WinQueryPointerInfo(HPOINTER hptr,
  4435.                                          PPOINTERINFO pPointerInfo);
  4436.    #ifdef INCL_32
  4437.       BOOL     APIENTRY WinDrawPointer(HPS hps,
  4438.                                        LONG x,
  4439.                                        LONG y,
  4440.                                        HPOINTER hptr,
  4441.                                        ULONG fs);
  4442.    #else
  4443.       BOOL     APIENTRY WinDrawPointer(HPS hps,
  4444.                                        SHORT x,
  4445.                                        SHORT y,
  4446.                                        HPOINTER hptr,
  4447.                                        USHORT fs);
  4448.    #endif
  4449.  
  4450.  
  4451.  
  4452.    /* WinDrawPointer() constants */
  4453.  
  4454.    #define DP_NORMAL                  0x0000
  4455.    #define DP_HALFTONED               0x0001
  4456.    #define DP_INVERTED                0x0002
  4457.    #define DP_MINI                    0x0004  /*   Feature:85493  */
  4458.  
  4459.  
  4460.    #ifdef INCL_32
  4461.       HBITMAP APIENTRY WinGetSysBitmap(HWND hwndDesktop,
  4462.                                        ULONG ibm);
  4463.    #else
  4464.       HBITMAP APIENTRY WinGetSysBitmap(HWND hwndDesktop,
  4465.                                        USHORT ibm);
  4466.    #endif
  4467.  
  4468.    /* System bitmaps (NOTE: these are 1-based) */
  4469.  
  4470.    #define SBMP_OLD_SYSMENU           1
  4471.    #define SBMP_OLD_SBUPARROW         2
  4472.    #define SBMP_OLD_SBDNARROW         3
  4473.    #define SBMP_OLD_SBRGARROW         4
  4474.    #define SBMP_OLD_SBLFARROW         5
  4475.    #define SBMP_MENUCHECK             6
  4476.    #define SBMP_OLD_CHECKBOXES        7
  4477.    #define SBMP_BTNCORNERS            8
  4478.    #define SBMP_OLD_MINBUTTON         9
  4479.    #define SBMP_OLD_MAXBUTTON         10
  4480.    #define SBMP_OLD_RESTOREBUTTON     11
  4481.    #define SBMP_OLD_CHILDSYSMENU      12
  4482.    #define SBMP_DRIVE                 15
  4483.    #define SBMP_FILE                  16
  4484.    #define SBMP_FOLDER                17
  4485.    #define SBMP_TREEPLUS              18
  4486.    #define SBMP_TREEMINUS             19
  4487.    #define SBMP_PROGRAM               22
  4488.    #define SBMP_MENUATTACHED          23
  4489.    #define SBMP_SIZEBOX               24
  4490.  
  4491.    #define SBMP_SYSMENU               25
  4492.    #define SBMP_MINBUTTON             26
  4493.    #define SBMP_MAXBUTTON             27
  4494.    #define SBMP_RESTOREBUTTON         28
  4495.    #define SBMP_CHILDSYSMENU          29
  4496.    #define SBMP_SYSMENUDEP            30
  4497.    #define SBMP_MINBUTTONDEP          31
  4498.    #define SBMP_MAXBUTTONDEP          32
  4499.    #define SBMP_RESTOREBUTTONDEP      33
  4500.    #define SBMP_CHILDSYSMENUDEP       34
  4501.    #define SBMP_SBUPARROW             35
  4502.    #define SBMP_SBDNARROW             36
  4503.    #define SBMP_SBLFARROW             37
  4504.    #define SBMP_SBRGARROW             38
  4505.    #define SBMP_SBUPARROWDEP          39
  4506.    #define SBMP_SBDNARROWDEP          40
  4507.    #define SBMP_SBLFARROWDEP          41
  4508.    #define SBMP_SBRGARROWDEP          42
  4509.    #define SBMP_SBUPARROWDIS          43
  4510.    #define SBMP_SBDNARROWDIS          44
  4511.    #define SBMP_SBLFARROWDIS          45
  4512.    #define SBMP_SBRGARROWDIS          46
  4513.    #define SBMP_COMBODOWN             47
  4514.    #define SBMP_CHECKBOXES        48
  4515.  
  4516. #endif /* INCL_WINPOINTERS */
  4517.  
  4518.  
  4519. /**** Hook manager */
  4520.  
  4521. #ifdef INCL_WINHOOKS
  4522.  
  4523.    #ifndef INCL_SAADEFS
  4524.       #ifdef INCL_32
  4525.          BOOL APIENTRY WinSetHook(HAB hab,
  4526.                                   HMQ hmq,
  4527.                                   LONG iHook,
  4528.                                   PFN pfnHook,
  4529.                                   HMODULE hmod);
  4530.          BOOL APIENTRY WinReleaseHook(HAB hab,
  4531.                                       HMQ hmq,
  4532.                                       LONG iHook,
  4533.                                       PFN pfnHook,
  4534.                                       HMODULE hmod);
  4535.          BOOL APIENTRY WinCallMsgFilter(HAB hab,
  4536.                                         PQMSG pqmsg,
  4537.                                         ULONG msgf);
  4538.       #else
  4539.          BOOL APIENTRY WinSetHook(HAB hab,
  4540.                                   HMQ hmq,
  4541.                                   SHORT iHook,
  4542.                                   PFN pfnHook,
  4543.                                   HMODULE hmod);
  4544.          BOOL APIENTRY WinReleaseHook(HAB hab,
  4545.                                       HMQ hmq,
  4546.                                       SHORT iHook,
  4547.                                       PFN pfnHook,
  4548.                                       HMODULE hmod);
  4549.          BOOL APIENTRY WinCallMsgFilter(HAB hab,
  4550.                                         PQMSG pqmsg,
  4551.                                         USHORT msgf);
  4552.       #endif
  4553.  
  4554.  
  4555.       /**********************************************************************
  4556.       * Hook codes
  4557.       *
  4558.       * Whether the hook receives a (U)SHORT or (U)LONG parameter depends
  4559.       * on the memory model that the hook executes in. 32-bit hook will
  4560.       * receive long parameters
  4561.       *
  4562.       **********************************************************************/
  4563.  
  4564.       #define HK_SENDMSG                 0
  4565.       /* VOID EXPENTRY SendMsgHook(HAB hab,               ** installer's hab
  4566.       *                            PSMHSTRUCT psmh,       ** p send msg struct
  4567.       *                            BOOL fInterTask);      ** between threads */
  4568.  
  4569.       #define HK_INPUT                   1
  4570.       /* BOOL EXPENTRY InputHook(HAB hab,                 ** installer's hab
  4571.       *                          PQMSG pQmsg,             ** p qmsg
  4572.       *                          ULONG/USHORT fs);        ** remove/noremove */
  4573.  
  4574.       #define HK_MSGFILTER               2
  4575.       /* BOOL EXPENTRY MsgFilterHook(HAB hab,             ** installer's hab
  4576.       *                              PQMSG pQmsg,         ** p qmsg
  4577.       *                              ULONG/USHORT msgf);  ** filter flag */
  4578.  
  4579.       #define HK_JOURNALRECORD           3
  4580.       /* VOID EXPENTRY JournalRecordHook(HAB hab,         ** installer's hab
  4581.       *                                  PQMSG pQmsg);    ** p qmsg */
  4582.  
  4583.       #define HK_JOURNALPLAYBACK         4
  4584.       /* ULONG EXPENTRY JournalPlaybackHook(HAB hab,      **installer's hab
  4585.       *                                     BOOL fSkip,   ** skip messages
  4586.       *                                     PQMSG pQmsg); ** p qmsg */
  4587.  
  4588.       #define HK_HELP                    5
  4589.       /* BOOL EXPENTRY HelpHook(HAB hab,                  ** installer's hab
  4590.       *                         ULONG/USHORT usMode,      ** mode
  4591.       *                         ULONG/USHORT idTopic,     ** main topic
  4592.       *                         ULONG/USHORT idSubTopic,  ** sub topic
  4593.       *                         PRECTL prcPosition);      ** associated position */
  4594.  
  4595.       #define HK_LOADER                  6
  4596.       /* BOOL EXPENTRY LoaderHook(HAB hab,                ** installer's hab
  4597.       *                           LONG/USHORT idContext,  ** who called hook
  4598.       *                           PSZ pszLibname,         ** lib name string
  4599.       *                           PHLIB hlib,             ** p to lib handle
  4600.       *                           PSZ pszProcname,        ** procedure name
  4601.       *                           PFNWP wndProc);         ** window procedure */
  4602.  
  4603.       #define HK_REGISTERUSERMSG         7
  4604.       /* BOOL EXPENTRY RegisterUserHook(HAB hab,          ** installer's hab
  4605.       *                                 ULONG cUshort,    ** entries in arRMP
  4606.       *                                 PULONG/PUSHORT arRMP, ** RMP array
  4607.       *                                 PBOOL fRegistered); ** msg parms already reg*/
  4608.  
  4609.       #define HK_MSGCONTROL              8
  4610.       /* BOOL EXPENTRY MsgControlHook(HAB hab,            ** installer's hab
  4611.       *                               LONG/SHORT idContext,** who called hook
  4612.       *                               HWND hwnd,          ** SEI window handle
  4613.       *                               PSZ pszClassname,   ** window class name
  4614.       *                               ULONG/USHORT usMsgclass,** interested msg class **
  4615.       *                               LONG/SHORT idControl,** SMI_*
  4616.       *                               PBOOL fSuccess);    ** mode already set */
  4617.  
  4618.       #define HK_PLIST_ENTRY             9
  4619.       /* BOOL EXPENTRY ProgramListEntryHook(HAB hab,      ** installer's hab
  4620.       *                                     PPRFHOOKPARMS pProfileHookParams,** data
  4621.       *                                     PBOOL fNoExecute);  ** cease hook processing*/
  4622.  
  4623.       #define HK_PLIST_EXIT              10
  4624.       /* BOOL EXPENTRY ProgramListExitHook(HAB hab,       ** installer's hab
  4625.       *                                    PPRFHOOKPARMS pProfileHookParams);** data*/
  4626.  
  4627.       #define HK_FINDWORD                11
  4628.       /* BOOL EXPENTRY FindWordHook(usCodepage,           ** code page to use
  4629.       *                             PSZ pszText,          ** text to break
  4630.       *                             ULONG cb,             ** maximum text size
  4631.       *                             ULONG ich,            ** break 'near' here
  4632.       *                             PULONG pichStart,     ** where break began
  4633.       *                             PULONG pichEnd,       ** where break ended
  4634.       *                             PULONG pichNext);     ** where next word begin*/
  4635.  
  4636.       #define HK_CODEPAGECHANGED         12
  4637.       /* VOID EXPENTRY CodePageChangedHook(HMQ hmq,       ** msg q handle
  4638.       *                                    ULONG/USHORT usOldCodepage, ** old code page
  4639.       *                                    ULONG/USHORT usNewCodepage);** new code page*/
  4640.  
  4641.       #define HK_WINDOWDC                15
  4642.       /* BOOL EXPENTRY WindowDCHook(HAB  hab,             ** installer's hab
  4643.       *                             HDC  hdc,             ** current hdc
  4644.       *                             HWND hwnd,            ** current hwnd
  4645.       *                             BOOL);                ** association flag */
  4646.  
  4647.       #define HK_DESTROYWINDOW           16
  4648.       /* BOOL EXPENTRY DestroyWindowHook (HAB  hab,       ** installer's hab
  4649.       *                                   HWND hwnd,      ** destroyed win hwnd
  4650.       *                                   ULONG Reserved);** association flag  */
  4651.  
  4652.       #define HK_CHECKMSGFILTER          20
  4653.       /* BOOL EXPENTRY CheckMsgFilteHook (HAB  hab,       ** installer's hab
  4654.       *                                   PQMSG pQmsg,    ** p qmsg
  4655.       *                                   ULONG/USHORT usFirst,  ** first msg
  4656.       *                                   ULONG/USHORT usLast,   ** last msg
  4657.       *                                   ULONG/USHORT fOptions);** flags  */
  4658.  
  4659.       #define HK_MSGINPUT                21
  4660.       /* BOOL EXPENTRY MsgInputHook (HAB  hab,          ** installer's hab
  4661.       *                              PQMSG pQmsg,       ** p qmsg
  4662.       *                              BOOL fSkip,        ** skip msg
  4663.       *                              PBOOL pfNoRecord); ** journal record event */
  4664.  
  4665.       #define HK_LOCKUP                  23
  4666.       /* BOOL EXPENTRY LockupHook (HAB  hab,              ** installer's hab
  4667.       *                           HWND hwndLockupFrame); ** hwnd     */
  4668.  
  4669.       #define HK_FLUSHBUF                24
  4670.       /* BOOL EXPENTRY FlushBufHook (HAB  hab);           ** installer's hab */
  4671.  
  4672.       /*** Current message queue constant **********************************/
  4673.       #define HMQ_CURRENT          ((HMQ)1)
  4674.  
  4675.       /*** WH_MSGFILTER context codes **************************************/
  4676.       #define MSGF_DIALOGBOX             1
  4677.       #define MSGF_MESSAGEBOX            2
  4678.       #define MSGF_TRACK                 8
  4679.       #define MSGF_DDEPOSTMSG            3
  4680.  
  4681.       /*** HK_HELP Help modes **********************************************/
  4682.       #define HLPM_FRAME              (-1)
  4683.       #define HLPM_WINDOW             (-2)
  4684.       #define HLPM_MENU               (-3)
  4685.  
  4686.       /*** HK_SENDMSG structure ********************************************/
  4687.       #define PM_MODEL_1X      0
  4688.       #define PM_MODEL_2X      1
  4689.  
  4690.       #ifdef INCL_32
  4691.          typedef struct _SMHSTRUCT {    /* smhs */
  4692.             MPARAM mp2;
  4693.             MPARAM mp1;
  4694.             ULONG  msg;
  4695.             HWND   hwnd;
  4696.             ULONG  model;
  4697.          } SMHSTRUCT;
  4698.       #else
  4699.          typedef struct _SMHSTRUCT {    /* smhs */
  4700.             MPARAM mp2;
  4701.             MPARAM mp1;
  4702.             USHORT msg;
  4703.             HWND   hwnd;
  4704.             USHORT model;
  4705.          } SMHSTRUCT;
  4706.       #endif
  4707.       typedef SMHSTRUCT *PSMHSTRUCT;
  4708.  
  4709.       /*HK_LOADER context codes */
  4710.  
  4711.       #define LHK_DELETEPROC             1
  4712.       #define LHK_DELETELIB              2
  4713.       #define LHK_LOADPROC               3
  4714.       #define LHK_LOADLIB                4
  4715.  
  4716.       /*HK_MSGCONTROL context codes */
  4717.  
  4718.       #define MCHK_MSGINTEREST           1
  4719.       #define MCHK_CLASSMSGINTEREST      2
  4720.       #define MCHK_SYNCHRONISATION       3
  4721.       #define MCHK_MSGMODE               4
  4722.  
  4723.       /*HK_REGISTERUSERMSG conext codes */
  4724.  
  4725.       #define RUMHK_DATATYPE             1
  4726.       #define RUMHK_MSG                  2
  4727.  
  4728.    #endif /* INCL_SAADEFS */
  4729.  
  4730. #endif /* INCL_WINHOOKS */
  4731.  
  4732.  
  4733. #ifdef INCL_WINTHUNKAPI
  4734.  
  4735.    BOOL    APIENTRY WinSetClassThunkProc(PSZ pszClassname,
  4736.                                          PFN pfnThunkProc);
  4737.    PFN     APIENTRY WinQueryClassThunkProc(PSZ pszClassname);
  4738.    BOOL    APIENTRY WinSetWindowThunkProc(HWND hwnd,
  4739.                                           PFN pfnThunkProc);
  4740.    PFN     APIENTRY WinQueryWindowThunkProc(HWND hwnd);
  4741.    #ifdef INCL_32
  4742.       LONG   APIENTRY WinQueryWindowModel(HWND hwnd);
  4743.    #else
  4744.       SHORT   APIENTRY WinQueryWindowModel(HWND hwnd);
  4745.    #endif
  4746.  
  4747. #endif /* INCL_WINTHUNKAPI */
  4748.  
  4749. /*
  4750. * Include Shell API
  4751. */
  4752. #ifndef INCL_SAADEFS
  4753.    #include <pmshl.h>      /* OS/2 Shell definitions */
  4754. #endif /* !INCL_SAADEFS */
  4755.  
  4756. #ifdef INCL_WINCOUNTRY
  4757.  
  4758.    #ifdef INCL_32
  4759.       ULONG  APIENTRY WinQueryCp(HMQ hmq);
  4760.    #else
  4761.       USHORT  APIENTRY WinQueryCp(HMQ hmq);
  4762.    #endif
  4763.  
  4764.    #ifndef INCL_SAADEFS
  4765.       #ifdef INCL_32
  4766.          BOOL    APIENTRY WinSetCp(HMQ hmq,
  4767.                                    ULONG idCodePage);
  4768.  
  4769.          ULONG  APIENTRY WinQueryCpList(HAB hab,
  4770.                                         ULONG ccpMax,
  4771.                                         PULONG prgcp);
  4772.  
  4773.          BOOL    APIENTRY WinCpTranslateString(HAB hab,
  4774.                                                ULONG cpSrc,
  4775.                                                PSZ pszSrc,
  4776.                                                ULONG cpDst,
  4777.                                                ULONG cchDestMax,
  4778.                                                PSZ pchDest);
  4779.  
  4780.          UCHAR   APIENTRY WinCpTranslateChar(HAB hab,
  4781.                                              ULONG cpSrc,
  4782.                                              UCHAR chSrc,
  4783.                                              ULONG cpDst);
  4784.  
  4785.          ULONG  APIENTRY WinUpper(HAB hab,
  4786.                                   ULONG idcp,
  4787.                                   ULONG idcc,
  4788.                                   PSZ psz);
  4789.  
  4790.          ULONG  APIENTRY WinUpperChar(HAB hab,
  4791.                                       ULONG idcp,
  4792.                                       ULONG idcc,
  4793.                                       ULONG c);
  4794.  
  4795.          PSZ     APIENTRY WinNextChar(HAB hab,
  4796.                                       ULONG idcp,
  4797.                                       ULONG idcc,
  4798.                                       PSZ psz);
  4799.  
  4800.          PSZ     APIENTRY WinPrevChar(HAB hab,
  4801.                                       ULONG idcp,
  4802.                                       ULONG idcc,
  4803.                                       PSZ pszStart,
  4804.                                       PSZ psz);
  4805.  
  4806.          ULONG  APIENTRY WinCompareStrings(HAB hab,
  4807.                                            ULONG idcp,
  4808.                                            ULONG idcc,
  4809.                                            PSZ psz1,
  4810.                                            PSZ psz2,
  4811.                                            ULONG reserved);
  4812.       #else /* not INCL_32 */
  4813.          BOOL    APIENTRY WinSetCp(HMQ hmq,
  4814.                                    USHORT idCodePage);
  4815.  
  4816.          USHORT  APIENTRY WinQueryCpList(HAB hab,
  4817.                                          USHORT ccpMax,
  4818.                                          PUSHORT prgcp);
  4819.  
  4820.          BOOL    APIENTRY WinCpTranslateString(HAB hab,
  4821.                                                USHORT cpSrc,
  4822.                                                PSZ pszSrc,
  4823.                                                USHORT cpDst,
  4824.                                                USHORT cchDestMax,
  4825.                                                PSZ pchDest);
  4826.  
  4827.          UCHAR   APIENTRY WinCpTranslateChar(HAB hab,
  4828.                                              USHORT cpSrc,
  4829.                                              UCHAR chSrc,
  4830.                                              USHORT cpDst);
  4831.  
  4832.          USHORT  APIENTRY WinUpper(HAB hab,
  4833.                                    USHORT idcp,
  4834.                                    USHORT idcc,
  4835.                                    PSZ psz);
  4836.  
  4837.          USHORT  APIENTRY WinUpperChar(HAB hab,
  4838.                                        USHORT idcp,
  4839.                                        USHORT idcc,
  4840.                                        USHORT c);
  4841.  
  4842.          PSZ     APIENTRY WinNextChar(HAB hab,
  4843.                                       USHORT idcp,
  4844.                                       USHORT idcc,
  4845.                                       PSZ psz);
  4846.  
  4847.          PSZ     APIENTRY WinPrevChar(HAB hab,
  4848.                                       USHORT idcp,
  4849.                                       USHORT idcc,
  4850.                                       PSZ pszStart,
  4851.                                       PSZ psz);
  4852.  
  4853.          USHORT  APIENTRY WinCompareStrings(HAB hab,
  4854.                                             USHORT idcp,
  4855.                                             USHORT idcc,
  4856.                                             PSZ psz1,
  4857.                                             PSZ psz2,
  4858.                                             USHORT reserved);
  4859.       #endif /* INCL_32 */
  4860.  
  4861.       #define WCS_ERROR                  0
  4862.       #define WCS_EQ                     1
  4863.       #define WCS_LT                     2
  4864.       #define WCS_GT                     3
  4865.  
  4866.    #endif /* !INCL_SAADEFS */
  4867.  
  4868. #endif /* INCL_WINCOUNTRY */
  4869.  
  4870.  
  4871.  
  4872. /* Heap Manager Interface declarations */
  4873.  
  4874. #ifdef INCL_WINHEAP
  4875.  
  4876.    #ifndef INCL_32
  4877.  
  4878.       #ifndef INCL_SAADEFS
  4879.          typedef LHANDLE HHEAP;
  4880.  
  4881.          HHEAP       APIENTRY WinCreateHeap(SEL selHeapBase,
  4882.                                             USHORT cbHeap,
  4883.                                             USHORT cbGrow,
  4884.                                             USHORT chMinDed,
  4885.                                             USHORT cbMaxDed,
  4886.                                             USHORT fOptions);
  4887.          HHEAP       APIENTRY WinDestroyHeap(HHEAP hHeap);
  4888.          USHORT      APIENTRY WinAvailMem(HHEAP hHeap,
  4889.                                           BOOL fCompact,
  4890.                                           USHORT cbMinFree);
  4891.          NPBYTE      APIENTRY WinAllocMem(HHEAP hHeap,
  4892.                                           USHORT cb);
  4893.          NPBYTE      APIENTRY WinReallocMem(HHEAP hHeap,
  4894.                                             NPBYTE npMem,
  4895.                                             USHORT cbOld,
  4896.                                             USHORT cbNew);
  4897.          NPBYTE      APIENTRY WinFreeMem(HHEAP hHeap,
  4898.                                          NPBYTE npMem,
  4899.                                          USHORT cbMem);
  4900.          PVOID       APIENTRY WinLockHeap(HHEAP hHeap);
  4901.  
  4902.          #define HM_MOVEABLE                0x0001      /* Parameters to WinCreateHeap */
  4903.          #define HM_VALIDSIZE               0x0002
  4904.       #endif /* !INCL_SAADEFS */
  4905.  
  4906.    #endif  /* !INCL_32 */
  4907.  
  4908. #endif  /* INCL_WINHEAP */
  4909.  
  4910.  
  4911. /*** Atom Manager Interface declarations */
  4912.  
  4913. #ifdef INCL_WINATOM
  4914.  
  4915.    #ifndef INCL_SAADEFS
  4916.       typedef LHANDLE  HATOMTBL;
  4917.       #ifdef INCL_32
  4918.          typedef ULONG   ATOM;
  4919.       #else
  4920.          typedef USHORT   ATOM;
  4921.       #endif
  4922.  
  4923.       HATOMTBL APIENTRY WinQuerySystemAtomTable(VOID);
  4924.       #ifdef INCL_32
  4925.          HATOMTBL APIENTRY WinCreateAtomTable(ULONG cbInitial,
  4926.                                               ULONG cBuckets);
  4927.       #else
  4928.          HATOMTBL APIENTRY WinCreateAtomTable(USHORT cbInitial,
  4929.                                               USHORT cBuckets);
  4930.       #endif
  4931.       HATOMTBL APIENTRY WinDestroyAtomTable(HATOMTBL hAtomTbl);
  4932.       ATOM     APIENTRY WinAddAtom(HATOMTBL hAtomTbl,
  4933.                                    PSZ pszAtomName);
  4934.       ATOM     APIENTRY WinFindAtom(HATOMTBL hAtomTbl,
  4935.                                     PSZ pszAtomName);
  4936.       ATOM     APIENTRY WinDeleteAtom(HATOMTBL hAtomTbl,
  4937.                                       ATOM atom);
  4938.       #ifdef INCL_32
  4939.          ULONG   APIENTRY WinQueryAtomUsage(HATOMTBL hAtomTbl,
  4940.                                             ATOM atom);
  4941.          ULONG   APIENTRY WinQueryAtomLength(HATOMTBL hAtomTbl,
  4942.                                              ATOM atom);
  4943.          ULONG   APIENTRY WinQueryAtomName(HATOMTBL hAtomTbl,
  4944.                                            ATOM atom,
  4945.                                            PSZ pchBuffer,
  4946.                                            ULONG cchBufferMax);
  4947.       #else
  4948.          USHORT   APIENTRY WinQueryAtomUsage(HATOMTBL hAtomTbl,
  4949.                                              ATOM atom);
  4950.          USHORT   APIENTRY WinQueryAtomLength(HATOMTBL hAtomTbl,
  4951.                                               ATOM atom);
  4952.          USHORT   APIENTRY WinQueryAtomName(HATOMTBL hAtomTbl,
  4953.                                             ATOM atom,
  4954.                                             PSZ pchBuffer,
  4955.                                             USHORT cchBufferMax);
  4956.       #endif
  4957.  
  4958.       #define MAKEINTATOM(a)  ((PCH)MAKEULONG(a, 0xffff))
  4959.    #endif /* !INCL_SAADEFS */
  4960.  
  4961. #endif /* INCL_WINATOM */
  4962.  
  4963. #ifndef INCL_32
  4964.    /*** Catch/Throw Interface declarations *********************************/
  4965.    #ifdef INCL_WINCATCHTHROW
  4966.       #ifndef INCL_SAADEFS
  4967.          typedef struct _CATCHBUF {   /* ctchbf */
  4968.             ULONG   reserved[ 4 ];
  4969.          } CATCHBUF;
  4970.          typedef CATCHBUF FAR *PCATCHBUF;
  4971.  
  4972.          SHORT   APIENTRY    WinCatch(PCATCHBUF pcatchbuf);
  4973.  
  4974.          VOID    APIENTRY    WinThrow(PCATCHBUF pcatchbuf,
  4975.                                       SHORT nThrowBack);
  4976.       #endif /* !INCL_SAADEFS */
  4977.    #endif /* INCL_WINCATCHTHROW */
  4978. #endif /* !INCL_32 */
  4979.  
  4980. #ifdef INCL_WINERRORS
  4981.    #include <pmerr.h>
  4982.  
  4983.    /* Error codes for debugging support                                       */
  4984.    /* 0x1001 - 0x1021, 0x1034, 0x1036 - 0x1050 are reserved                   */
  4985.  
  4986.    #define WINDBG_HWND_NOT_DESTROYED           0x1022
  4987.    #define WINDBG_HPTR_NOT_DESTROYED           0x1023
  4988.    #define WINDBG_HACCEL_NOT_DESTROYED         0x1024
  4989.    #define WINDBG_HENUM_NOT_DESTROYED          0x1025
  4990.    #define WINDBG_VISRGN_SEM_BUSY              0x1026
  4991.    #define WINDBG_USER_SEM_BUSY                0x1027
  4992.    #define WINDBG_DC_CACHE_BUSY                0x1028
  4993.    #define WINDBG_HOOK_STILL_INSTALLED         0x1029
  4994.    #define WINDBG_WINDOW_STILL_LOCKED          0x102a
  4995.    #define WINDBG_UPDATEPS_ASSERTION_FAIL      0x102b
  4996.    #define WINDBG_SENDMSG_WITHIN_USER_SEM      0x102c
  4997.    #define WINDBG_USER_SEM_NOT_ENTERED         0x102d
  4998.    #define WINDBG_PROC_NOT_EXPORTED            0x102e
  4999.    #define WINDBG_BAD_SENDMSG_HWND             0x102f
  5000.    #define WINDBG_ABNORMAL_EXIT                0x1030
  5001.    #define WINDBG_INTERNAL_REVISION            0x1031
  5002.    #define WINDBG_INITSYSTEM_FAILED            0x1032
  5003.    #define WINDBG_HATOMTBL_NOT_DESTROYED       0x1033
  5004.    #define WINDBG_WINDOW_UNLOCK_WAIT           0x1035
  5005.  
  5006.    /* Get/Set Error Information Interface declarations */
  5007.  
  5008.    #ifdef INCL_32
  5009.       typedef struct _ERRINFO {  /* erri */
  5010.          ULONG   cbFixedErrInfo;
  5011.          ERRORID idError;
  5012.          ULONG   cDetailLevel;
  5013.          ULONG   offaoffszMsg;
  5014.          ULONG   offBinaryData;
  5015.       } ERRINFO;
  5016.    #else
  5017.       typedef struct _ERRINFO {  /* erri */
  5018.          USHORT  cbFixedErrInfo;
  5019.          ERRORID idError;
  5020.          USHORT  cDetailLevel;
  5021.          USHORT  offaoffszMsg;
  5022.          USHORT  offBinaryData;
  5023.       } ERRINFO;
  5024.    #endif
  5025.    typedef ERRINFO FAR *PERRINFO;
  5026.  
  5027.    ERRORID     APIENTRY    WinGetLastError(HAB hab);
  5028.    PERRINFO    APIENTRY    WinGetErrorInfo(HAB hab);
  5029.    BOOL        APIENTRY    WinFreeErrorInfo(PERRINFO perrinfo);
  5030.  
  5031. #endif  /* INCL_WINERRORS */
  5032.  
  5033. #ifndef INCL_SAADEFS
  5034.    /* include WinSetErrorInfo */
  5035.    #ifdef INCL_WINSEI
  5036.       #ifndef SEI_PMWINP
  5037.          #define SEI_PMWIN
  5038.          #include <pmsei.h>
  5039.       #endif
  5040.    #endif
  5041. #endif
  5042.  
  5043. #ifndef INCL_SAADEFS
  5044.    #ifdef  INCL_WINDDE
  5045.  
  5046.       /*
  5047.       * DDE standard system topic and item strings
  5048.       */
  5049.       #define SZDDESYS_TOPIC                  "System"
  5050.       #define SZDDESYS_ITEM_TOPICS            "Topics"
  5051.       #define SZDDESYS_ITEM_SYSITEMS          "SysItems"
  5052.       #define SZDDESYS_ITEM_RTNMSG            "ReturnMessage"
  5053.       #define SZDDESYS_ITEM_STATUS            "Status"
  5054.       #define SZDDESYS_ITEM_FORMATS           "Formats"
  5055.       #define SZDDESYS_ITEM_SECURITY          "Security"
  5056.       #define SZDDESYS_ITEM_ITEMFORMATS       "ItemFormats"
  5057.       #define SZDDESYS_ITEM_HELP              "Help"
  5058.       #define SZDDESYS_ITEM_PROTOCOLS         "Protocols"
  5059.       #define SZDDESYS_ITEM_RESTART           "Restart"
  5060.  
  5061.       /*
  5062.       * Dynamic Data Exchange (DDE) Structure Declarations
  5063.       */
  5064.       typedef struct _CONVCONTEXT {  /* cctxt */
  5065.          ULONG  cb;          /* sizeof(CONVCONTEXT) */
  5066.          ULONG fsContext;
  5067.          ULONG idCountry;
  5068.          ULONG usCodepage;
  5069.          ULONG usLangID;
  5070.          ULONG usSubLangID;
  5071.       } CONVCONTEXT;
  5072.       typedef CONVCONTEXT FAR *PCONVCONTEXT;
  5073.  
  5074.       #define DDECTXT_CASESENSITIVE    0x0001
  5075.  
  5076.       #ifdef INCL_32
  5077.          typedef struct _DDEINIT {  /* ddei */
  5078.             ULONG   cb;         /* sizeof(DDEINIT) */
  5079.             PSZ     pszAppName;
  5080.             PSZ     pszTopic;
  5081.             ULONG   offConvContext;
  5082.          } DDEINIT;
  5083.       #else
  5084.          typedef struct _DDEINIT {  /* ddei */
  5085.             USHORT  cb;         /* sizeof(DDEINIT) */
  5086.             PSZ     pszAppName;
  5087.             PSZ     pszTopic;
  5088.             USHORT  offConvContext;
  5089.          } DDEINIT;
  5090.       #endif
  5091.       typedef DDEINIT FAR *PDDEINIT;
  5092.  
  5093.       typedef struct _DDESTRUCT {  /* dde */
  5094.          ULONG   cbData;
  5095.          USHORT  fsStatus;
  5096.          USHORT  usFormat;
  5097.          USHORT  offszItemName;
  5098.          USHORT  offabData;
  5099.       } DDESTRUCT;
  5100.       typedef DDESTRUCT FAR *PDDESTRUCT;
  5101.  
  5102.       /* DDE constants for wStatus field */
  5103.       #define DDE_FACK                   0x0001
  5104.       #define DDE_FBUSY                  0x0002
  5105.       #define DDE_FNODATA                0x0004
  5106.       #define DDE_FACKREQ                0x0008
  5107.       #define DDE_FRESPONSE              0x0010
  5108.       #define DDE_NOTPROCESSED           0x0020
  5109.       #define DDE_FRESERVED              0x00C0
  5110.       #define DDE_FAPPSTATUS             0xFF00
  5111.  
  5112.       /* old DDE public formats - new ones are CF_ constants */
  5113.  
  5114.       #define DDEFMT_TEXT                0x0001
  5115.  
  5116.       /* Dynamic Data Exchange (DDE) Routines */
  5117.  
  5118.       #ifdef INCL_32
  5119.          BOOL    APIENTRY WinDdeInitiate(HWND hwndClient,
  5120.                                          PSZ pszAppName,
  5121.                                          PSZ pszTopicName,
  5122.                                          PCONVCONTEXT pcctxt);
  5123.  
  5124.          MRESULT APIENTRY WinDdeRespond(HWND hwndClient,
  5125.                                         HWND hwndServer,
  5126.                                         PSZ pszAppName,
  5127.                                         PSZ pszTopicName,
  5128.                                         PCONVCONTEXT pcctxt);
  5129.  
  5130.          BOOL    APIENTRY WinDdePostMsg(HWND hwndTo,
  5131.                                         HWND hwndFrom,
  5132.                                         ULONG wm,
  5133.                                         PDDESTRUCT pddest,
  5134.                                         ULONG flOptions);
  5135.       #else
  5136.          BOOL    APIENTRY WinDdeInitiate(HWND hwndClient,
  5137.                                          PSZ pszAppName,
  5138.                                          PSZ pszTopicName);
  5139.  
  5140.          MRESULT APIENTRY WinDdeRespond(HWND hwndClient,
  5141.                                         HWND hwndServer,
  5142.                                         PSZ pszAppName,
  5143.                                         PSZ pszTopicName);
  5144.  
  5145.          BOOL    APIENTRY WinDdePostMsg(HWND hwndTo,
  5146.                                         HWND hwndFrom,
  5147.                                         USHORT wm,
  5148.                                         PDDESTRUCT pddest,
  5149.                                         BOOL fRetry);
  5150.       #endif
  5151.  
  5152.       #define DDEPM_RETRY     0x00000001L
  5153.       #define DDEPM_NOFREE    0x00000002L
  5154.  
  5155.       /* Dynamic Data Exchange (DDE) Messages */
  5156.  
  5157.       #define WM_DDE_FIRST               0x00A0
  5158.       #define WM_DDE_INITIATE            0x00A0
  5159.       #define WM_DDE_REQUEST             0x00A1
  5160.       #define WM_DDE_ACK                 0x00A2
  5161.       #define WM_DDE_DATA                0x00A3
  5162.       #define WM_DDE_ADVISE              0x00A4
  5163.       #define WM_DDE_UNADVISE            0x00A5
  5164.       #define WM_DDE_POKE                0x00A6
  5165.       #define WM_DDE_EXECUTE             0x00A7
  5166.       #define WM_DDE_TERMINATE           0x00A8
  5167.       #define WM_DDE_INITIATEACK         0x00A9
  5168.       #define WM_DDE_LAST                0x00AF
  5169.  
  5170.       /* DDE helper macros */
  5171.  
  5172.       #define DDES_PSZITEMNAME(pddes) \
  5173.       (((PSZ)pddes) + ((PDDESTRUCT)pddes)->offszItemName)
  5174.  
  5175.       #define DDES_PABDATA(pddes)       \
  5176.       (((PBYTE)pddes) + ((PDDESTRUCT)pddes)->offabData)
  5177.  
  5178.       #define DDEI_PCONVCONTEXT(pddei)        \
  5179.       ((PCONVCONTEXT)((PBYTE)pddei + pddei->offConvContext))
  5180.  
  5181.       #ifndef INCL_32
  5182.          #define SELTOPDDES(sel)             ((PDDESTRUCT)MAKEP(sel, 0))
  5183.          #define PDDESTOSEL(pddes)           (SELECTOROF(pddes))
  5184.          #define PDDEITOSEL(pddei)           (SELECTOROF(pddei))
  5185.       #endif
  5186.  
  5187.    #endif /* INCL_WINDDE */
  5188. #endif /* !INCL_SAADEFS */
  5189.  
  5190. #ifdef INCL_WINWINDOWMGR
  5191.    #define WM_QUERYCONVERTPOS         0x00b0   /* WM_DBCSFIRST */
  5192.  
  5193.    /* Return values for WM_QUERYCONVERTPOS */
  5194.    #define QCP_CONVERT                0x0001
  5195.    #define QCP_NOCONVERT              0x0000
  5196.  
  5197. #endif  /* INCL_WINWINDOWMGR */
  5198.  
  5199. #ifdef INCL_WINHELP
  5200.    #include <pmhelp.h>
  5201. #endif /* INCL_WINHELP */
  5202.  
  5203. /*Load/Delete Library/Procedure */
  5204.  
  5205. typedef HMODULE HLIB;
  5206. typedef PHMODULE PHLIB;
  5207.  
  5208. #ifdef INCL_WINLOAD
  5209.    BOOL    APIENTRY WinDeleteProcedure(HAB hab,
  5210.                                        PFNWP wndproc);
  5211.    BOOL    APIENTRY WinDeleteLibrary(HAB hab,
  5212.                                      HLIB libhandle);
  5213.    PFNWP   APIENTRY WinLoadProcedure(HAB hab,
  5214.                                      HLIB libhandle,
  5215.                                      PSZ procname);
  5216.    HLIB    APIENTRY WinLoadLibrary(HAB hab,
  5217.                                    PSZ libname);
  5218. #endif /* INCL_WINLOAD */
  5219.  
  5220. #ifndef INCL_SAADEFS
  5221.    #ifdef INCL_WINDESKTOP
  5222.  
  5223.       /*** Desktop API definitions ***/
  5224.  
  5225.       typedef struct _DESKTOP {        /* dsk */
  5226.          ULONG    cbSize;
  5227.          HBITMAP  hbm;
  5228.          LONG     x;
  5229.          LONG     y;
  5230.          ULONG    fl;
  5231.          LONG     lTileCount;
  5232.          CHAR     szFile[260];
  5233.       } DESKTOP;
  5234.       typedef DESKTOP FAR *PDESKTOP;  /* pdsk */
  5235.  
  5236.       HBITMAP APIENTRY WinSetDesktopBkgnd(HWND hwndDesktop,
  5237.                                           PDESKTOP pdskNew);
  5238.       BOOL    APIENTRY WinQueryDesktopBkgnd(HWND hwndDesktop,
  5239.                                             PDESKTOP pdsk);
  5240.  
  5241.       #define SDT_DESTROY         0x0001L
  5242.       #define SDT_NOBKGND         0x0002L
  5243.       #define SDT_TILE            0x0004L
  5244.       #define SDT_SCALE           0x0008L
  5245.       #define SDT_PATTERN         0x0010L
  5246.       #define SDT_CENTER          0x0020L
  5247.       #define SDT_RETAIN          0x0040L
  5248.       #define SDT_LOADFILE        0x0080L
  5249.  
  5250.    #endif  /* INCL_WINDESKTOP */
  5251. #endif
  5252.  
  5253. #ifndef INCL_SAADEFS
  5254.    #ifdef INCL_WINPALETTE
  5255.  
  5256.       /*** Palette Manager API definitions ***/
  5257.  
  5258.       LONG APIENTRY WinRealizePalette(HWND hwnd,
  5259.                                       HPS hps,
  5260.                                       PULONG pcclr);
  5261.  
  5262.    #endif  /* INCL_WINPALETTE */
  5263. #endif
  5264.  
  5265. #ifdef INCL_REMAPDLL
  5266.    #define STR_DLLNAME "keyremap"
  5267. #endif /*INCL_REMAPDLL*/
  5268.  
  5269. #ifdef INCL_NLS
  5270.    #define WM_DBCSFIRST               0x00b0
  5271.    #define WM_DBCSLAST                0x00cf
  5272.  
  5273.    #include <os2nls.h>
  5274. #endif /* INCL_NLS */
  5275.  
  5276.  
  5277. /* NOINC */
  5278. #ifdef __IBMC__
  5279.    #pragma checkout( suspend )
  5280.       #ifndef __CHKHDR__
  5281.          #pragma checkout( resume )
  5282.       #endif
  5283.    #pragma checkout( resume )
  5284. #endif
  5285. /* INC */
  5286.  
  5287. /**************************** end of file **********************************/
  5288.