-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSizeDialog.h
More file actions
80 lines (69 loc) · 1.81 KB
/
Copy pathSizeDialog.h
File metadata and controls
80 lines (69 loc) · 1.81 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#include <stddef.h>
#include <Windows.h>
typedef void (CALLBACK * SIZEDIALOGAPPLY)(void *, ULONG, const POINT *, const SIZE *, const TCHAR *);
struct ENUMMONITORPARAM
{
HWND combobox;
HMONITOR current_monitor;
};
typedef struct ENUMMONITORPARAM ENUMMONITORPARAM;
struct SIZEDIALOGPARAM
{
HWND target;
SIZEDIALOGAPPLY callback;
void * callback_param;
};
typedef struct SIZEDIALOGPARAM SIZEDIALOGPARAM;
// Flags for SIZEDIALOGAPPLY callback
#define SDAF_CLIENT_POS 0x1UL
#define SDAF_CLIENT_SIZE 0x2UL
#define SDAF_SETCAPTION 0x4UL
// Internal flags for calc_window_pos function
#define CWPF_UP 0x01UL
#define CWPF_MIDDLE 0x02UL
#define CWPF_DOWN 0x03UL
#define CWPF_YPOS_MASK 0x03UL
#define CWPF_LEFT 0x04UL
#define CWPF_CENTER 0x08UL
#define CWPF_RIGHT 0x0CUL
#define CWPF_XPOS_MASK 0x0CUL
#define CWPF_FULLWIDTH 0x10UL
#define CWPF_FULLHEIGHT 0x20UL
class SizeDialog
{
private:
long p_ref;
HWND p_dialog;
HWND p_parent;
HWND p_caption;
HWND p_xpos;
HWND p_ypos;
HWND p_width;
HWND p_height;
HWND p_monitor;
HWND p_target;
POINT p_pos;
SIZE p_size;
TCHAR * p_caption_text;
SIZEDIALOGAPPLY p_callback;
void * p_callback_param;
bool p_do_apply;
private:
SizeDialog(HWND);
~SizeDialog();
public:
// COMっぽく実装してみるが、QueryInterfaceは無かったことになった。
intptr_t AddRef();
intptr_t Release();
static INT_PTR CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
private:
// メッセージハンドラ
void do_destroy();
void do_notify(NMHDR *);
void do_initdialog(LPARAM);
void do_command(WORD, WORD, HWND);
// 内部関数
void calc_window_position(ULONG, HMONITOR, RECT *);
static BOOL CALLBACK enum_monitors(HMONITOR, HDC, LPRECT, LPARAM);
};