-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (38 loc) · 1.42 KB
/
main.cpp
File metadata and controls
44 lines (38 loc) · 1.42 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
#include <Windows.h>
// #include "WndProc.h"
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSA mainWc = {0};
mainWc.hInstance = hInstance;
mainWc.lpfnWndProc = DefWindowProc;
mainWc.lpszClassName = "MainWindowClass";
mainWc.hCursor = LoadCursor(NULL, IDC_ARROW);
mainWc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
RegisterClassA(&mainWc);
// WNDCLASSA imgWc = {0};
// imgWc.hInstance = hInstance;
// imgWc.lpfnWndProc = ImgWndProc;
// imgWc.lpszClassName = "ImageWindowClass";
// imgWc.hCursor = LoadCursor(NULL, IDC_ARROW);
// imgWc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
// RegisterClassA(&imgWc);
// WNDCLASSA histWc = {0};
// histWc.hInstance = hInstance;
// histWc.lpfnWndProc = HistWndProc;
// histWc.lpszClassName = "HistogramWindowClass";
// histWc.hCursor = LoadCursor(NULL, IDC_ARROW);
// histWc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
// RegisterClassA(&histWc);
HWND mainWindow = CreateWindowA("MainWindowClass", "Image Loader", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 500, 100, NULL, NULL, hInstance, NULL);
if (!mainWindow)
return 1;
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
ExitProcess(0);
return msg.wParam;
}