source: trunk/src/user32/win32wbase.h@ 6972

Last change on this file since 6972 was 6972, checked in by phaller, 24 years ago

enabled low-level keyboard hook

File size: 21.6 KB
Line 
1/* $Id: win32wbase.h,v 1.130 2001-10-09 05:18:04 phaller Exp $ */
2/*
3 * Win32 Window Base Class for OS/2
4 *
5 *
6 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1999 Daniela Engert (dani@ngrt.de)
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13#ifndef __WIN32WNDBASE_H__
14#define __WIN32WNDBASE_H__
15
16#ifdef __cplusplus
17
18#include <win32class.h>
19#include "open32wbase.h"
20#include <gen_object.h>
21#include <win32wndchild.h>
22#include <winuser32.h>
23#include <winres.h>
24#include <scroll.h>
25
26class Win32BaseWindow;
27
28#define OFFSET_RESERVED 0 //reserved for odin apps (such as Opera)
29#define OFFSET_WIN32WNDPTR 4
30#define OFFSET_WIN32PM_MAGIC 8
31#define OFFSET_WIN32FLAGS 12
32#define NROF_WIN32WNDBYTES 16
33
34#define WINDOWFLAG_ACTIVE 1
35
36#define WIN32PM_MAGIC 0x12345678
37#define CheckMagicDword(a) (a==WIN32PM_MAGIC)
38
39#define GW_HWNDNEXTCHILD (0x10000 | GW_HWNDNEXT)
40#define GW_HWNDFIRSTCHILD (0x10000 | GW_CHILD)
41#define GW_HWNDLASTCHILD (0x10000 | GW_HWNDLAST)
42
43#ifdef DEBUG
44#define RELEASE_WNDOBJ(a) { a->release(__FUNCTION__, __LINE__); a = NULL; }
45#else
46#define RELEASE_WNDOBJ(a) { a->release(); a = NULL; }
47#endif
48
49typedef struct {
50 USHORT cb;
51 Win32BaseWindow *win32wnd;
52 ULONG win32CreateStruct; //or dialog create dword
53} CUSTOMWNDDATA;
54
55typedef struct tagPROPERTY
56{
57 struct tagPROPERTY *next; /* Next property in window list */
58 HANDLE handle; /* User's data */
59 LPSTR string; /* Property string (or atom) */
60} PROPERTY;
61
62//PostThreadMessage is done through Open32; which means the message id will be translated
63//(0xc00 added)
64#define OPEN32_MSGDIFF 0xC00
65#define WIN32APP_POSTMSG (0x1000+OPEN32_MSGDIFF)
66
67//PM doesn't allow SetFocus during WM_SETFOCUS message processing; must delay
68//this by posting a message
69//NOTE Must be smaller than WIN32APP_POSTMSG!
70#define WIN32APP_SETFOCUSMSG (WIN32APP_POSTMSG-1)
71
72#define WIN32MSG_MAGICA 0x12345678
73#define WIN32MSG_MAGICW 0x12345679
74
75typedef struct
76{
77 ULONG wParam;
78 ULONG lParam;
79} POSTMSG_PACKET;
80
81#define BROADCAST_SEND 0
82#define BROADCAST_POST 1
83
84#define HAS_DLGFRAME(style,exStyle) \
85 (((exStyle) & WS_EX_DLGMODALFRAME) || \
86 (((style) & WS_DLGFRAME) && !((style) & WS_THICKFRAME)))
87
88#define HAS_THICKFRAME(style,exStyle) \
89 (((style) & WS_THICKFRAME) && \
90 !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
91#if 0
92 (((style) & WS_THICKFRAME) && \
93 !((exStyle) & WS_EX_DLGMODALFRAME) && \
94 !((style) & WS_CHILD))
95#endif
96
97#define HAS_THINFRAME(style) \
98 (((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP)))
99
100#define HAS_BIGFRAME(style,exStyle) \
101 (((style) & (WS_THICKFRAME | WS_DLGFRAME)) || \
102 ((exStyle) & WS_EX_DLGMODALFRAME))
103
104#define HAS_ANYFRAME(style,exStyle) \
105 (((style) & (WS_THICKFRAME | WS_DLGFRAME | WS_BORDER)) || \
106 ((exStyle) & WS_EX_DLGMODALFRAME) || \
107 !((style) & (WS_CHILD | WS_POPUP)))
108
109#define HAS_3DFRAME(exStyle) \
110 ((exStyle & WS_EX_CLIENTEDGE) || (exStyle & WS_EX_STATICEDGE) || (exStyle & WS_EX_WINDOWEDGE))
111
112#define HAS_BORDER(style, exStyle) \
113 ((style & WS_BORDER) || HAS_THICKFRAME(style) || HAS_DLGFRAME(style,exStyle))
114
115#define IS_OVERLAPPED(style) \
116 !(style & (WS_CHILD | WS_POPUP))
117
118#define HAS_MENU() (!(getStyle() & WS_CHILD) && (GetMenu() != 0))
119
120#define STATE_INIT 0 //initial state
121#define STATE_PRE_WMNCCREATE 1 //before WM_NCCREATE
122#define STATE_POST_WMNCCREATE 2 //after WM_NCCREATE
123#define STATE_PRE_WMCREATE 3 //before WM_CREATE
124#define STATE_POST_WMCREATE 4 //after WM_CREATE
125#define STATE_CREATED 5 //after successful return of WinCreateWindow
126#define STATE_DESTROYED 6 //DestroyWindow called for window
127
128
129class Win32BaseWindow : public GenericObject, public ChildWindow
130{
131public:
132 Win32BaseWindow();
133 Win32BaseWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
134 Win32BaseWindow(HWND hwndOS2, ULONG reserved);
135
136virtual ~Win32BaseWindow();
137
138virtual ULONG MsgCreate(HWND hwndOS2);
139 ULONG MsgQuit();
140 ULONG MsgClose();
141 ULONG MsgDestroy();
142virtual ULONG MsgEnable(BOOL fEnable);
143 ULONG MsgShow(BOOL fShow);
144 ULONG MsgPosChanging(LPARAM lp);
145 ULONG MsgPosChanged(LPARAM lp);
146 ULONG MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win);
147 ULONG MsgChildActivate(BOOL fActivate);
148 ULONG MsgSetFocus(HWND hwnd);
149 ULONG MsgKillFocus(HWND hwnd);
150 ULONG MsgScroll(ULONG msg, ULONG scrollCode, ULONG scrollPos);
151 ULONG MsgButton(MSG *msg);
152 ULONG MsgMouseMove(MSG *msg);
153 ULONG MsgChar(MSG *msg);
154 ULONG MsgPaint(ULONG tmp1, BOOL select = TRUE);
155 ULONG MsgEraseBackGround(HDC hdc);
156 ULONG MsgNCPaint(PRECT pUpdateRect);
157 ULONG MsgFormatFrame(WINDOWPOS *lpWndPos);
158 ULONG DispatchMsgA(MSG *msg);
159 ULONG DispatchMsgW(MSG *msg);
160
161 ULONG MsgSetText(LPSTR lpsz, LONG cch);
162 ULONG MsgGetTextLength();
163 void MsgGetText(char *wndtext, ULONG textlength);
164 VOID updateWindowStyle(DWORD oldExStyle,DWORD oldStyle);
165
166virtual LONG SetWindowLongA(int index, ULONG value, BOOL fUnicode = FALSE);
167virtual ULONG GetWindowLongA(int index, BOOL fUnicode = FALSE);
168virtual WORD SetWindowWord(int index, WORD value);
169virtual WORD GetWindowWord(int index);
170
171 DWORD getStyle() { return dwStyle; };
172 DWORD getOldStyle() { return dwOldStyle; };
173 void setStyle(DWORD newstyle) { dwStyle = newstyle; };
174 DWORD getExStyle() { return dwExStyle; };
175 void setExStyle(DWORD newexstyle) { dwExStyle = newexstyle; };
176 ULONG getInstance() { return hInstance; };
177 void setInstance(ULONG newinstance) { hInstance = newinstance; };
178 HWND getWindowHandle() { return Win32Hwnd; };
179 HWND getOS2WindowHandle() { return OS2Hwnd; };
180 HWND getOS2FrameWindowHandle() { return OS2HwndFrame; };
181 HWND getLastActive() { return hwndLastActive; };
182 void setLastActive(HWND _hwndLastActive)
183 { hwndLastActive = _hwndLastActive; };
184
185 Win32WndClass *getWindowClass() { return windowClass; };
186
187 LONG getLastHitTestVal() { return lastHitTestVal; }
188
189 DWORD getWindowContextHelpId() { return contextHelpId; };
190 void setWindowContextHelpId(DWORD id){ contextHelpId = id; };
191
192 BOOL isFrameWindow();
193virtual BOOL isMDIClient();
194virtual BOOL isMDIChild();
195virtual BOOL isDesktopWindow();
196
197 BOOL fHasParentDC() { return fParentDC; };
198
199Win32BaseWindow *getParent();
200 void setParent(Win32BaseWindow *pwindow) { setParentOfChild((ChildWindow *)pwindow); };
201 WNDPROC getWindowProc() { return win32wndproc; };
202 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; };
203 DWORD getWindowId() { return dwIDMenu; };
204 void setWindowId(DWORD id);
205 ULONG getWindowHeight() { return rectWindow.bottom - rectWindow.top; };
206 ULONG getWindowWidth() { return rectWindow.right - rectWindow.left; };
207 ULONG getClientHeight() { return rectClient.bottom - rectClient.top; };
208 ULONG getClientWidth() { return rectClient.right - rectClient.left; };
209 BOOL isChild();
210 PRECT getClientRectPtr() { return &rectClient; };
211 void getClientRect(PRECT rect)
212 {
213 *rect = rectClient;
214 rect->right -= rect->left;
215 rect->bottom -= rect->top;
216 rect->left = rect->top = 0;
217 }
218 void setClientRect(PRECT rect) { rectClient = *rect; };
219 PRECT getWindowRect() { return &rectWindow; };
220 void setClientRect(LONG left, LONG top, LONG right, LONG bottom)
221 {
222 rectClient.left = left; rectClient.top = top;
223 rectClient.right = right; rectClient.bottom = bottom;
224 };
225 void setWindowRect(LONG left, LONG top, LONG right, LONG bottom)
226 {
227 rectWindow.left = left; rectWindow.top = top;
228 rectWindow.right = right; rectWindow.bottom = bottom;
229 };
230 void setWindowRect(PRECT rect) { rectWindow = *rect; };
231 DWORD getFlags() { return flags; };
232 void setFlags(DWORD newflags) { flags = newflags; };
233
234 DWORD getCBExtra() { return cbExtra; };
235 PVOID getExtraPtr() { return pExtra; };
236
237 HMENU GetMenu() { return dwIDMenu; };
238 VOID SetMenu(HMENU newMenu) { dwIDMenu = newMenu; };
239 void SetSysMenu(HMENU hSystemMenu) { hSysMenu = hSystemMenu; };
240 HMENU GetSysMenu() { return hSysMenu; }
241
242 HICON IconForWindow(WPARAM fType);
243
244 void SetWindowRegion(HRGN hRegion) { hWindowRegion = hRegion; };
245 HRGN GetWindowRegion() { return hWindowRegion; };
246
247 //Save old clip region for CS_OWNDC windows (in BeginPaint)
248 HRGN GetClipRegion() { return hClipRegion; };
249 void SetClipRegion(HRGN hRegion) { hClipRegion = hRegion; };
250
251 BOOL ShowWindow(ULONG nCmdShow);
252 BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);
253 BOOL SetWindowPlacement(WINDOWPLACEMENT *winpos);
254 BOOL GetWindowPlacement(LPWINDOWPLACEMENT winpos);
255 BOOL ScrollWindow(int dx, int dy);
256virtual BOOL DestroyWindow();
257 HWND SetActiveWindow();
258 BOOL DeactivateChildWindow();
259 HWND GetParent();
260 HWND SetParent(HWND hwndNewParent);
261
262 BOOL IsChild(HWND hwndParent);
263
264 HWND GetTopWindow();
265 HWND GetTopParent();
266
267 HWND GetWindow(UINT uCmd);
268 virtual BOOL EnableWindow(BOOL fEnable);
269 BOOL CloseWindow();
270 static HWND GetActiveWindow();
271 //Window handle has already been verified, so just return true
272 BOOL IsWindow() { return TRUE; };
273 BOOL IsDialog() { return fIsDialog; };
274 BOOL IsModalDialog() { return fIsModalDialog; };
275 BOOL IsModalDialogOwner() { return fIsModalDialogOwner; };
276 VOID setModalDialogOwner(BOOL fMDO) { fIsModalDialogOwner = fMDO; };
277 VOID setOS2HwndModalDialog(HWND aHwnd) { OS2HwndModalDialog = aHwnd; };
278 HWND getOS2HwndModalDialog() { return OS2HwndModalDialog; };
279 BOOL CanReceiveSizeMsgs() { return state >= STATE_PRE_WMCREATE; };
280 BOOL IsParentChanging() { return fParentChange; };
281 BOOL IsWindowCreated() { return state >= STATE_PRE_WMNCCREATE; }
282 BOOL IsWindowDestroyed() { return state >= STATE_DESTROYED; };
283 BOOL IsWindowIconic();
284 //Window procedure type
285 BOOL IsWindowUnicode();
286 BOOL IsMixMaxStateChanging() { return fMinMaxChange; };
287
288 void SetVisibleRegionChanged(BOOL changed) { fVisibleRegionChanged = changed; };
289 BOOL IsVisibleRegionChanged() { return fVisibleRegionChanged; };
290 BOOL setVisibleRgnNotifyProc(VISRGN_NOTIFY_PROC lpNotifyProc, DWORD dwUserData)
291 {
292 lpVisRgnNotifyProc = lpNotifyProc;
293 dwVisRgnNotifyParam = dwUserData;
294 return TRUE;
295 }
296 void callVisibleRgnNotifyProc(BOOL fDrawingAllowed)
297 {
298 if(lpVisRgnNotifyProc) {
299 lpVisRgnNotifyProc(getWindowHandle(), fDrawingAllowed, dwVisRgnNotifyParam);
300 }
301 }
302 int GetWindowTextLength(BOOL fUnicode);
303 int GetWindowTextLengthA() { return GetWindowTextLength(FALSE); };
304 int GetWindowTextLengthW() { return GetWindowTextLength(TRUE); };
305
306 int GetWindowTextA(LPSTR lpsz, int cch);
307 int GetWindowTextW(LPWSTR lpsz, int cch);
308 BOOL SetWindowTextA(LPSTR lpsz);
309 BOOL SetWindowTextW(LPWSTR lpsz);
310 BOOL hasWindowName(LPSTR wndname, BOOL fUnicode = 0);
311 CHAR *getWindowNamePtrA();
312 WCHAR *getWindowNamePtrW();
313 VOID freeWindowNamePtr(PVOID namePtr);
314 CHAR *getWindowNameA() { return windowNameA; }; //only for MDI windows!
315 WCHAR *getWindowNameW() { return windowNameW; }; //only for MDI windows!
316Win32WndClass *getClass() { return windowClass; };
317Win32BaseWindow *getOwner() { return owner; };
318 void setOwner(Win32BaseWindow *newOwner) { owner = newOwner; };
319
320 SCROLLBAR_INFO *getScrollInfo(int nBar);
321
322 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
323 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
324static LRESULT BroadcastMessageA(int type, UINT msg, WPARAM wParam, LPARAM lParam);
325static LRESULT BroadcastMessageW(int type, UINT msg, WPARAM wParam, LPARAM lParam);
326 void CallWindowHookProc(ULONG hooktype, ULONG Msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode = FALSE);
327
328 LRESULT DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam);
329 LRESULT DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam);
330
331 LRESULT DefWndControlColor(UINT ctlType, HDC hdc);
332 LRESULT DefWndPrint(HDC hdc,ULONG uFlags);
333
334 void NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);
335
336 HWND FindWindowById(int id);
337
338 static HWND FindWindowEx(HWND hwndParent, HWND hwndChildAfter, ATOM atom, LPSTR lpszWindow);
339
340 BOOL EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam);
341 BOOL EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam);
342 BOOL EnumWindows(WNDENUMPROC lpfn, LPARAM lParam);
343
344
345 BOOL isComingToTop() { return fComingToTop; };
346 void setComingToTop(BOOL fTop) { fComingToTop = fTop; };
347 BOOL isInTasklist() { return fTaskList; };
348
349 //window property methods
350 HANDLE getProp(LPCSTR str);
351 BOOL setProp(LPCSTR str, HANDLE handle);
352 HANDLE removeProp(LPCSTR str);
353 INT enumPropsExA(PROPENUMPROCEXA func, LPARAM lParam);
354 INT enumPropsExW(PROPENUMPROCEXW func, LPARAM lParam);
355
356#ifdef DEBUG
357 LONG addRef();
358 LONG release(char *function = __FUNCTION__, int line = __LINE__ );
359#endif
360
361//Locates window in linked list and increases reference count (if found)
362//Window object must be unreferenced after usage
363static Win32BaseWindow *GetWindowFromHandle(HWND hwnd);
364static Win32BaseWindow *GetWindowFromOS2Handle(HWND hwnd);
365static Win32BaseWindow *GetWindowFromOS2FrameHandle(HWND hwnd);
366
367 static void DestroyAll();
368
369protected:
370#ifndef OS2_INCLUDED
371 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
372#endif
373 LRESULT SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
374 LRESULT SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
375 void Init();
376
377 void NotifyFrameChanged(WINDOWPOS *wpos, RECT *oldClientRect);
378
379 //called in destructor to remove all (if any) window properties
380 void removeWindowProps();
381 PROPERTY *findWindowProperty(LPCSTR str);
382
383 HWND OS2Hwnd, OS2HwndFrame;
384 HMENU hSysMenu;
385 HWND Win32Hwnd;
386
387 int posx, posy, width, height;
388
389 // values normally contained in the standard window words
390 ULONG dwExStyle; //GWL_EXSTYLE
391 ULONG dwStyle; //GWL_STYLE
392 ULONG dwOldStyle; //Used to determine which frame control buttons to change (OS/2 mode)
393 WNDPROC win32wndproc; //GWL_WNDPROC
394 ULONG hInstance; //GWL_HINSTANCE
395//Moved in ChildWindow class
396///// Win32BaseWindow *parent; //GWL_HWNDPARENT
397 ULONG dwIDMenu; //GWL_ID
398 ULONG userData; //GWL_USERDATA
399 HWND hwndLastActive; // last active popup handle
400
401 ULONG cbExtra;
402 PVOID pExtra;
403
404 HWND hwndLinkAfter;
405 DWORD flags;
406 DWORD contextHelpId;
407 DWORD hotkey;
408 LONG lastHitTestVal; //Last value returned by WM_NCHITTEST handler
409
410 HWND OS2HwndModalDialog;
411
412 ULONG fFirstShow:1,
413 fIsDialog:1,
414 fIsModalDialog:1,
415 fIsModalDialogOwner:1,
416 fInternalMsg:1, //Used to distinguish between messages
417 //sent by PM and those sent by apps
418 fParentChange:1,
419 fDestroyWindowCalled:1, //DestroyWindow was called for this window
420 fTaskList:1, //should be listed in PM tasklist or not
421 fXDefault:1,
422 fCXDefault:1,
423 fParentDC:1,
424 fComingToTop:1,
425 isUnicode:1,
426 fMinMaxChange:1, //set when switching between min/max/restored state
427 fVisibleRegionChanged:1, //set when visible region has changed -> erase background must be sent during next BeginPaint
428 fEraseBkgndFlag:1;
429
430 ULONG state;
431 HRGN hWindowRegion;
432 HRGN hClipRegion;
433
434 DWORD dwThreadId; //id of thread that created this window
435 DWORD dwProcessId; //id of process that created this window
436
437 Win32BaseWindow *owner;
438 HICON hIcon,hIconSm;
439
440 char *windowNameA;
441 WCHAR *windowNameW;
442
443 char *userWindowBytes;
444 ULONG nrUserWindowBytes;
445
446 RECT rectWindow; //relative to parent
447 RECT rectClient; //relative to frame
448WINDOWPLACEMENT windowpos;
449
450 PROPERTY *propertyList;
451
452VISRGN_NOTIFY_PROC lpVisRgnNotifyProc;
453 DWORD dwVisRgnNotifyParam;
454
455 HANDLE hTaskList; //PM specific (switchentry handle)
456
457CREATESTRUCTA *tmpcs; //temporary pointer to CREATESTRUCT used in CreateWindowEx
458 ULONG sw; //set in CreateWindowExA, used in MsgCreate method
459
460SCROLLBAR_INFO *vertScrollInfo;
461SCROLLBAR_INFO *horzScrollInfo;
462
463Win32WndClass *windowClass;
464
465static GenericObject *windows;
466static CRITICAL_SECTION critsect;
467
468private:
469#ifndef OS2_INCLUDED
470 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
471 UINT MinMaximize(UINT cmd, LPRECT lpRect);
472 LONG HandleWindowPosChanging(WINDOWPOS *winpos);
473 LONG HandleNCActivate(WPARAM wParam);
474 VOID TrackMinMaxHelpBox(WORD wParam);
475 VOID TrackCloseButton(WORD wParam);
476 VOID TrackScrollBar(WPARAM wParam,POINT pt);
477 LONG HandleNCLButtonDown(WPARAM wParam,LPARAM lParam);
478 LONG HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam);
479 LONG HandleNCRButtonUp(WPARAM wParam,LPARAM lParam);
480 VOID AdjustRectOuter(LPRECT rect,BOOL menu);
481 VOID AdjustRectInner(LPRECT rect);
482 LONG HandleNCCalcSize(BOOL calcValidRects,RECT *winRect);
483 VOID DrawFrame(HDC hdc,RECT *rect,BOOL dlgFrame,BOOL active);
484public:
485 VOID GetInsideRect(RECT *rect);
486 LONG HandleNCHitTest(POINT pt);
487 BOOL GetSysPopupPos(RECT* rect);
488private:
489 BOOL DrawSysButton(HDC hdc,RECT *rect);
490 BOOL DrawGrayButton(HDC hdc,int x,int y);
491 VOID DrawCloseButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
492 VOID DrawMaxButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
493 VOID DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
494 VOID DrawContextHelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
495 VOID DrawCaption(HDC hdc,RECT *rect,BOOL active);
496 VOID DoNCPaint(HRGN clip,BOOL suppress_menupaint);
497 LONG HandleNCPaint(HRGN clip);
498 LONG HandleSysCommand(WPARAM wParam, POINT *pt32);
499
500 LONG SendNCCalcSize(BOOL calcValidRect,
501 RECT *newWindowRect, RECT *oldWindowRect,
502 RECT *oldClientRect, WINDOWPOS *winpos,
503 RECT *newClientRect );
504
505#else
506friend BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fTranslateExtraMsgs);
507#endif
508
509public:
510 void SetFakeOpen32() { WinSetDAXData (OS2Hwnd, &fakeWinBase); }
511 void RemoveFakeOpen32() { WinSetDAXData (OS2Hwnd, NULL); }
512
513 fakeOpen32WinBaseClass fakeWinBase;
514
515 VOID AdjustMaximizedRect(LPRECT rect);
516 VOID AdjustTrackInfo(PPOINT minTrackSize,PPOINT maxTrackSize);
517
518 //Temporary hack for CS_CLASSDC style (do the same as for CS_OWNDC)
519#ifndef OS2_INCLUDED
520 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC|CS_CLASSDC)); }
521#else
522 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC_W|CS_CLASSDC_W)); }
523#endif
524
525 HDC getOwnDC() { return ownDC; }
526 void setOwnDC(HDC hdc) { ownDC = hdc; }
527protected:
528 HDC ownDC;
529
530public:
531 VOID setEraseBkgnd (BOOL erase) { fEraseBkgndFlag = erase; }
532 BOOL needsEraseBkgnd() { return fEraseBkgndFlag; }
533};
534
535#endif //__cplusplus
536
537#endif //__WIN32WNDBASE_H__
Note: See TracBrowser for help on using the repository browser.