-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWin32GUI_Skeleton.cpp
More file actions
41 lines (37 loc) · 1.14 KB
/
Win32GUI_Skeleton.cpp
File metadata and controls
41 lines (37 loc) · 1.14 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
#include <windows.h>
#include <string>
#include "SessionManager.h"
#include "ProtocolHandler.h"
#include "OverlayRenderer.h"
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch (uMsg) {
case WM_CREATE:
OverlayRenderer::Init(hwnd);
return 0;
case WM_PAINT:
OverlayRenderer::Render(hwnd);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, int nCmdShow) {
const wchar_t CLASS_NAME[] = L"XTTPSViewer";
WNDCLASS wc = { };
wc.lpfnWndProc = WindowProc;
wc.hInstance = hInst;
wc.lpszClassName = CLASS_NAME;
RegisterClass(&wc);
HWND hwnd = CreateWindowEx(0, CLASS_NAME, L"XTTPS Session Viewer",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600,
nullptr, nullptr, hInst, nullptr);
ShowWindow(hwnd, nCmdShow);
MSG msg = {};
while (GetMessage(&msg, nullptr, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}