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