How can I store Desktop coordinates into a CRect?
Printable View
How can I store Desktop coordinates into a CRect?
Don't you know what CRect is or is your problem to obtain coordinates?
If the former - look at the DSDN article describing CRect.
If the latter - define "desktop": if it is the window which handle GetDesktopWindow returns then use this handle to GetWindowRect.
If it is something else - have a look at GetSystemMetrics, SystemParametersInfo, EnumDisplayMonitors and so on...
OK thanks, I managed to get the Desktop area.
in wndRect it is storing the right resolution. Now in SetWindowPos I have specified bottom right coordinate for the window to be placed so that i looks like MSN Messenger Alart. But somehow, the window is not getting placed over there, instead its still there in centerCode:CRect wndRect;
ShowWindow(SW_SHOW);
SystemParametersInfo(SPI_GETWORKAREA, NULL,&wndRect, NULL);
SetWindowPos(&wndTopMost, wndRect.right, wndRect.bottom, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);