C++/absolute coordinate of mouse pointer ...
I want to write a program which tells me the (absolute) coordinate of where the mouse is clicked on(POINT data structure) or where the mouse is located. This coordinate can be outside the boundaries of my application's form.
Microsoft visual studio 6 has a tool, called SPY++, which does a somehow similar task: it retrieves the handle of the window above which the mouse is moving.
My probblem is that when the mouse is clicked somewhere I lose the focus in my application. What should I do to solve this problem(losing the focus OnClick)?
thank you very very much.
If you make a POINT object and pass it to the function GetCursorPos it will fill out the structure with the absolute mouse points.
I know one way to test focuses, like in your WinMain, you can do :
if(GetFocus() == hWnd)
to test if youre inside the current window.
I hope this was helpful