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
commit98d89d81e17940ae5643f0db53734defa9610599 (patch)
tree8e5553e82ca5fef9c411507288def1719cdb3e45 /win32/PlatWin.h
parent63b27273a238f69bcd6623e5dc966cf304bf9e1f (diff)
downloadscintilla-mirror-98d89d81e17940ae5643f0db53734defa9610599.tar.gz
Backport: Use more typesafe functions to remove casts.
Backport of changeset 7966:2f6615753946.
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 cf357f72d..01e321e4c 100644
--- a/win32/PlatWin.h
+++ b/win32/PlatWin.h
@@ -15,6 +15,14 @@ extern void Platform_Finalise(bool fromDllMain);
RECT RectFromPRectangle(PRectangle prc) noexcept;
+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;