Inside a case WM_RBUTTONUP, how do i set to variables the exact position of the mouse cursor when the button is released?
Will the cordinates be the same on any windows resolution?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Key Kip, that what im using. Im getting x/y position with GetCursorPosition to a Point sctructure. I was wondering for example how could i set that values in order for my app to start centralized in any screen resolution
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Inside a case WM_RBUTTONUP, how do i set to variables the exact position of the mouse cursor when the button is released?
Will the cordinates be the same on any windows resolution?
x = LOWORD(lParam));
y = HIWORD(lParam));
Depands on what you mean by same: 400 pixels from the left side is 400 regardless of resolution.
But obviously pixels on a screen vary in postion based upon resolution.
You could use a real world based co-ordinate system; I guess that would allow you to keep positions on the screen the same regardless of resolution.
Derek
GetCursorPosition();
Kip
Key Kip, that what im using. Im getting x/y position with GetCursorPosition to a Point sctructure. I was wondering for example how could i set that values in order for my app to start centralized in any screen resolution
// Create window...
hwnd = CreateWindowEx(WS_EX_0, g_szAppName, g_szAppName, WS_OVERLAPPED | WS_SYSMENU, (GetSystemMetrics(SM_CXSCREEN) - VUPDATE_WIDTH)/2, (GetSystemMetrics(SM_CYSCREEN)-VUPDATE_HEIGHT)/2, VUPDATE_WIDTH, VUPDATE_HEIGHT, NULL, NULL, hInstance, NULL);
=)
Kip