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