diff options
author | crupest <crupest@outlook.com> | 2022-05-15 13:56:40 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-05-15 13:56:40 +0800 |
commit | 9e0c9d3499bc50c3534b4dc500d8b5d0b5f22752 (patch) | |
tree | 7342f6991771fa31b16fd6a5ed892ff6025f3d05 /include/cru/platform/gui/win/GodWindow.h | |
parent | 41de54bad2c0f857821fcc83f41af3334d068b6d (diff) | |
download | cru-9e0c9d3499bc50c3534b4dc500d8b5d0b5f22752.tar.gz cru-9e0c9d3499bc50c3534b4dc500d8b5d0b5f22752.tar.bz2 cru-9e0c9d3499bc50c3534b4dc500d8b5d0b5f22752.zip |
...
Diffstat (limited to 'include/cru/platform/gui/win/GodWindow.h')
-rw-r--r-- | include/cru/platform/gui/win/GodWindow.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/cru/platform/gui/win/GodWindow.h b/include/cru/platform/gui/win/GodWindow.h new file mode 100644 index 00000000..fe61c80d --- /dev/null +++ b/include/cru/platform/gui/win/GodWindow.h @@ -0,0 +1,39 @@ +#pragma once +#include "Base.h" + +#include "WindowNativeMessageEventArgs.h" +#include "cru/common/Event.h" +#include "cru/common/String.h" + +#include <memory> + +namespace cru::platform::gui::win { +class CRU_WIN_GUI_API GodWindow : public Object { + CRU_DEFINE_CLASS_LOG_TAG(u"GodWindow") + + public: + explicit GodWindow(WinUiApplication* application); + + CRU_DELETE_COPY(GodWindow) + CRU_DELETE_MOVE(GodWindow) + + ~GodWindow() override; + + HWND GetHandle() const { return hwnd_; } + + bool HandleGodWindowMessage(HWND hwnd, UINT msg, WPARAM w_param, + LPARAM l_param, LRESULT* result); + + IEvent<WindowNativeMessageEventArgs&>* MessageEvent() { + return &message_event_; + } + + private: + WinUiApplication* application_; + + std::unique_ptr<WindowClass> god_window_class_; + HWND hwnd_; + + Event<WindowNativeMessageEventArgs&> message_event_; +}; +} // namespace cru::platform::gui::win |