Page 2 of 2

Re: Windows 7 sizing

Posted: Wed Jan 19, 2011 11:53 am
by noorderling
There's a lot to be said for both views. But in the end it is MS that dictates what we have to do, even if they caused the problem . And the dpi scaling in Vista/W7 caused a lot of problems. MS says that you have to code dpi-aware, and calls it 'best practice', the usual term they use when they messed up ( the other one is: 'this behaviour is by design ... ). So be it ... you may agree or disagree ( I disagree ) but in the end I have to code for the user.

As for XP-style: I leave it on. IMO it is up to the user to decide what kind of interface he/she prefers. As for scaling things: I use GetDeviceCaps_(GetDC_(0), #LOGPIXELSX) to calculate a scale, and a macro to scale my gadgets/fonts/windows etc. I do need to thank Rescator here for pointing the right direction in his thread.

Re: Windows 7 sizing

Posted: Wed Jan 19, 2011 1:12 pm
by blueznl
Fooling around with this, I'm running in a specific problem: how to retrieve the actual font and font size? I've found some code, but it wasn't always accurate. Any suggestions?

Re: Windows 7 sizing

Posted: Thu Jan 20, 2011 2:27 pm
by Trond
blueznl wrote:Fooling around with this, I'm running in a specific problem: how to retrieve the actual font and font size? I've found some code, but it wasn't always accurate. Any suggestions?
The actual font and font size of what and in what units?

Maybe this helps?

Code: Select all



CreateImage(0, 10, 10, 32)
FontID = GetGadgetFont(#PB_Default)
hDC = StartDrawing(ImageOutput(0))
  SelectObject_(hDC, FontID)
  GetTextMetrics_(hDC, @Metrics.TEXTMETRIC)
StopDrawing()

CallDebugger


Re: Windows 7 sizing

Posted: Fri Jan 21, 2011 10:33 am
by blueznl
Ah, yes, that might do, gonna' try that tonight!