home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / os2tk20 / c / os2h / pmwin.h__ / PMWIN.H
Encoding:
C/C++ Source or Header  |  1992-10-05  |  147.9 KB  |  4,006 lines

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