1 // ResizableMsgSupport.h: some declarations to support custom resizable wnds
3 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (C) 2000-2002 by Paolo Messina
6 // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
8 // The contents of this file are subject to the Artistic License (the "License").
9 // You may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at:
11 // http://www.opensource.org/licenses/artistic-license.html
13 // If you find this code useful, credits would be nice!
15 /////////////////////////////////////////////////////////////////////////////
17 #if !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)
18 #define AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_
22 #endif // _MSC_VER > 1000
24 typedef struct tagRESIZEPROPERTIES
26 // wether to ask for resizing properties every time
29 // otherwise, use the cached properties
30 BOOL bCachedLikesClipping
;
31 BOOL bCachedNeedsRefresh
;
33 // initialize with valid data
34 tagRESIZEPROPERTIES() : bAskClipping(TRUE
), bAskRefresh(TRUE
), bCachedLikesClipping(FALSE
), bCachedNeedsRefresh(TRUE
) {}
36 } RESIZEPROPERTIES
, *PRESIZEPROPERTIES
, *LPRESIZEPROPERTIES
;
39 typedef struct tagCLIPPINGPROPERTY
41 BOOL bLikesClipping
= FALSE
;
42 } CLIPPINGPROPERTY
, *PCLIPPINGPROPERTY
, *LPCLIPPINGPROPERTY
;
45 typedef struct tagREFRESHPROPERTY
47 BOOL bNeedsRefresh
= TRUE
;
50 } REFRESHPROPERTY
, *PREFRESHPROPERTY
, *LPREFRESHPROPERTY
;
53 // registered message to communicate with the library
54 extern const UINT WMU_RESIZESUPPORT
;
56 // if the message is implemented the returned value must be non-zero
57 // the default window procedure returns zero for unhandled messages
59 // wParam is one of the following RSZSUP_* values, lParam as specified
62 RSZSUP_QUERYPROPERTIES
= 101, // lParam = LPRESIZEPROPERTIES
63 RSZSUP_LIKESCLIPPING
= 102, // lParam = LPCLIPPINGPROPERTY
64 RSZSUP_NEEDSREFRESH
= 103, // lParam = LPREFRESHPROPERTY
65 RSZSUP_SHEETPAGEEXHACK
= 104, // lParam = HWND (source prop.page)
68 /////////////////////////////////////////////////////////////////////////////
71 inline BOOL
Send_QueryProperties(HWND hWnd
, LPRESIZEPROPERTIES pResizeProperties
)
73 return (0 != SendMessage(hWnd
, WMU_RESIZESUPPORT
,
74 RSZSUP_QUERYPROPERTIES
, (LPARAM
)pResizeProperties
));
77 inline BOOL
Send_LikesClipping(HWND hWnd
, LPCLIPPINGPROPERTY pClippingProperty
)
79 return (0 != SendMessage(hWnd
, WMU_RESIZESUPPORT
,
80 RSZSUP_LIKESCLIPPING
, (LPARAM
)pClippingProperty
));
83 inline BOOL
Send_NeedsRefresh(HWND hWnd
, LPREFRESHPROPERTY pRefreshProperty
)
85 return (0 != SendMessage(hWnd
, WMU_RESIZESUPPORT
,
86 RSZSUP_NEEDSREFRESH
, (LPARAM
)pRefreshProperty
));
89 inline void Post_SheetPageExHack(HWND hWndSheet
, HWND hWndPage
)
91 PostMessage(hWndSheet
, WMU_RESIZESUPPORT
,
92 RSZSUP_SHEETPAGEEXHACK
, (LPARAM
)hWndPage
);
95 #endif // !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)