summaryrefslogtreecommitdiff
path: root/Editor/GUI/MainWindow.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-17 16:01:09 +0800
committerchai <chaifix@163.com>2021-10-17 16:01:09 +0800
commite13f699ee5f575198552d94ada1167305c82bb2f (patch)
treed67ff5ec85959f38a62babf856d4fa9f2f0b4147 /Editor/GUI/MainWindow.cpp
parentd35db57d457132dd9d83fa2bd51491b148530655 (diff)
*misc
Diffstat (limited to 'Editor/GUI/MainWindow.cpp')
-rw-r--r--Editor/GUI/MainWindow.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/Editor/GUI/MainWindow.cpp b/Editor/GUI/MainWindow.cpp
new file mode 100644
index 0000000..fe4e499
--- /dev/null
+++ b/Editor/GUI/MainWindow.cpp
@@ -0,0 +1,54 @@
+#include <string>
+
+#include "EditorWindows.h"
+#include "WinUtils.h"
+#include "Editor/Utils/HelperFuncs.h"
+#include "MenuManager.h"
+#include "Runtime/Utilities/Assert.h"
+
+bool ProcessMainWindowMessages(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT& result)
+{
+
+ //if(message!=WM_TIMER && message!=WM_SETCURSOR)
+ // printf_console("msg: %s\n", winutils::GetWindowsMessageInfo(message,wParam,lParam).c_str());
+
+ switch (message)
+ {
+
+ // Ok, this is fun: when we're using swap chains and no "regular window", often we don't get device loss events, even though it
+ // looks like the device is put into "lost" state. So whenever anything important changes (resolution, user logs in, etc.),
+ // try to manually reset the device and repaint everything. Yay!
+ case WM_SETTINGCHANGE:
+ // when switching to screen saver, it seems that the only way to detect that is by handling working area change message.
+ if (wParam == SPI_SETWORKAREA) {
+ }
+ break;
+ case WM_DISPLAYCHANGE:
+ case WM_DEVMODECHANGE:
+ case WM_USERCHANGED:
+ break;
+
+ case WM_COPYDATA:
+ {
+
+ }
+ break;
+ case WM_INITMENU: // 主窗口菜单栏初始化
+
+ return true;
+ case WM_COMMAND: // 点击菜单,点击加速键,点击子窗口按钮,点击工具栏按钮。这些时候都有command消息产生。
+
+ break;
+
+ case WM_ACTIVATEAPP:
+
+ break;
+
+ case WM_DESTROY:
+ ::PostQuitMessage(0);
+ break;
+ }
+
+ return false;
+}
+