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

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

optimized set/get window text, heap pressure reduced

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