From 0e85afb3ff745b2dd02d4417719c9aae94768c50 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 22 Apr 2016 13:52:02 -0400 Subject: [PATCH] Migrated utilwin.c. --- windows/uipriv_windows_new.hpp | 5 +++++ windows/{utilwin.c => utilwin.cpp} | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) rename windows/{utilwin.c => utilwin.cpp} (87%) diff --git a/windows/uipriv_windows_new.hpp b/windows/uipriv_windows_new.hpp index 55663a10..f8797dad 100644 --- a/windows/uipriv_windows_new.hpp +++ b/windows/uipriv_windows_new.hpp @@ -54,3 +54,8 @@ extern int nCmdShow; extern HFONT hMessageFont; extern HBRUSH hollowBrush; extern uiInitOptions options; + +// utilwin.cpp +extern HWND utilWindow; +extern const char *initUtilWindow(HICON hDefaultIcon, HCURSOR hDefaultCursor); +extern void uninitUtilWindow(void); diff --git a/windows/utilwin.c b/windows/utilwin.cpp similarity index 87% rename from windows/utilwin.c rename to windows/utilwin.cpp index 203e783e..68f4a0ce 100644 --- a/windows/utilwin.c +++ b/windows/utilwin.cpp @@ -1,5 +1,5 @@ // 14 may 2015 -#include "uipriv_windows.h" +#include "uipriv_windows.hpp" // The utility window is a special window that performs certain tasks internal to libui. // It is not a message-only window, and it is always hidden and disabled. @@ -26,7 +26,6 @@ static LRESULT CALLBACK utilWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, L return lResult; switch (uMsg) { case WM_QUERYENDSESSION: - case msgConsoleEndSession: // TODO block handler if (shouldQuit()) { uiQuit(); @@ -37,7 +36,7 @@ static LRESULT CALLBACK utilWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, L if (wParam != resizeTimerID) break; if (SetTimer(utilWindow, resizeTimerID, resizeTimerInterval, NULL) == 0) - logLastError("error resetting resize timer in utilWindowWndProc()"); + logLastError(L"error resetting resize timer"); doResizes(); return 0; case WM_WININICHANGE: @@ -84,9 +83,9 @@ const char *initUtilWindow(HICON hDefaultIcon, HCURSOR hDefaultCursor) void uninitUtilWindow(void) { if (KillTimer(utilWindow, resizeTimerID) == 0) - logLastError("error stopping resize timer in uninitUtilWindow()"); + logLastError(L"error stopping resize timer"); if (DestroyWindow(utilWindow) == 0) - logLastError("error destroying utility window in uninitUtilWindow()"); + logLastError(L"error destroying utility window"); if (UnregisterClass(utilWindowClass, hInstance) == 0) - logLastError("error unregistering utility window class in uninitUtilWindow()"); + logLastError(L"error unregistering utility window class"); }