Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. cdlg.h
  5. Abstract:
  6. Imitation of MFC CDialog class
  7. Author:
  8. Vlad Sadovsky (vlads) 26-Mar-1997
  9. Revision History:
  10. 26-Mar-1997 VladS created
  11. --*/
  12. #ifndef _CDLG_H
  13. #define _CDLG_H
  14. #define ID_TIMER_EVENT 1000
  15. class CDlg
  16. {
  17. public:
  18. void SetInstance(HINSTANCE hInst);
  19. void SetDlgID(UINT id);
  20. void Destroy();
  21. CDlg(int DlgID, HWND hWndParent, HINSTANCE hInst,UINT msElapseTimePeriod=0);
  22. ~CDlg();
  23. HWND GetWindow() const { return m_hDlg; }
  24. HWND GetParent() const { return ::GetParent(m_hDlg); }
  25. HWND GetDlgItem(int iD) const { return ::GetDlgItem(m_hDlg,iD); }
  26. HINSTANCE GetInstance() const { return m_Inst;}
  27. UINT_PTR GetTimerId(VOID) const {return m_uiTimerId;}
  28. BOOL EndDialog(int iRet) { return ::EndDialog(m_hDlg,iRet); }
  29. // If you want your own dlg proc.
  30. INT_PTR CreateModal();
  31. HWND CreateModeless();
  32. virtual BOOL CALLBACK DlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam);
  33. virtual int OnCommand(UINT id,HWND hwndCtl, UINT codeNotify);
  34. virtual void OnInit();
  35. virtual int OnNotify(NMHDR * pHdr);
  36. private:
  37. BOOL m_bCreatedModeless;
  38. void SetWindow(HWND hDlg) { m_hDlg=hDlg; }
  39. int m_DlgID;
  40. HWND m_hDlg;
  41. HWND m_hParent;
  42. HINSTANCE m_Inst;
  43. UINT m_msElapseTimePeriod;
  44. UINT_PTR m_uiTimerId;
  45. protected:
  46. static INT_PTR CALLBACK BaseDlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam);
  47. };
  48. #endif // _CDLG_H