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

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