-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWinApplication.h
More file actions
39 lines (29 loc) · 863 Bytes
/
Copy pathWinApplication.h
File metadata and controls
39 lines (29 loc) · 863 Bytes
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
#pragma once
#include <windows.h>
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment(lib, "Gdiplus.lib")
class CWinApplication
{
public:
CWinApplication(HINSTANCE hInstance, INT iCmdShow);
virtual ~CWinApplication(void);
public:
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static void WndPaint(HDC hdc);
void Run();
HWND GetHwnd() const { return m_hWnd;};
private:
void RegisterDefaultClass();
void CreateMainWindow();
HINSTANCE m_hInstance;
INT m_iCmdShow;
HWND m_hWnd;
ULONG_PTR m_ulGdiplustoken;
};
typedef void (*PaintEvent)(HDC hdc);
typedef void (*CommandEvent)(WORD notifyCode, WORD itemID, HWND ctlHandle);
typedef void (*LButtonDownEvent)();
extern PaintEvent PaintProc;
extern CommandEvent CommandProc;
extern LButtonDownEvent LButtonDownProc;