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.
Printable View
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.
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
Cwnd::CenterWindow()
Sally
CentreWindow() centers relative to the parent window. To centre the window relative to the screen, use
CenterWindow(CWnd::GetDesktopWindow());
Dave