Adding a way to get an hmodule.

This commit is contained in:
Ben Vanik 2015-11-09 13:59:06 -08:00
parent 93708c0c1c
commit ca5e8fa073
3 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@
namespace xe { namespace xe {
namespace ui { namespace ui {
typedef void* NativePlatformHandle;
typedef void* NativeWindowHandle; typedef void* NativeWindowHandle;
class Window { class Window {
@ -33,6 +34,7 @@ class Window {
virtual ~Window(); virtual ~Window();
Loop* loop() const { return loop_; } Loop* loop() const { return loop_; }
virtual NativePlatformHandle native_platform_handle() const = 0;
virtual NativeWindowHandle native_handle() const = 0; virtual NativeWindowHandle native_handle() const = 0;
MenuItem* main_menu() const { return main_menu_.get(); } MenuItem* main_menu() const { return main_menu_.get(); }

View File

@ -33,6 +33,10 @@ Win32Window::~Win32Window() {
} }
} }
NativePlatformHandle Win32Window::native_platform_handle() const {
return ::GetModuleHandle(nullptr);
}
bool Win32Window::Initialize() { return OnCreate(); } bool Win32Window::Initialize() { return OnCreate(); }
bool Win32Window::OnCreate() { bool Win32Window::OnCreate() {

View File

@ -26,6 +26,7 @@ class Win32Window : public Window {
Win32Window(Loop* loop, const std::wstring& title); Win32Window(Loop* loop, const std::wstring& title);
~Win32Window() override; ~Win32Window() override;
NativePlatformHandle native_platform_handle() const override;
NativeWindowHandle native_handle() const override { return hwnd_; } NativeWindowHandle native_handle() const override { return hwnd_; }
HWND hwnd() const { return hwnd_; } HWND hwnd() const { return hwnd_; }