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!:)

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:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.