diff options
author | chai <chaifix@163.com> | 2020-11-10 18:46:11 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-11-10 18:46:11 +0800 |
commit | 59e6235113a4d933811aa2cf6fdc8282ce394b9d (patch) | |
tree | 12410a230c5339ca88be6842c0dc811d5c6ec0ba /Editor/GUI/WinUtils.cpp | |
parent | f0807fc44dde14531759306317611bab87c8fccf (diff) |
*window
Diffstat (limited to 'Editor/GUI/WinUtils.cpp')
-rw-r--r-- | Editor/GUI/WinUtils.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Editor/GUI/WinUtils.cpp b/Editor/GUI/WinUtils.cpp new file mode 100644 index 0000000..e7b2d5b --- /dev/null +++ b/Editor/GUI/WinUtils.cpp @@ -0,0 +1,43 @@ +#include "winutils.h"
+
+namespace winutils
+{
+
+ static HINSTANCE gInstanceHandle = NULL; +
+ HINSTANCE GetInstanceHandle() + { + return gInstanceHandle; + }
+
+ ATOM RegisterWindowClass(const wchar_t* className, WNDPROC windowProc, unsigned int style)
+ {
+#if DEBUG_WIN_UTILS + printf_console("Debug winutils: register class %s\n", className); +#endif + + WNDCLASSEXW wcex; + memset(&wcex, 0, sizeof(wcex)); + wcex.cbSize = sizeof(wcex); + wcex.style = style; + wcex.lpfnWndProc = windowProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = winutils::GetInstanceHandle(); + //wcex.hIcon = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_APP_ICON); + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = NULL; + wcex.lpszMenuName = NULL; + wcex.lpszClassName = className; + ATOM classAtom = RegisterClassExW(&wcex); + //if (!classAtom) + // printf("Failed to register window class %s: %s\n", className, WIN_LAST_ERROR_TEXT); + return classAtom;
+ }
+
+ void UnregisterWindowClass(const wchar_t* className)
+ {
+
+ }
+
+}
|