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

Last change on this file since 9933 was 9933, checked in by sandervl, 22 years ago

Changes for applications that don't validate the update region of a window during WM_PAINT

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