From 7400cda3dad212b58ebef5cabe1d66ebc4b9d69b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 9 Apr 2015 18:54:14 -0400 Subject: Changed onWM_COMMAND() to give our controls only the notification code. We don't want to give the control the ID part of wParam because that's (or that'll be) dynamically assigned based on control parenting and prior controls; we don't want to give the control the LPARAM since that contains the window handle and uiControl already has that. --- new/newcontrol_windows.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'new/newcontrol_windows.c') diff --git a/new/newcontrol_windows.c b/new/newcontrol_windows.c index d2f4508..f95f67f 100644 --- a/new/newcontrol_windows.c +++ b/new/newcontrol_windows.c @@ -5,7 +5,7 @@ typedef struct singleHWND singleHWND; struct singleHWND { HWND hwnd; - BOOL (*onWM_COMMAND)(uiControl *, WPARAM, LPARAM, LRESULT *); + BOOL (*onWM_COMMAND)(uiControl *, WORD, LRESULT *); BOOL (*onWM_NOTIFY)(uiControl *, WPARAM, LPARAM, LRESULT *); void (*onWM_DESTROY)(uiControl *); uintptr_t parent; @@ -65,7 +65,7 @@ static LRESULT CALLBACK singleSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, switch (uMsg) { case msgCOMMAND: - if ((*(s->onWM_COMMAND))(c, wParam, lParam, &lResult) != FALSE) + if ((*(s->onWM_COMMAND))(c, HIWORD(wParam), &lResult) != FALSE) return lResult; break; case msgNOTIFY: -- cgit v1.2.3