Click here to Skip to main content
15,888,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Does anyone know a possibility of changing the view on a Modal Dialog?
e.g. the Dialog has a size of 1660x2000,
the screen size is 166x200,

I would like to quickly change the origin (0,0) of the CDialog to (167,0) for example or (167,201)

My first attempt was like this:

CRect r1;
GetDlgItem(IDD_DIALOG1)->GetWindowRect(r1);
r1.MoveToX(r1.TopLeft().x+166);
r1.MoveToY(r1.TopLeft().y+200);
GetDlgItem(IDD_DIALOG1)->MoveWindow(r1);

...this won't work / i get an error at (debug-) runtime.

any help / suggestions would be welcome!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900