aboutsummaryrefslogtreecommitdiff
path: root/c/win.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/win.h')
-rw-r--r--c/win.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/c/win.h b/c/win.h
index d36cbdf..ff38ce0 100644
--- a/c/win.h
+++ b/c/win.h
@@ -5,9 +5,11 @@
#include <windows.h>
/* Display message box centered in main window. */
-int EBMessageBox(const wchar_t* wszText, const wchar_t* wszCaption, unsigned uType);
+int EBMessageBox(const wchar_t* wszText, const wchar_t* wszCaption, UINT uType);
/* Retrieve mouse position relative to given window's client area. */
int GetRelativeCursorPos(HWND hWnd, POINT* pt);
+/* Cached values from GetSystemMetrics. */
+template <int I> auto Metric = GetSystemMetrics(I);
/* Exception for Windows API errors. */
struct Win32Error : public std::exception
@@ -45,10 +47,6 @@ T* Library::GetProcAddress(const char* const szProc) noexcept
return (T*)(void*)::GetProcAddress(m_hModule, szProc);
}
-/* Variable template for caching values from GetSystemMetrics. */
-template <int I>
-auto Metric = GetSystemMetrics(I);
-
/* Check result of Windows API call, throwing error on null. */
template <typename T>
inline T Require(const T x)
@@ -97,7 +95,7 @@ inline BOOL SetWindowRect(const HWND hWnd, const RECT r)
}
/* The following functions call uxtheme.dll functions, if uxtheme.dll
- * exists, and otherwise do nothing.. */
+ * exists, and otherwise do nothing. */
inline BOOL EBIsThemeActive()
{
@@ -105,9 +103,10 @@ inline BOOL EBIsThemeActive()
return IsThemeActive? IsThemeActive(): 0;
}
-inline BOOL EBSetWindowTheme(HWND hWnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList)
+inline BOOL EBSetWindowTheme(const HWND hWnd, const wchar_t* const pszSubAppName,
+ const wchar_t* const pszSubIdList)
{
- extern BOOL (*SetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
+ extern BOOL (*SetWindowTheme)(HWND, const wchar_t*, const wchar_t*);
return SetWindowTheme? SetWindowTheme(hWnd, pszSubAppName, pszSubIdList): 0;
}