Windows 7 sizing

Windows specific forum
noorderling
User
User
Posts: 16
Joined: Fri Jul 16, 2010 3:54 pm

Re: Windows 7 sizing

Post 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.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Windows 7 sizing

Post 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?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Windows 7 sizing

Post 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

User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Windows 7 sizing

Post by blueznl »

Ah, yes, that might do, gonna' try that tonight!
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply