- Resizing Edit Ctrl and Large Sys Font
- Posted by Gary Larimer on April 5th, 2008
If a user selects Large system font (120 DPI) in the advance setting
of the display applet, then Windows automatically scales up Dlg box
controls and text at run time.
However, if the app resizes and moves a ctrl in the Dlg box with
MoveWindow() then the font associated with the ctrl is not scaled. Is
this normal? If so, what is the easyiest way to scale the font for
120 DPI?
Thanks for any info\comments.
- Posted by Kellie Fitton on April 6th, 2008
On Apr 5, 4:12*pm, Gary Larimer <garylari...@yahoo.com> wrote:
Hi,
Well, if you are using the API MoveWindow() for example to move
controls on the dialog box at runtime, you will be using values in
pixels,
which will not change along with the screen DPI. Instead, you should
define your position in DLUs, then use the function MapDialogRect() to
convert the DLUs to pixels, then you can pass those values to your
functions MoveWindow(), CreateWindow(), etc....
http://msdn2.microsoft.com/en-us/library/ms645502.aspx
http://support.microsoft.com/kb/q124315/
Kellie.
- Posted by Gary Larimer on April 6th, 2008
On Apr 6, 4:09*am, Kellie Fitton <KELLIEFIT...@yahoo.com> wrote:
Thanks Kellie, the two links you provided helped explain a lot.
- Posted by Bob Masta on April 6th, 2008
On Sat, 5 Apr 2008 16:12:16 -0700 (PDT), Gary Larimer
<garylarimer@yahoo.com> wrote:
Perhaps not what you are looking for, but I use a "cheap and dirty"
approach to allow users to set the size of my app (including dialog
fonts) by specifying a font size in Preferences. (They have to
re-start the app after a change.) Then at start-up I parse through
the resource and change the font sizes for each dialog before Windows
gets the resource. Simple but effective.
Best regards,
Bob Masta
DAQARTA v3.50
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Scope, Spectrum, Spectrogram, FREE Signal Generator
Science with your sound card!