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

Last change on this file since 9101 was 9101, checked in by sandervl, 23 years ago

Ugly hack added to work around crash in PM when child window calls DestroyWindow for parent or owner in WM_DESTROY handler (solution: postpone DestroyWindow for parent/owner)

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