-
Notifications
You must be signed in to change notification settings - Fork 73
/
nwpwin.h
39 lines (30 loc) · 887 Bytes
/
nwpwin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <windows.h>
#include <string>
namespace vsite::nwp {
class application
{
public:
int run();
};
class window
{
HWND hw{ 0 };
protected:
virtual std::string class_name();
bool register_class(const std::string& name);
std::string generate_class_name();
public:
bool create(HWND parent, DWORD style, LPCTSTR caption = 0, int IdOrMenu = 0,
int x = CW_USEDEFAULT, int y = CW_USEDEFAULT, int width = CW_USEDEFAULT, int height = CW_USEDEFAULT);
operator HWND();
static LRESULT CALLBACK proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
// messages
protected:
virtual int on_create(CREATESTRUCT*) { return 0; }
virtual void on_command(int) { }
virtual void on_destroy() { }
virtual void on_key_down(int key) { }
virtual void on_key_up(int key) { }
virtual void on_left_button_down(POINT p) { }
};
} // namespace