diff options
Diffstat (limited to 'Editor/GUI/MainWindow.cpp')
-rw-r--r-- | Editor/GUI/MainWindow.cpp | 54 |
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; +} + |