Click here to Skip to main content
15,892,643 members
Articles / Desktop Programming / MFC

WWhizInterface: Enhancements to the Visual C++ Automation Interface

Rate me:
Please Sign up or sign in to vote.
4.50/5 (5 votes)
28 Jul 2001 149.9K   2.6K   47  
A C++ interface with a number of Visual C++ automation enhancements, allowing for more robust add-in programming.
#if !defined(AFX_CDXCSIZEICONCTRL_H__9B4AD1C3_8AA5_11D2_BE9C_000000000000__INCLUDED_)
#define AFX_CDXCSIZEICONCTRL_H__9B4AD1C3_8AA5_11D2_BE9C_000000000000__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// cdxCSizeIconCtrl.h : header file
//

//
// cdxCSizeIconCtrl.h : header file
// -----------------------------------------------------------------------
// Author:  Hans B�hler (hb@codex-design.de)
//          codex design (http://www.codex-design.de)
// Version: 1.3
// -----------------------------------------------------------------------
// Changes for 1.1:
// - cdxCSizeIconCtrl catches left-mb-doubleclick what caused the window
//	  to get maximized for any reason. 
// Changes for 1.2:
// - Ability to check parent's state: If it is zoomed, the control won't
//   draw a sizing icon.
// Changes for 1.3:
// - Icon now has proper colors.
// -----------------------------------------------------------------------
// Comments welcome.
//

/*
 * cdxCSizeIconCtrl
 * ================
 * A simple class that is a size-icon.
 *
 * (w)Nov.1998 mailto:hans.buehler@student.hu-berlin.de,
 *    codex design
 */

class cdxCSizeIconCtrl : public CScrollBar
{
	DECLARE_DYNAMIC(cdxCSizeIconCtrl);

public:
	class AutoOEMImageList : public CImageList
	{
	private:
		CSize	m_szImage;

	public:
		AutoOEMImageList(UINT nBitmapID, COLORREF crMask);
		virtual ~AutoOEMImageList() {}

		const CSize & Size() const { return m_szImage; }
	};

private:
	bool	m_bCapture;
public:
	bool	m_bReflectParentState;

public:
	cdxCSizeIconCtrl(bool bReflectParentState = true) : m_bCapture(false), m_bReflectParentState(bReflectParentState) {}
	virtual ~cdxCSizeIconCtrl() {}

	virtual BOOL Create(CWnd *pParent, UINT id = AFX_IDW_SIZE_BOX);

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(cdxCSizeIconCtrl)
	//}}AFX_VIRTUAL

	// Generated message map functions
protected:
	//{{AFX_MSG(cdxCSizeIconCtrl)
	afx_msg void OnPaint();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP();

	//
	// static members
	//
public:
	static AutoOEMImageList	M_ilImage;
	static HCURSOR				M_hcSize;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CDXCSIZEICONCTRL_H__9B4AD1C3_8AA5_11D2_BE9C_000000000000__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Joshua Jensen is a gamer at heart and as such, creates games for a living. He has the distinct pleasure of creating titles exclusively for the Xbox.

In his spare time, he maintains a Visual C++ add-in called Workspace Whiz! Find it at http://workspacewhiz.com/.

Comments and Discussions