Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Windows Large Font

wkramer
Beginner
890 Views
Hello,
I know this is probably not the correct forum for this windows question, but I am using IVF and in my experience this forum gives the quickest and best answers.
I havean SDI program for which I set the main window with at a fixed value of 450 device units at 96 logical pixels/logical inch with CreateWindowsEx.
In this situation a child dialog exactly fits the client area.
Problem is that if a user uses large system fonts, the child dialog grows outside the client area.
I tried to solve this by determining the actual logical pixels per logical inch at start up through GetDeviceCaps, and then set the main window width to 450*iLogPixels/96 with CreateWindowEx.
But it appears that this is not enough, the child window grows even more than the iLogPixels/96 I expected. Mapping is set to MM_TEXT.
What am I missing?
Regards,
Walter Kramer
By the way is version 5.5 or higher required for this forum? I had problems using version 5.0 (slow employer).
0 Kudos
2 Replies
Steven_L_Intel1
Employee
890 Views
MSIE 5.0 should be sufficient - you can let me know by e-mail (steve.lionel@intel.com) what problems you have with 5.0. I'll let someone else handle the font question.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
890 Views
Large fonts problems tend to be tricky to solve...
Walter, as far as I know (I'm not 100% sure), GetDeviceCaps(LOGPIXELSX) will always return 96 for a screen DC no matter what are font settings. Instead, take a look at GetDialogBaseUnits and MapDialogRect.
Instead, I suggest that you take a different approach instead of calculating tricky DLUs into pixels and vice versa. First,create & runthe child dialog (hidden if you prefer), and then query its size via GetWindowRect. When you find out what's its size, you can use AdjustWindowRect(Ex) to find out what should be the size of its parent window so that the child fits into its client area perfectly. You can do most of it while the windows are hidden so that the user does not observe the resizing process.
Jugoslav
P.S. I'm accidentally on the job tonight and I go to vacation tomorrow so I won't be available for a while. Hope this helps.
0 Kudos
Reply