aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-01-31 10:28:07 +1100
committerNeil <nyamatongwe@gmail.com>2020-01-31 10:28:07 +1100
commitec4efb9730d205cce09277844521ac2ed6288778 (patch)
treeeb370da5dc74ab4232dc2593b951f36ac9bf32cf /win32/PlatWin.h
parentbd97651f7bb7e7c1b6df6e57c2a2d6ab93da1d46 (diff)
downloadscintilla-mirror-ec4efb9730d205cce09277844521ac2ed6288778.tar.gz
Use more typesafe functions to remove casts.
Diffstat (limited to 'win32/PlatWin.h')
-rw-r--r--win32/PlatWin.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/win32/PlatWin.h b/win32/PlatWin.h
index 62b87fa3c..6fb8ff5f1 100644
--- a/win32/PlatWin.h
+++ b/win32/PlatWin.h
@@ -19,6 +19,14 @@ constexpr RECT RectFromPRectangle(PRectangle prc) noexcept {
return rc;
}
+constexpr HWND HwndFromWindowID(WindowID wid) noexcept {
+ return static_cast<HWND>(wid);
+}
+
+inline HWND HwndFromWindow(const Window &w) noexcept {
+ return HwndFromWindowID(w.GetID());
+}
+
#if defined(USE_D2D)
extern bool LoadD2D();
extern ID2D1Factory *pD2DFactory;