Modeless Dialog Window placement problem
-
Using Visual C++ 6.0 MFC in SDI application I have a modeless dialog box that I display on the left side of the screen, and my program does some drawing to the right of that dialog box. A friend ran my program on his PC setup. His setup has a dual monitor setup, where he can scroll horizontally from one monitor to the other. When he runs my code, the main window shows up on one monitor screen and the modeless dialog appears on the other monitor screen. He has to drag the modeless dialog box to the screen where we do the drawing. We would like them to appear on the same screen without having to drag the modeless dialog box to the other screen. I don't know if there is something I am doing wrong in the code or whether his dual monitor setup has a problem. The code I use to place the modeless dialog box is: BOOL CTestDialogBox::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here SetWindowPos(NULL,10,100,0,0,SWP_NOSIZE | SWP_NOZORDER); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } Thanks for any help!
-
Using Visual C++ 6.0 MFC in SDI application I have a modeless dialog box that I display on the left side of the screen, and my program does some drawing to the right of that dialog box. A friend ran my program on his PC setup. His setup has a dual monitor setup, where he can scroll horizontally from one monitor to the other. When he runs my code, the main window shows up on one monitor screen and the modeless dialog appears on the other monitor screen. He has to drag the modeless dialog box to the screen where we do the drawing. We would like them to appear on the same screen without having to drag the modeless dialog box to the other screen. I don't know if there is something I am doing wrong in the code or whether his dual monitor setup has a problem. The code I use to place the modeless dialog box is: BOOL CTestDialogBox::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here SetWindowPos(NULL,10,100,0,0,SWP_NOSIZE | SWP_NOZORDER); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } Thanks for any help!
Hard-coded coordinates in multi-monitor environments is not necessarily a good idea :) Maybe some useful info here: Multiple Display Monitors[^]