Changed onWM_NOTIFY() to only pass the NMHDR * in. The LPARAM is more useful as a NMHDR *, and the WPARAM contains duplicate data (http://blogs.msdn.com/b/oldnewthing/archive/2013/12/04/10473637.aspx). Ideally we wouldn't even have the NMHDR.idFrom (see previous commit message), but oh well :/
This commit is contained in:
parent
a538412df2
commit
9016935d5e
|
@ -17,7 +17,7 @@ static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL onWM_NOTIFY(uiControl *c, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
|
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL onWM_NOTIFY(uiControl *c, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
|
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL onWM_NOTIFY(uiControl *c, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
|
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ typedef struct singleHWND singleHWND;
|
||||||
struct singleHWND {
|
struct singleHWND {
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
BOOL (*onWM_COMMAND)(uiControl *, WORD, LRESULT *);
|
BOOL (*onWM_COMMAND)(uiControl *, WORD, LRESULT *);
|
||||||
BOOL (*onWM_NOTIFY)(uiControl *, WPARAM, LPARAM, LRESULT *);
|
BOOL (*onWM_NOTIFY)(uiControl *, NMHDR *, LRESULT *);
|
||||||
void (*onWM_DESTROY)(uiControl *);
|
void (*onWM_DESTROY)(uiControl *);
|
||||||
uintptr_t parent;
|
uintptr_t parent;
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,7 @@ static LRESULT CALLBACK singleSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
||||||
return lResult;
|
return lResult;
|
||||||
break;
|
break;
|
||||||
case msgNOTIFY:
|
case msgNOTIFY:
|
||||||
if ((*(s->onWM_NOTIFY))(c, wParam, lParam, &lResult) != FALSE)
|
if ((*(s->onWM_NOTIFY))(c, (NMHDR *) lParam, &lResult) != FALSE)
|
||||||
return lResult;
|
return lResult;
|
||||||
break;
|
break;
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
|
|
|
@ -22,9 +22,8 @@ struct uiWindowsNewControlParams {
|
||||||
// ui redirects the message back and calls these functions.
|
// ui redirects the message back and calls these functions.
|
||||||
// Store the result in *lResult and return any non-FALSE value (such as TRUE) to return the given result; return FALSE to pass the notification up to your window procedure.
|
// Store the result in *lResult and return any non-FALSE value (such as TRUE) to return the given result; return FALSE to pass the notification up to your window procedure.
|
||||||
// Note that these are only issued if they come from the uiControl itself; notifications from children of the uiControl (such as a header control) will be received normally.
|
// Note that these are only issued if they come from the uiControl itself; notifications from children of the uiControl (such as a header control) will be received normally.
|
||||||
// TODO don't give WPARAM/LPARAM raw
|
|
||||||
BOOL (*onWM_COMMAND)(uiControl *c, WORD code, LRESULT *lResult);
|
BOOL (*onWM_COMMAND)(uiControl *c, WORD code, LRESULT *lResult);
|
||||||
BOOL (*onWM_NOTIFY)(uiControl *c, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
|
BOOL (*onWM_NOTIFY)(uiControl *c, NMHDR *nm, LRESULT *lResult);
|
||||||
// This is called in WM_DESTROY.
|
// This is called in WM_DESTROY.
|
||||||
void (*onWM_DESTROY)(uiControl *c);
|
void (*onWM_DESTROY)(uiControl *c);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue