summaryrefslogtreecommitdiff
path: root/new/ui_windows.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-12 23:14:56 -0400
committerPietro Gagliardi <[email protected]>2015-04-12 23:14:56 -0400
commitf726b74d32baf3002b5656591029f34168027e16 (patch)
tree0adf9a657fb81b9bba2d0e0d9c29db2692fb06e2 /new/ui_windows.h
parenta0bfb65122c5e6d32bdc32bb87591bf6210f4ac8 (diff)
Fix helper: get rid of direct casts to HWND to make errors more obvious.
Diffstat (limited to 'new/ui_windows.h')
-rw-r--r--new/ui_windows.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/new/ui_windows.h b/new/ui_windows.h
index 0fba593..70badb4 100644
--- a/new/ui_windows.h
+++ b/new/ui_windows.h
@@ -7,6 +7,10 @@ This file assumes that you have included <windows.h> and "ui.h" beforehand. It p
#ifndef __UI_UI_WINDOWS_H__
#define __UI_UI_WINDOWS_H__
+// Correctness macros.
+#define uiControlHWND(c) ((HWND) uiControlHandle(c))
+#define uiParentHWND(p) ((HWND) uiParentHandle(p))
+
// uiWindowsNewControl() creates a new uiControl with the given Windows API control inside.
// You will need to provide the preferredSize() method yourself.
typedef struct uiWindowsNewControlParams uiWindowsNewControlParams;