///////////////////////////////////////////////////////////////////////////// // serverDlg.h : Declaration of the CserverDlg #ifndef __SERVERDLG_H_ #define __SERVERDLG_H_ #include #include #include "resource.h" // main symbols #include /////////////////////////////////////////////////////////////// // Declarations for the user defined event #define WM_USER_EVENT WM_USER+100 // user defined event message void __cdecl doTime(void* idThread); // thread processing function // that handles events /////////////////////////////////////////////////////////////// // CserverDlg class CserverDlg : public CAxDialogImpl { public: CserverDlg() { } ~CserverDlg() { } enum { IDD = IDD_SERVERDLG }; BEGIN_MSG_MAP(CserverDlg) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) MESSAGE_HANDLER(WM_USER_EVENT,OnUserMsg) COMMAND_ID_HANDLER(IDCANCEL, OnCancel) END_MSG_MAP() ///////////////////////////////////////////////////////////////////////////// // start thread to simulate events and notify client LRESULT OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled ) { _beginthread(doTime,0,(void*)GetCurrentThreadId()); return 1; // Let the system set the focus } // ///////////////////////////////////////////////////////////////////////////// // handle events LRESULT OnUserMsg( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled ); ///////////////////////////////////////////////////////////////////////////// // start shut down process LRESULT OnCancel( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled ) { PostQuitMessage(0); EndDialog(wID); return 0; } }; #endif //__SERVERDLG_H_