microwin.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /*
  2. /////////////////////////////////////////////////////////////////////////////
  3. // Name: wx/msw/microwin.h
  4. // Purpose: Extra implementation for MicroWindows
  5. // Author: Julian Smart
  6. // Created: 2001-05-31
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. */
  11. #ifndef _WX_MICROWIN_H_
  12. #define _WX_MICROWIN_H_
  13. /* Implemented by microwin.cpp */
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. BOOL SetCursorPos(int x, int y);
  18. HCURSOR SetCursor(HCURSOR hCursor);
  19. /* Implemented with wrong number of args by MicroWindows */
  20. /* so we need to use a different name */
  21. int GetScrollPosWX (HWND hWnd, int iSBar);
  22. BOOL ScrollWindow(HWND, int xAmount, int yAmount,
  23. CONST RECT* lpRect, CONST RECT* lpClipRect);
  24. HWND WindowFromPoint(POINT pt);
  25. SHORT GetKeyState(int nVirtKey);
  26. HWND SetParent(HWND hWndChild, HWND hWndNewParent);
  27. VOID DragAcceptFiles(HWND, BOOL);
  28. BOOL IsDialogMessage(HWND hWnd, MSG* msg);
  29. DWORD GetMessagePos(VOID);
  30. BOOL IsIconic(HWND hWnd);
  31. int SetMapMode(HDC hDC, int mode);
  32. int GetMapMode(HDC hDC);
  33. HCURSOR LoadCursor(HINSTANCE hInst, int cursor);
  34. DWORD GetModuleFileName(HINSTANCE hInst, LPSTR name, DWORD sz);
  35. VOID DestroyIcon(HICON hIcon);
  36. COLORREF GetTextColor(HDC hdc);
  37. COLORREF GetBkColor(HDC hdc);
  38. HPALETTE SelectPalette(HDC hdc, HPALETTE hPalette, BOOL b);
  39. BOOL IntersectClipRect(HDC hdc, int x, int y,
  40. int w, int h);
  41. BOOL GetClipBox(HDC hdc, RECT* rect);
  42. BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
  43. BOOL SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
  44. BOOL SetViewportOrgEx(HDC hdc, int x, int y, LPPOINT lpPoint);
  45. BOOL SetWindowExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
  46. BOOL SetWindowOrgEx(HDC hdc, int x, int y, LPPOINT lpSize);
  47. BOOL ExtFloodFill(HDC hdc, int x, int y, COLORREF col, UINT flags);
  48. int SetPolyFillMode(HDC hdc, int mode);
  49. BOOL RoundRect(HDC hdc, int left, int top, int right, int bottom, int r1, int r2);
  50. BOOL MaskBlt(HDC hdc, int x, int y, int w, int h,
  51. HDC hDCSource, int xSrc, int ySrc, HBITMAP hBitmapMask, int xMask, int yMask, DWORD rop);
  52. UINT RealizePalette(HDC hDC);
  53. BOOL SetBrushOrgEx(HDC hdc, int xOrigin, int yOrigin, LPPOINT lpPoint);
  54. int GetObject(HGDIOBJ hObj, int sz, LPVOID logObj);
  55. /* For some reason these aren't defined in the headers */
  56. BOOL EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable) ;
  57. BOOL GetScrollPos (HWND hWnd, int iSBar, int* pPos);
  58. BOOL GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos);
  59. BOOL SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
  60. BOOL SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos);
  61. BOOL SetScrollInfo (HWND hWnd, int iSBar,
  62. LPCSCROLLINFO lpsi, BOOL fRedraw);
  63. BOOL GetScrollInfo(HWND hWnd, int iSBar, LPSCROLLINFO lpsi);
  64. BOOL ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
  65. HBITMAP WINAPI
  66. CreateBitmap( int width, int height, int nPlanes, int bPP, LPCVOID lpData);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. /*
  71. * Key State Masks for Mouse Messages
  72. */
  73. #ifndef MK_LBUTTON
  74. #define MK_LBUTTON 0x0001
  75. #define MK_RBUTTON 0x0002
  76. #define MK_SHIFT 0x0004
  77. #define MK_CONTROL 0x0008
  78. #define MK_MBUTTON 0x0010
  79. #endif
  80. /*
  81. * DrawIcon flags
  82. */
  83. #ifndef DI_MASK
  84. #define DI_MASK 0x0001
  85. #define DI_IMAGE 0x0002
  86. #define DI_NORMAL 0x0003
  87. #define DI_COMPAT 0x0004
  88. #define DI_DEFAULTSIZE 0x0008
  89. #endif
  90. /* TODO: May have to fake these message */
  91. #ifndef WM_INITDIALOG
  92. #define WM_INITDIALOG 0x0110
  93. #endif
  94. #ifndef WM_QUERYENDSESSION
  95. #define WM_QUERYENDSESSION 0x0011
  96. #endif
  97. #ifndef WM_ENDSESSION
  98. #define WM_ENDSESSION 0x0016
  99. #endif
  100. #ifndef WM_SETCURSOR
  101. #define WM_SETCURSOR 0x0020
  102. #endif
  103. #ifndef WM_GETMINMAXINFO
  104. #define WM_GETMINMAXINFO 0x0024
  105. typedef struct tagMINMAXINFO {
  106. POINT ptReserved;
  107. POINT ptMaxSize;
  108. POINT ptMaxPosition;
  109. POINT ptMinTrackSize;
  110. POINT ptMaxTrackSize;
  111. } MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
  112. #endif
  113. #ifndef WM_SYSCOMMAND
  114. #define WM_SYSCOMMAND 0x0112
  115. #endif
  116. #ifndef WM_SYSCOLORCHANGE
  117. #define WM_SYSCOLORCHANGE 0x0015
  118. #endif
  119. #ifndef WM_QUERYNEWPALETTE
  120. #define WM_QUERYNEWPALETTE 0x030F
  121. #endif
  122. #ifndef WM_PALETTEISCHANGING
  123. #define WM_PALETTEISCHANGING 0x0310
  124. #endif
  125. #ifndef WM_PALETTECHANGED
  126. #define WM_PALETTECHANGED 0x0311
  127. #endif
  128. #ifndef WM_NOTIFY
  129. #define WM_NOTIFY 0x004E
  130. #endif
  131. #ifndef WM_DROPFILES
  132. #define WM_DROPFILES 0x0233
  133. #endif
  134. #ifndef PALETTERGB
  135. #define PALETTERGB RGB
  136. #endif
  137. #ifndef MM_TEXT
  138. #define MM_TEXT 1
  139. #define MM_LOMETRIC 2
  140. #define MM_HIMETRIC 3
  141. #define MM_LOENGLISH 4
  142. #define MM_HIENGLISH 5
  143. #define MM_TWIPS 6
  144. #define MM_ISOTROPIC 7
  145. #define MM_ANISOTROPIC 8
  146. #endif
  147. #ifndef SC_MAXIMIZE
  148. #define SC_MINIMIZE 0xF020
  149. #define SC_MAXIMIZE 0xF030
  150. #endif
  151. // TODO: all of them
  152. #ifndef IDC_ARROW
  153. #define IDC_ARROW 1
  154. #endif
  155. /*
  156. * Standard Cursor IDs
  157. */
  158. #ifndef MAKEINTRESOURCE
  159. #define MAKEINTRESOURCE(r) r
  160. #endif
  161. #ifndef IDC_ARROW
  162. #define IDC_ARROW MAKEINTRESOURCE(32512)
  163. #define IDC_IBEAM MAKEINTRESOURCE(32513)
  164. #define IDC_WAIT MAKEINTRESOURCE(32514)
  165. #define IDC_CROSS MAKEINTRESOURCE(32515)
  166. #define IDC_UPARROW MAKEINTRESOURCE(32516)
  167. #define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
  168. #define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
  169. #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
  170. #define IDC_SIZENESW MAKEINTRESOURCE(32643)
  171. #define IDC_SIZEWE MAKEINTRESOURCE(32644)
  172. #define IDC_SIZENS MAKEINTRESOURCE(32645)
  173. #define IDC_SIZEALL MAKEINTRESOURCE(32646)
  174. #define IDC_NO MAKEINTRESOURCE(32648) /* not in win3.1 */
  175. #if(WINVER >= 0x0500)
  176. #define IDC_HAND MAKEINTRESOURCE(32649)
  177. #endif /* WINVER >= 0x0500 */
  178. #define IDC_APPSTARTING MAKEINTRESOURCE(32650) /* not in win3.1 */
  179. #if(WINVER >= 0x0400)
  180. #define IDC_HELP MAKEINTRESOURCE(32651)
  181. #endif /* WINVER >= 0x0400 */
  182. #endif
  183. /* ExtFloodFill style flags */
  184. #define FLOODFILLBORDER 0
  185. #define FLOODFILLSURFACE 1
  186. /* PolyFill() Modes */
  187. #define ALTERNATE 1
  188. #define WINDING 2
  189. #define POLYFILL_LAST 2
  190. /* Quaternary raster codes */
  191. #define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
  192. /* Device Parameters for GetDeviceCaps() */
  193. #define DRIVERVERSION 0 /* Device driver version */
  194. #define TECHNOLOGY 2 /* Device classification */
  195. #define HORZSIZE 4 /* Horizontal size in millimeters */
  196. #define VERTSIZE 6 /* Vertical size in millimeters */
  197. /* Ternary raster operations */
  198. /* Now defined by MicroWindows */
  199. #if 0
  200. #define DSTINVERT (DWORD)0x00550009 /* dest = (NOT dest) */
  201. #define WHITENESS (DWORD)0x00FF0062 /* dest = WHITE */
  202. #define SRCERASE (DWORD)0x00440328 /* dest = source AND (NOT dest ) */
  203. #define MERGEPAINT (DWORD)0x00BB0226 /* dest = (NOT source) OR dest */
  204. #define SRCPAINT (DWORD)0x00EE0086 /* dest = source OR dest */
  205. #define NOTSRCCOPY (DWORD)0x00330008 /* dest = (NOT source) */
  206. #endif
  207. #endif /* _WX_MICROWIN_H_ */