Use Slim Reader/Writer lock to replace CRITICAL_SECTION (better performance).
[gdipp.git] / gdipp_demo / MainDlg.h
blob307730bf95e6f6bae476034c8623477ba86060b6
1 // MainDlg.h : interface of the CMainDlg class
2 //
3 /////////////////////////////////////////////////////////////////////////////
5 #pragma once
7 #include "gdipp_demo/resource.h"
9 class CMainDlg : public CDialogImpl<CMainDlg>, public CUpdateUI<CMainDlg>,
10 public CMessageFilter, public CIdleHandler
12 public:
13 enum { IDD = IDD_MAINDLG };
15 virtual BOOL PreTranslateMessage(MSG* pMsg);
16 virtual BOOL OnIdle();
18 BEGIN_UPDATE_UI_MAP(CMainDlg)
19 END_UPDATE_UI_MAP()
21 BEGIN_MSG_MAP(CMainDlg)
22 MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
23 MESSAGE_HANDLER(WM_CLOSE, OnClose)
24 MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
25 COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
26 COMMAND_ID_HANDLER(ID_TOOLS_LOAD, OnToolsLoad)
27 COMMAND_ID_HANDLER(ID_TOOLS_UNLOAD, OnToolsUnload)
28 COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
29 END_MSG_MAP()
31 // Handler prototypes (uncomment arguments if needed):
32 // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
33 // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
34 // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
36 LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
37 LRESULT OnClose(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/);
38 LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
39 LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
40 LRESULT OnToolsLoad(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
41 LRESULT OnToolsUnload(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
42 LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
44 void CloseDialog(int nVal);
46 private:
47 void update_menu_state();
48 bool load_client();
49 bool unload_client();