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