forked from vsite-nwp/v04
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nwpwin.h
36 lines (29 loc) · 821 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
#include <windows.h>
#include <string>
class Application
{
public:
int Run();
};
class Window
{
HWND hw;
protected:
virtual std::string ClassName();
bool Register(const std::string& name);
std::string GenerateClassName();
public:
Window();
bool Create(HWND parent, DWORD style, PCSTR 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 OnCreate(CREATESTRUCT*) { return 0; }
virtual void OnCommand(int) { }
virtual void OnDestroy() { }
virtual void OnKeyDown(int key) { }
virtual void OnKeyUp(int key) { }
virtual void OnLButtonDown(POINT p) { }
};