I made a simply windows app with the console still enabled and put a cout in my callback function and found that it calls my callback function everytime the mouse moves jsut a little bit, passing my pointer across the window causes my function to be called at least a hundred times, if I didn't need to do anything when the mouse is moved should I make my callback function something like for the purose of not doing much processing just for a little mouse movment
Code:
LRESULT CALLBACK MsgHandler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch(msg)
case(WM_MOUSEMOVE)://or whatever the mouse move message is
{
return(DefWindowProc(hwnd, msg, wparam, lparam));// Don't do anything cause I don't need to or call another function to handle the movement
}
default:
{
// Call another function to handle other messages
if(ScndMsgHandler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam))return (1);
else
{
return(DefWindowProc(hwnd, msg, wparam, lparam));
}
}
I'm sure I've gotten the switch case syntax wrong, but you got the idea
So that a long switch case with all the messsages doesn't have to be processed for the frequent mouse movements
I'm asking would it be a good way to do things? I'm wondering on the side of my mind how exactly a switch case is processed, how much longer it takes if more messages are added to it