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