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