aboutsummaryrefslogtreecommitdiff
path: root/c/win.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-09-02 02:11:49 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-09-02 02:14:11 +0200
commit90c7bc237c9cf964c16f0cb48c308a92a8193a5c (patch)
tree53f165056dffa061a9dfe39b76913edab87056f4 /c/win.cpp
parentbb9280267bfb78a8d69adea02f5ed7894833b19d (diff)
downloadEpisodeBrowser-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.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/c/win.cpp b/c/win.cpp
index e1349bc..40d68e4 100644
--- a/c/win.cpp
+++ b/c/win.cpp
@@ -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