|
// MainDlg.h : interface of the CMainDlg class
/////////////////////////////////////////////////////////////////////////////
#pragma once
class CMainDlg : public CDialogImpl<CMainDlg>, public CMessageFilter,
public CWinDataExchange<CMainDlg>,
public CThemeImpl<CMainDlg>
{
public:
enum { IDD = IDD_MAINDLG };
// Construction
CMainDlg();
// Maps
BEGIN_MSG_MAP(CMainDlg)
CHAIN_MSG_MAP(CThemeImpl<CMainDlg>)
MSG_WM_INITDIALOG(OnInitDialog)
MSG_WM_TIMER(OnTimer)
MSG_WM_POWERBROADCAST(OnPowerBroadcast)
MSG_WM_DRAWITEM(OnDrawItem)
COMMAND_ID_HANDLER_EX(ID_APP_ABOUT, OnAppAbout)
COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
END_MSG_MAP()
BEGIN_DDX_MAP(CMainDlg)
DDX_CONTROL_HANDLE(IDC_CURR_SCHEME, m_cPowerScheme)
DDX_CONTROL_HANDLE(IDC_CURR_SOURCE, m_cPowerSource)
DDX_CONTROL_HANDLE(IDC_CURR_BATTERY_POWER, m_cBatteryPower)
DDX_CONTROL_HANDLE(IDC_MESSAGE, m_cMessage)
END_DDX_MAP()
// Message/command handlers
BOOL PreTranslateMessage(MSG* pMsg);
BOOL OnIdle();
BOOL OnInitDialog(HWND hwndFocus, LPARAM lParam);
void OnTimer(UINT uID, TIMERPROC pProc);
void OnAppAbout(UINT uCode, int nID, HWND hwndCtrl);
void OnCancel(UINT uCode, int nID, HWND hwndCtrl);
LRESULT OnPowerBroadcast(DWORD dwEvent, DWORD dwData);
void OnDrawItem(UINT uID, LPDRAWITEMSTRUCT lpdis);
protected:
enum EPowerScheme { pwrPowerSaver, pwrMaxPerf, pwrBalanced };
HPOWERNOTIFY m_hPowerSchemeNotify, m_hPowerSourceNotify, m_hBatteryPowerNotify;
EPowerScheme m_eCurrPowerScheme;
bool m_bOnBattery;
int m_nBatteryPower;
CStatic m_cPowerScheme, m_cPowerSource, m_cBatteryPower, m_cMessage;
bool m_bUseAnimation;
};
|
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.
Michael lives in sunny Mountain View, California. He started programming with an Apple
//e in 4th grade, graduated from
UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
Mike has been a a developer at
Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at
VMware.
He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.
Mike was a
VC MVP from 2005 to 2009.