home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / PMWIN.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  152KB  |  4,086 lines

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