0

Hi, trying to simply plot a point when the user clicks my window, but the WM_LBUTTONDOWN even seems to be triggered no matter what input i give the program...letter keys, tab, pgup, spacebar, Everything! I don't understand what is going on =/

Im catching the even like this in the WndProc of a standard Win32 app:

switch(Msg)
{
case WM_LBUTTONDOWN:
MessageBox(hWnd,"LBUTTONDOWN"," ",0);
InvalidateRect(hWnd, NULL, TRUE);
UpdateWindow(hWnd);
break;
}

can anyone help me refine this somehow? I'm looking for an On Mouse Down event, that will provide X and Y of the mouse.

Thanks!:)

Edited by happygeek: fixed formatting

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by VBNick
0

Oooookay, I got it working like this:

case WM_LBUTTONDOWN:
if(wParam == MK_LBUTTON)
{
//MessageBox(hWnd,"LBUTTONDOWN"," ",0);
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
}
InvalidateRect(hWnd, NULL, TRUE);
UpdateWindow(hWnd);
break;

funny I hardly think to just check the MSDN library...back in my newbie vb days I couldn't make heads or tails of that stuff :-/

I would appreciate any more comments that anyone might have...I'm still curious WM_LBUTTONDOWN receives all those messages and why I have to check for a "virtual key"
but It works for now :icon_cheesygrin:

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.