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