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