summaryrefslogtreecommitdiff
path: root/new/checkbox_windows.c
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/checkbox_windows.c
parenta0bfb65122c5e6d32bdc32bb87591bf6210f4ac8 (diff)
Fix helper: get rid of direct casts to HWND to make errors more obvious.
Diffstat (limited to 'new/checkbox_windows.c')
-rw-r--r--new/checkbox_windows.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/new/checkbox_windows.c b/new/checkbox_windows.c
index 28433d2..951eee9 100644
--- a/new/checkbox_windows.c
+++ b/new/checkbox_windows.c
@@ -16,7 +16,7 @@ static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
return FALSE;
// we didn't use BS_AUTOCHECKBOX (see controls_windows.go) so we have to manage the check state ourselves
- hwnd = (HWND) uiControlHandle(c);
+ hwnd = uiControlHWND(c);
check = BST_CHECKED;
if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED)
check = BST_UNCHECKED;
@@ -46,7 +46,7 @@ static void onWM_DESTROY(uiControl *c)
static void preferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height)
{
- *width = uiDlgUnitsToX(checkboxXFromLeftOfBoxToLeftOfLabel, d->sys->baseX) + uiWindowsWindowTextWidth((HWND) uiControlHandle(c));
+ *width = uiDlgUnitsToX(checkboxXFromLeftOfBoxToLeftOfLabel, d->sys->baseX) + uiWindowsWindowTextWidth(uiControlHWND(c));
*height = uiDlgUnitsToY(checkboxHeight, d->sys->baseY);
}
@@ -106,7 +106,7 @@ int uiCheckboxChecked(uiControl *c)
{
HWND hwnd;
- hwnd = (HWND) uiControlHandle(c);
+ hwnd = uiControlHWND(c);
return SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED;
}
@@ -115,7 +115,7 @@ void uiCheckboxSetChecked(uiControl *c, int checked)
HWND hwnd;
WPARAM check;
- hwnd = (HWND) uiControlHandle(c);
+ hwnd = uiControlHWND(c);
check = BST_CHECKED;
if (!checked)
check = BST_UNCHECKED;