Click here to Skip to main content
15,885,985 members
Articles / Desktop Programming / MFC

FaderWnd - a Window Fader for Windows 2000

Rate me:
Please Sign up or sign in to vote.
4.65/5 (7 votes)
28 Jun 2000 163.9K   3.1K   56  
An MFC class to fade any window with only one line of code.
/*----------------------------------------------------------------------------*/
//
//	File:			FadeTestDlg.h
//	Author:		Phil J. Pearson
//	Created:	23 June 2000  19:10
//	Last Mod: 23 June 2000  19:12
//
/*----------------------------------------------------------------------------
/*
/* Copyright (C) 2000 by Real World Software
/* All Rights Reserved.
/*
/*----------------------------------------------------------------------------*/

#if !defined(AFX_FADETESTDLG_H__34262926_B5EF_45F2_B0F2_168873351E99__INCLUDED_)
#define AFX_FADETESTDLG_H__34262926_B5EF_45F2_B0F2_168873351E99__INCLUDED_

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


/////////////////////////////////////////////////////////////////////////////
// CFadeTestDlg dialog

class CFadeTestDlg : public CDialog
{
// Construction
public:
	CFadeTestDlg(UINT nID, CWnd* pParent, bool bModal = true);
	CFadeTestDlg(CWnd* pParent, bool bModal = false);

// Dialog Data
	//{{AFX_DATA(CFadeTestDlg)
	BYTE	m_byAlpha;
	UINT	m_nFadeTime;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFadeTestDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void PostNcDestroy();
	//}}AFX_VIRTUAL

// Implementation
protected:
	bool					m_bModal;

	// Generated message map functions
	//{{AFX_MSG(CFadeTestDlg)
	virtual void OnCancel();
	virtual void OnOK();
	afx_msg void OnClose();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////
// CFadeTestModelessDlg dialog

class CFadeTestModelessDlg : public CFadeTestDlg
{
// Construction
public:
	CFadeTestModelessDlg(CWnd* pParent) : CFadeTestDlg(pParent) { Create(IDD, pParent); ShowWindow(SW_SHOW); }

// Dialog Data
	//{{AFX_DATA(CFadeTestModelessDlg)
	enum { IDD = IDD_FADETEST };
	//}}AFX_DATA
};


/////////////////////////////////////////////////////////////////////////////
// CFadeTestModalDlg dialog

class CFadeTestModalDlg : public CFadeTestDlg
{
// Construction
public:
	CFadeTestModalDlg(CWnd* pParent) : CFadeTestDlg(IDD, pParent, true) {}

// Dialog Data
	//{{AFX_DATA(CFadeTestModalDlg)
	enum { IDD = IDD_FADETESTMODAL };
	//}}AFX_DATA
};


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_FADETESTDLG_H__34262926_B5EF_45F2_B0F2_168873351E99__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
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions