diff options
author | John Ankarström <john@ankarstrom.se> | 2022-09-02 02:11:49 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-09-02 02:14:11 +0200 |
commit | 90c7bc237c9cf964c16f0cb48c308a92a8193a5c (patch) | |
tree | 53f165056dffa061a9dfe39b76913edab87056f4 /c/win.cpp | |
parent | bb9280267bfb78a8d69adea02f5ed7894833b19d (diff) | |
download | EpisodeBrowser-90c7bc237c9cf964c16f0cb48c308a92a8193a5c.tar.gz |
Use global Window object.
This makes it easier to control initialization and maintain RAII.
Diffstat (limited to 'c/win.cpp')
-rw-r--r-- | c/win.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4,6 +4,7 @@ #include <windows.h> #include <wininet.h> +#include "main.h" #include "util.h" #include "win.h" @@ -86,9 +87,9 @@ static void CenterNextWindow(HWND hWnd) int EBMessageBox(const std::wstring_view text, const std::wstring_view caption, const UINT uType) { - extern HWND g_hWnd; - CenterNextWindow(g_hWnd); - return MessageBox(g_hWnd, text.data(), caption.data(), uType); + extern Window* g_window; + CenterNextWindow(g_window->hWnd); + return MessageBox(g_window->hWnd, text.data(), caption.data(), uType); } void ShowException(const wchar_t* const fmt, const wchar_t* const title, const UINT uType) noexcept |