home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osp1.exe / include / os2 / pmwin.h < prev    next >
C/C++ Source or Header  |  1997-04-02  |  176KB  |  4,630 lines

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