Skip to content

Commit

Permalink
initial support for custom windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ppescher committed Oct 13, 2002
1 parent 310b12b commit 19c841f
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ResizableLib/ResizableLib.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions ResizableLib/ResizableMsgSupport.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// ResizableMsgSupport.h: some declarations to support custom resizable wnds
//
/////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000-2002 by Paolo Messina
// (http://www.geocities.com/ppescher - [email protected])
//
// The contents of this file are subject to the Artistic License (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.opensource.org/licenses/artistic-license.html
//
// If you find this code useful, credits would be nice!
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)
#define AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

typedef struct tagRESIZEPROPERTIES
{
// wether to ask for resizing properties every time
BOOL bAskClipping;
BOOL bAskRefresh;
// otherwise, use the cached properties
BOOL bCachedLikesClipping;
BOOL bCachedNeedsRefresh;

// initialize with valid data
tagRESIZEPROPERTIES() : bAskClipping(TRUE), bAskRefresh(TRUE) {}

} RESIZEPROPERTIES, *PRESIZEPROPERTIES, *LPRESIZEPROPERTIES;


typedef struct tagCLIPPINGPROPERTY
{
BOOL bLikesClipping;

// initialize with valid data
tagCLIPPINGPROPERTY() : bLikesClipping(FALSE) {}

} CLIPPINGPROPERTY, *PCLIPPINGPROPERTY, *LPCLIPPINGPROPERTY;


typedef struct tagREFRESHPROPERTY
{
BOOL bNeedsRefresh;
RECT rcOld;
RECT rcNew;

// initialize with valid data
tagREFRESHPROPERTY() : bNeedsRefresh(TRUE) {}

} REFRESHPROPERTY, *PREFRESHPROPERTY, *LPREFRESHPROPERTY;


#endif // !defined(AFX_RESIZABLEMSGSUPPORT_H__INCLUDED_)
56 changes: 56 additions & 0 deletions ResizableLib/ResizableMsgSupport.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// ResizableMsgSupport.inl: some definitions to support custom resizable wnds
//
/////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000-2002 by Paolo Messina
// (http://www.geocities.com/ppescher - [email protected])
//
// The contents of this file are subject to the Artistic License (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.opensource.org/licenses/artistic-license.html
//
// If you find this code useful, credits would be nice!
//
/////////////////////////////////////////////////////////////////////////////


// registered message to communicate with the library
// (defined so that in the same executable it is initialized only once)
const UINT WMU_RESIZESUPPORT = ::RegisterWindowMessage(_T("WMU_RESIZESUPPORT"));

// if the message is implemented the returned value must be non-zero
// the default window procedure returns zero for unhandled messages

// wParam is one of the following RSZSUP_* values, lParam as specified

#define RSZSUP_QUERYPROPERTIES 101 // lParam = LPRESIZEPROPERTIES

#define RSZSUP_LIKESCLIPPING 102 // lParam = LPCLIPPINGPROPERTY

#define RSZSUP_NEEDSREFRESH 103 // lParam = LPREFRESHPROPERTY


/////////////////////////////////////////////////////////////////////////////
// utility functions

inline BOOL Send_QueryProperties(HWND hWnd, LPRESIZEPROPERTIES pResizeProperties)
{
ASSERT(::IsWindow(hWnd));
return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
RSZSUP_QUERYPROPERTIES, (LPARAM)pResizeProperties));
}

inline BOOL Send_LikesClipping(HWND hWnd, LPCLIPPINGPROPERTY pClippingProperty)
{
ASSERT(::IsWindow(hWnd));
return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
RSZSUP_LIKESCLIPPING, (LPARAM)pClippingProperty));
}

inline BOOL Send_NeedsRefresh(HWND hWnd, LPREFRESHPROPERTY pRefreshProperty)
{
ASSERT(::IsWindow(hWnd));
return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
RSZSUP_NEEDSREFRESH, (LPARAM)pRefreshProperty));
}

0 comments on commit 19c841f

Please sign in to comment.