Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Modeless Dialog Window placement problem

Modeless Dialog Window placement problem

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpgraphicsworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kwanalouie
    wrote on last edited by
    #1

    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!

    M 1 Reply Last reply
    0
    • K Kwanalouie

      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!

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Hard-coded coordinates in multi-monitor environments is not necessarily a good idea :) Maybe some useful info here: Multiple Display Monitors[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups