Bottom Right

T want to set a small dialog box at the bottom right of the screen.

I am using GetSystemMetrics() to get the x and y coordinates of the screen.

But I can't figure out how to make the dialog box appear perfectly on the bottom right unless I hard-code it, which is of course a non-starter due to the differing screen sizes.

This won't work --

1
2
3
4
5
6
7
8
9
cx=GetSystemMetrics(hwnd, SM_CXSCREEN);
cy=GetSystemMetrics(hwnd, SM_CYSCREEN);

GetWindowRect(hwnd, &rc);

cx=cx-rc.right;
cy=cy-rc.bottom

SetWindowPos(hwnd, NULL, cx, cy, NULL, NULL, SWP_NOSIZE


As I said, this will NOT work.

I would appreciate a little code example, if possible.
Last edited on
I used SystemParametersInfo() and it seems to work.
Topic archived. No new replies allowed.