Click to See Complete Forum and Search --> : screensize


fwehlin
April 29th, 1999, 06:44 PM
Hi, I´ve created a popup-dialog that I want to be center on the screen. What fuction will give me the screensize? I want it to be centered in all screenresolutions. Please help me.

Frederik.

April 29th, 1999, 08:25 PM
if you do
SetCursorPos(2000,2000);
the cursor go at this position, but because screen is shorter
like 800,600 the cursor don't go farther, you have to do
GetCursorPos you will know wath is the bottom right corner
and the rest should be easy.

BOOL GetCursorPos(
LPPOINT lpPoint // address of structure for cursor position
);
you have to include winuser.h

sally
April 29th, 1999, 10:15 PM
Cwnd::CenterWindow()

Sally

Sally
April 29th, 1999, 10:15 PM
Cwnd::CenterWindow()

Sally

Dave Lorde
April 30th, 1999, 05:40 AM
CentreWindow() centers relative to the parent window. To centre the window relative to the screen, use

CenterWindow(CWnd::GetDesktopWindow());

Dave