-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSource.cpp
More file actions
84 lines (80 loc) · 1.78 KB
/
Copy pathSource.cpp
File metadata and controls
84 lines (80 loc) · 1.78 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
81
82
83
84
#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include <windows.h>
TCHAR szClassName[] = TEXT("Window");
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static HWND hButton;
switch (msg)
{
case WM_CREATE:
hButton = CreateWindow(TEXT("BUTTON"),
TEXT("サインアウトする"),
WS_VISIBLE | WS_CHILD,
0, 0, 0, 0,
hWnd, (HMENU)IDOK,
((LPCREATESTRUCT)lParam)->hInstance,
0);
break;
case WM_SIZE:
MoveWindow(hButton, 10, 10, 256, 32, TRUE);
break;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK)
{
if (IDYES == MessageBox(hWnd,
TEXT("サインアウトしますか?\r\n\r\n")
TEXT("※注意\r\nファイルをファイルを開いたままサインアウトすると")
TEXT("編集中の情報が失われる可能性があります。"),
TEXT("確認"), MB_YESNO))
{
ExitWindows(0, 0);
}
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPreInst, LPSTR pCmdLine, int nCmdShow)
{
MSG msg;
WNDCLASS wndclass = {
CS_HREDRAW | CS_VREDRAW,
WndProc,
0,
0,
hInstance,
0,
LoadCursor(0,IDC_ARROW),
(HBRUSH)(COLOR_WINDOW + 1),
0,
szClassName
};
RegisterClass(&wndclass);
HWND hWnd = CreateWindow(
szClassName,
TEXT("サインアウト"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
0,
CW_USEDEFAULT,
0,
0,
0,
hInstance,
0
);
ShowWindow(hWnd, SW_SHOWDEFAULT);
UpdateWindow(hWnd);
while (GetMessage(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int)msg.wParam;
}