home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / watcoapi.zip / incl16 / pmwin.h < prev   
C/C++ Source or Header  |  2002-09-30  |  6KB  |  188 lines

  1. /*
  2.     OS/2 Presentation Manager window manager include file
  3.     for 16-bit development.
  4. */
  5.  
  6.  
  7. #define INCL_WININCLUDED
  8.  
  9. #ifdef INCL_WIN
  10.     #define INCL_WINDIALOGS
  11.     #define INCL_WINDOWMGR
  12.     #define INCL_WINERRORS
  13. #endif
  14.  
  15. #define MPFROMP(p)          ((MPARAM)(VOID FAR *)(p))
  16. #define MPFROMHWND(hwnd)    ((MPARAM)(HWND)(hwnd))
  17. #define MPFROMCHAR(ch)      ((MPARAM)(USHORT)(ch))
  18. #define MPFROMSHORT(s)      ((MPARAM)(USHORT)(s))
  19. #define MPFROM2SHORT(s1, s2)((MPARAM)MAKELONG(s1, s2))
  20. #define MPFROMSH2CH(s, uch1, uch2) \
  21.     ((MPARAM)MAKELONG(s, MAKESHORT(uch1, uch2)))
  22. #define MPFROMLONG(l)       ((MPARAM)(ULONG)(l))
  23. #define PVOIDFROMMP(mp)     ((VOID FAR *)(mp))
  24. #define HWNDFROMMP(mp)      ((HWND)(mp))
  25. #define CHAR1FROMMP(mp)     ((UCHAR)(mp))
  26. #define CHAR2FROMMP(mp)     ((UCHAR)((ULONG)mp >> 8))
  27. #define CHAR3FROMMP(mp)     ((UCHAR)((ULONG)mp >> 16))
  28. #define CHAR4FROMMP(mp)     ((UCHAR)((ULONG)mp >> 24))
  29. #define SHORT1FROMMP(mp)    ((USHORT)(ULONG)(mp))
  30. #define SHORT2FROMMP(mp)    ((USHORT)((ULONG)mp >> 16))
  31. #define LONGFROMMP(mp)      ((ULONG)(mp))
  32. #define MRFROMP(p)          ((MRESULT)(VOID FAR *)(p))
  33. #define MRFROMSHORT(s)      ((MRESULT)(USHORT)(s))
  34. #define MRFROM2SHORT(s1, s2)((MRESULT)MAKELONG(s1, s2))
  35. #define MRFROMLONG(l)       ((MRESULT)(ULONG)(l))
  36. #define PVOIDFROMMR(mr)     ((VOID FAR *)(mr))
  37. #define SHORT1FROMMR(mr)    ((USHORT)((ULONG)mr))
  38. #define SHORT2FROMMR(mr)    ((USHORT)((ULONG)mr >> 16))
  39. #define LONGFROMMR(mr)      ((ULONG)(mr))
  40.  
  41. #define HWND_DESKTOP        (HWND)1
  42. #define HWND_OBJECT         (HWND)2
  43. #define HWND_TOP            (HWND)3
  44. #define HWND_BOTTOM         (HWND)4
  45. #define HWND_THREADCAPTURE  (HWND)5
  46.  
  47. #define WS_VISIBLE          0x80000000L
  48. #define WS_DISABLED         0x40000000L
  49. #define WS_CLIPCHILDREN     0x20000000L
  50. #define WS_CLIPSIBLINGS     0x10000000L
  51. #define WS_PARENTCLIP       0x08000000L
  52. #define WS_SAVEBITS         0x04000000L
  53. #define WS_SYNCPAINT        0x02000000L
  54. #define WS_MINIMIZED        0x01000000L
  55. #define WS_MAXIMIZED        0x00800000L
  56.  
  57. #define WS_GROUP            0x00010000L
  58. #define WS_TABSTOP          0x00020000L
  59. #define WS_MULTISELECT      0x00040000L
  60.  
  61. #define CS_MOVENOTIFY       0x00000001L
  62. #define CS_SIZEREDRAW       0x00000004L
  63. #define CS_HITTEST          0x00000008L
  64. #define CS_PUBLIC           0x00000010L
  65. #define CS_FRAME            0x00000020L
  66. #define CS_CLIPCHILDREN     0x20000000L
  67. #define CS_CLIPSIBLINGS     0x10000000L
  68. #define CS_PARENTCLIP       0x08000000L
  69. #define CS_SAVEBITS         0x04000000L
  70. #define CS_SYNCPAINT        0x02000000L
  71.  
  72. typedef LHANDLE HWND;
  73. typedef LHANDLE HAB;
  74.  
  75. typedef VOID FAR    *MPARAM;
  76. typedef MPARAM FAR  *PMPARAM;
  77. typedef VOID FAR    *MRESULT;
  78. typedef MRESULT FAR *PMRESULT;
  79.  
  80. typedef MRESULT (PASCAL FAR *PFNWP)(HWND, USHORT, MPARAM, MPARAM);
  81.  
  82. typedef struct _POINTL {
  83.     LONG  x;
  84.     LONG  y;
  85. } POINTL, FAR *PPOINTL;
  86.  
  87. #if (defined(INCL_WINWINDOWMGR) || !defined(INCL_NOCOMMON))
  88.  
  89. HAB  APIENTRY WinInitialize(USHORT fsOptions);
  90. BOOL APIENTRY WinTerminate(HAB hab);
  91.  
  92. #endif
  93.  
  94. #if (defined(INCL_WINMESSAGEMGR) || !defined(INCL_NOCOMMON))
  95.  
  96. typedef struct _QMSG {
  97.     HWND  hwnd;
  98.     USHORT msg;
  99.     MPARAM mp1;
  100.     MPARAM mp2;
  101.     ULONG  time;
  102.     POINTL ptl;
  103. } QMSG, FAR *PQMSG;
  104.  
  105. typedef LHANDLE     HMQ;
  106.  
  107. HMQ  APIENTRY WinCreateMsgQueue(HAB hab, SHORT sQueuesize);
  108. BOOL APIENTRY WinDestroyMsgQueue(HMQ hmq);
  109.  
  110. #endif
  111.  
  112. #if (defined(INCL_WINDIALOGS) || !defined(INCL_NOCOMMON))
  113.  
  114. #define WA_WARNING      0
  115. #define WA_NOTE         1
  116. #define WA_ERROR        2
  117. #define WA_CWINALARMS   3
  118.  
  119. #define MB_OK               0x0000
  120. #define MB_OKCANCEL         0x0001
  121. #define MB_RETRYCANCEL      0x0002
  122. #define MB_ABORTRETRYIGNORE 0x0003
  123. #define MB_YESNO            0x0004
  124. #define MB_YESNOCANCEL      0x0005
  125. #define MB_CANCEL           0x0006
  126. #define MB_ENTER            0x0007
  127. #define MB_ENTERCANCEL      0x0008
  128.  
  129. #define MB_NOICON           0x0000
  130. #define MB_CUANOTIFICATION  0x0000
  131. #define MB_ICONQUESTION     0x0010
  132. #define MB_ICONEXCLAMATION  0x0020
  133. #define MB_CUAWARNING       0x0020
  134. #define MB_ICONASTERISK     0x0030
  135. #define MB_ICONHAND         0x0040
  136. #define MB_CUACRITICAL      0x0040
  137. #define MB_QUERY            MB_ICONQUESTION
  138. #define MB_WARNING          MB_CUAWARNING
  139. #define MB_INFORMATION      MB_ICONASTERISK
  140. #define MB_CRITICAL         MB_CUACRITICAL
  141. #define MB_ERROR            MB_CRITICAL
  142.  
  143. #define MB_DEFBUTTON1       0x0000
  144. #define MB_DEFBUTTON2       0x0100
  145. #define MB_DEFBUTTON3       0x0200
  146.  
  147. #define MB_APPLMODAL        0x0000
  148. #define MB_SYSTEMMODAL      0x1000
  149. #define MB_HELP             0x2000
  150. #define MB_MOVEABLE         0x4000
  151.  
  152. #define MBID_OK             1
  153. #define MBID_CANCEL         2
  154. #define MBID_ABORT          3
  155. #define MBID_RETRY          4
  156. #define MBID_IGNORE         5
  157. #define MBID_YES            6
  158. #define MBID_NO             7
  159. #define MBID_HELP           8
  160. #define MBID_ENTER          9
  161. #define MBID_ERROR          (-1)
  162.  
  163. USHORT APIENTRY WinMessageBox(HWND hwndParent, HWND hwndOwner, PSZ pszText, PSZ pszTitle,
  164.                     USHORT usWindow, USHORT fsStyle);
  165.  
  166. #endif
  167.  
  168. #ifdef INCL_WINERRORS
  169.  
  170. #include <pmerr.h>
  171.  
  172. typedef ULONG   ERRORID;
  173. typedef ERRORID FAR *PERRORID;
  174.  
  175. typedef struct _ERRINFO {
  176.     USHORT  cbFixedErrInfo;
  177.     ERRORID idError;
  178.     USHORT  cDetailLevel;
  179.     USHORT  offaoffszMsg;
  180.     USHORT  offBinaryData;
  181. } ERRINFO, FAR *PERRINFO;
  182.  
  183. BOOL     APIENTRY WinFreeErrorInfo(PERRINFO perrinfo);
  184. PERRINFO APIENTRY WinGetErrorInfo(HAB hab);
  185. ERRORID  APIENTRY WinGetLastError(HAB hab);
  186.  
  187. #endif
  188.