aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/Control/Window2.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2021-12-27 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2022-03-18 15:35:13 +0500
commitf19f813537c7aea1c20749c914e756b54a9c3cf5 (patch)
tree816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Windows/Control/Window2.h
parent98e06a519b63b81986abe76d28887f6984a7732b (diff)
download7zip-21.07.tar.gz
7zip-21.07.tar.bz2
7zip-21.07.zip
'21.07'21.07
Diffstat (limited to 'CPP/Windows/Control/Window2.h')
-rw-r--r--CPP/Windows/Control/Window2.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/CPP/Windows/Control/Window2.h b/CPP/Windows/Control/Window2.h
new file mode 100644
index 0000000..7ac580c
--- /dev/null
+++ b/CPP/Windows/Control/Window2.h
@@ -0,0 +1,51 @@
1// Windows/Control/Window2.h
2
3#ifndef __WINDOWS_CONTROL_WINDOW2_H
4#define __WINDOWS_CONTROL_WINDOW2_H
5
6#include "../Window.h"
7
8namespace NWindows {
9namespace NControl {
10
11class CWindow2: public CWindow
12{
13 LRESULT DefProc(UINT message, WPARAM wParam, LPARAM lParam);
14public:
15 CWindow2(HWND newWindow = NULL): CWindow(newWindow){};
16 virtual ~CWindow2() {};
17
18 bool CreateEx(DWORD exStyle, LPCTSTR className, LPCTSTR windowName,
19 DWORD style, int x, int y, int width, int height,
20 HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance);
21
22 #ifndef _UNICODE
23 bool CreateEx(DWORD exStyle, LPCWSTR className, LPCWSTR windowName,
24 DWORD style, int x, int y, int width, int height,
25 HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance);
26 #endif
27
28 virtual LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
29 virtual bool OnCreate(CREATESTRUCT * /* createStruct */) { return true; }
30 // virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
31 virtual bool OnCommand(WPARAM wParam, LPARAM lParam, LRESULT &result);
32 virtual bool OnCommand(int code, int itemID, LPARAM lParam, LRESULT &result);
33 virtual bool OnSize(WPARAM /* wParam */, int /* xSize */, int /* ySize */) { return false; }
34 virtual bool OnNotify(UINT /* controlID */, LPNMHDR /* lParam */, LRESULT & /* result */) { return false; }
35 virtual void OnDestroy() { PostQuitMessage(0); }
36 virtual void OnClose() { Destroy(); }
37 /*
38 virtual LRESULT OnHelp(LPHELPINFO helpInfo) { OnHelp(); }
39 virtual LRESULT OnHelp() {};
40 virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
41 virtual void OnOK() {};
42 virtual void OnCancel() {};
43 */
44
45 LONG_PTR SetMsgResult(LONG_PTR newLongPtr) { return SetLongPtr(DWLP_MSGRESULT, newLongPtr); }
46 LONG_PTR GetMsgResult() const { return GetLongPtr(DWLP_MSGRESULT); }
47};
48
49}}
50
51#endif