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. Resizing dialog doesn't work if display changes

Resizing dialog doesn't work if display changes

Scheduled Pinned Locked Moved C / C++ / MFC
c++cssvisual-studioquestion
4 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.
  • D Offline
    D Offline
    Donguy1976
    wrote on last edited by
    #1

    Hello all, I have a MFC app being developed on VS 6.0 I added code to dynamically change the size of the dialog when a check box is checked. i.e., it hides some controls and then resizes the dialog to show only less controls. And this works fine in one display setting. And i am running it on Windows 7 and mydisplay is Medium - 125% If i go to display settings and change the type to Smaller - 100% or Larger - 150%, then resizing completely screws up and some controls are not shown at all. I figured that with change in display setting the resizing takes the controls to different positions that it goes out of scope of dialog. Is there a way around? Any way of locking the controls irrespective of change in display settings? Thanks in advance.

    _ 1 Reply Last reply
    0
    • D Donguy1976

      Hello all, I have a MFC app being developed on VS 6.0 I added code to dynamically change the size of the dialog when a check box is checked. i.e., it hides some controls and then resizes the dialog to show only less controls. And this works fine in one display setting. And i am running it on Windows 7 and mydisplay is Medium - 125% If i go to display settings and change the type to Smaller - 100% or Larger - 150%, then resizing completely screws up and some controls are not shown at all. I figured that with change in display setting the resizing takes the controls to different positions that it goes out of scope of dialog. Is there a way around? Any way of locking the controls irrespective of change in display settings? Thanks in advance.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You would need to make your application DPI Aware. Here is the documentation - Writing High-DPI Win32 Applications[^]

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++) (October 2009 - September 2013)

      Polymorphism in C

      D 1 Reply Last reply
      0
      • _ _Superman_

        You would need to make your application DPI Aware. Here is the documentation - Writing High-DPI Win32 Applications[^]

        «_Superman_»  _I love work. It gives me something to do between weekends.

        _Microsoft MVP (Visual C++) (October 2009 - September 2013)

        Polymorphism in C

        D Offline
        D Offline
        Donguy1976
        wrote on last edited by
        #3

        When i try to call SetProcessDPIAware from inside the InitInstance fucntion of the app, it says the fucntion - error C2065: 'SetProcessDPIAware' : undeclared identifier Why is it so? Btw, this is a MFC app being developed in Visual Studio 6. Is there a different way to set it DIPaware?

        _ 1 Reply Last reply
        0
        • D Donguy1976

          When i try to call SetProcessDPIAware from inside the InitInstance fucntion of the app, it says the fucntion - error C2065: 'SetProcessDPIAware' : undeclared identifier Why is it so? Btw, this is a MFC app being developed in Visual Studio 6. Is there a different way to set it DIPaware?

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          The API is only supported from Windows Vista and above. So you need to define the following macros as below -

          _WIN32_WINNT = 0x0600
          WINVER = 0x0600

          «_Superman_»  _I love work. It gives me something to do between weekends.

          _Microsoft MVP (Visual C++) (October 2009 - September 2013)

          Polymorphism in C

          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