Click here to Skip to main content
15,885,669 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using the MS Shell Dlg font in size 8 in a dialog.

I've noticed that Edit and Static Controls in the dialog are displaying with a different font
height on different machines (both running Win7). E.g. with a height of -13 on one machine and a height of -11 on another machine.

I'm trying to figure out what is causing this change.
I thought that by default DPI scaling is enabled. Therefore LOGPIXELSY should return the same value on any machine.

I thought that it would just use the overall dialog font and size for all child controls. But it appears to be picking its own sizes for the child controls.

Any ideas on what is causing this? Also how can I easily make all dialog controls conform to a consistent font size accross machines? Do I need to use WM_SETFONT for every single control in every single dialog?

One other thing. Is there a way to get say the default dialog font for an edit control and a static control without actually creating a dialog?
Posted
Updated 13-Mar-13 14:35pm
v2
Comments
Eugen Podsypalnikov 14-Mar-13 3:40am    
// Do I need to use WM_SETFONT for every single control in every single dialog?
Please try it, for a single control. What is the result of this test, please ? :)
Richard MacCutchan 14-Mar-13 5:31am    
Have you checked that all system settings on both machines are exactly the same: DPI, screen and font sizes?
Dhiraj Pallin 18-Mar-13 11:35am    
On further investigation, it seems that IsProcessDPIAware() is returning TRUE. This is strange because:
1) I have not called SetProcessDPIAware() anywhere in my program.
2) Manifest Tool -> Input and Output -> Enable DPI Awareness is set to No in Visual Studio.
3) There is nothing in my Manifest file relating to DPI Awareness
4) 'Disable Display Scaling on High DPI Settings' is not ticked in the Compatiblity properties of the executable.

So I have no idea where or how it's getting enabled.
Dhiraj Pallin 18-Mar-13 11:59am    
On even further investigation. It seems that _any_ Win32 project I create in VS 2010 has IsProcessDPIAware() returning TRUE. This seems fairly in conflict with the WinAPI documentation. Any ideas?

1 solution

Somehow DPI awareness is getting enabled. So I've posted a seperate follow-up question related to this.
 
Share this answer
 

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