1 // Windows/Control/Window2.h 2 3 #ifndef ZIP7_INC_WINDOWS_CONTROL_WINDOW2_H 4 #define ZIP7_INC_WINDOWS_CONTROL_WINDOW2_H 5 6 #include "../Window.h" 7 8 namespace NWindows { 9 namespace NControl { 10 11 class CWindow2: public CWindow 12 { 13 // Z7_CLASS_NO_COPY(CWindow2) 14 15 LRESULT DefProc(UINT message, WPARAM wParam, LPARAM lParam); 16 public: CWindow(newWindow)17 CWindow2(HWND newWindow = NULL): CWindow(newWindow) {} ~CWindow2()18 virtual ~CWindow2() {} 19 20 bool CreateEx(DWORD exStyle, LPCTSTR className, LPCTSTR windowName, 21 DWORD style, int x, int y, int width, int height, 22 HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance); 23 24 #ifndef _UNICODE 25 bool CreateEx(DWORD exStyle, LPCWSTR className, LPCWSTR windowName, 26 DWORD style, int x, int y, int width, int height, 27 HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance); 28 #endif 29 30 virtual LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam); OnCreate(CREATESTRUCT *)31 virtual bool OnCreate(CREATESTRUCT * /* createStruct */) { return true; } 32 // virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam); 33 // bool OnCommand2(WPARAM wParam, LPARAM lParam, LRESULT &result); 34 virtual bool OnCommand(unsigned code, unsigned itemID, LPARAM lParam, LRESULT &result); OnSize(WPARAM,int,int)35 virtual bool OnSize(WPARAM /* wParam */, int /* xSize */, int /* ySize */) { return false; } OnNotify(UINT,LPNMHDR,LRESULT &)36 virtual bool OnNotify(UINT /* controlID */, LPNMHDR /* lParam */, LRESULT & /* result */) { return false; } OnDestroy()37 virtual void OnDestroy() { PostQuitMessage(0); } OnClose()38 virtual void OnClose() { Destroy(); } 39 /* 40 virtual LRESULT OnHelp(LPHELPINFO helpInfo) { OnHelp(); } 41 virtual LRESULT OnHelp() {}; 42 virtual bool OnButtonClicked(unsigned buttonID, HWND buttonHWND); 43 virtual void OnOK() {}; 44 virtual void OnCancel() {}; 45 */ 46 SetMsgResult(LONG_PTR newLongPtr)47 LONG_PTR SetMsgResult(LONG_PTR newLongPtr) { return SetLongPtr(DWLP_MSGRESULT, newLongPtr); } GetMsgResult()48 LONG_PTR GetMsgResult() const { return GetLongPtr(DWLP_MSGRESULT); } 49 }; 50 51 }} 52 53 #endif 54