WHWindow.h
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:2k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. #ifndef _WINDHORN_WINDOW
  2. #define _WINDHORN_WINDOW
  3. /******************************************************************************************************************
  4. CWHApp Class Declaration
  5. *******************************************************************************************************************/
  6. class CWHApp
  7. {
  8. public:
  9. //1: Constuctor/Destructor
  10. CWHApp();
  11. ~CWHApp();
  12. //2: Variables
  13. protected:
  14. HINSTANCE m_hInstance;
  15. __inline VOID SethInstance(HINSTANCE hInst) { m_hInstance = hInst; }
  16. //3: Methods
  17. public:
  18. __inline HINSTANCE GetSafehInstance() { return  m_hInstance; }
  19. //4: Message Map
  20. virtual LRESULT MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  21. };
  22. /******************************************************************************************************************
  23. CWHWindow Class Declaration
  24. *******************************************************************************************************************/
  25. class CWHWindow : public CWHApp
  26. {
  27. //1: Constuctor/Destructor
  28. public:
  29. CWHWindow();
  30. ~CWHWindow();
  31. //2: Variables
  32. protected:
  33. HWND m_hWnd;
  34. //3: Methods
  35. BOOL RegisterClass(CHAR* pszMenuName, CHAR* pszIconName);
  36. public:
  37. BOOL Create(HINSTANCE hInst, LPTSTR lpCaption = NULL, CHAR* pszMenuName = NULL, CHAR* pszIconName = NULL);
  38. __inline HWND GetSafehWnd() { return m_hWnd; }
  39. //4: Message Map
  40. virtual LRESULT MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. virtual LRESULT OnDestroy();
  42. };
  43. #endif //_WINDHORN_WINDOW