|
// aboutdlg.h : interface of the CAboutDlg class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_ABOUTDLG_H__C90AF30A_D891_11D6_B6BF_0048548B09C5__INCLUDED_)
#define AFX_ABOUTDLG_H__C90AF30A_D891_11D6_B6BF_0048548B09C5__INCLUDED_
class CAboutDlg : public CDialogImpl<CAboutDlg>
{
public:
enum { IDD = IDD_ABOUTBOX };
CMeta m_bkgnd;
BEGIN_MSG_MAP(CAboutDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()
LRESULT OnInitDialog(UINT, WPARAM, LPARAM, BOOL&)
{
// load the background image
m_bkgnd.LoadMetaResource(IDR_ROBOT, FALSE);
CenterWindow(GetParent());
return TRUE;
}
LRESULT OnEraseBkgnd(UINT, WPARAM wParam, LPARAM, BOOL&)
{
RECT rc;
GetClientRect(&rc);
// fill in background color
::FillRect((HDC)wParam, &rc, (HBRUSH)(COLOR_BACKGROUND));
// paint background metafile
return ::PlayEnhMetaFile((HDC)wParam, m_bkgnd, &rc);
}
LRESULT OnCtlColorStatic(UINT, WPARAM wParam, LPARAM lParam, BOOL&)
{
SetBkMode((HDC)wParam, TRANSPARENT);
// return a null brush so image behind static isn't erased
return (LRESULT)::GetStockObject(NULL_BRUSH);
}
LRESULT OnCloseCmd(WORD, WORD wID, HWND, BOOL&)
{
EndDialog(wID);
return 0;
}
};
#endif // !defined(AFX_ABOUTDLG_H__C90AF30A_D891_11D6_B6BF_0048548B09C5__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.
Ed has over 40 years experience in computer technology and a bachelor's degree in Business Administration. He's currently a marketing technology consultant. During his career, he's led software development departments and created software still in use in the communications and healthcare industries. Ed is a veteran of the United States Army. He lives in Arizona in the United States.
Find Ed on
Linkedin.
This material is copyright 2019 by Ed Gadziemski. Unauthorized use is strictly prohibited. All rights reserved.