Restored from previous forum. Originally posted by cor.
I have display problems when a user has the 120dpi display font selected.
Listboxes and text in buttons are not displayed correctly.
Is there an easy way to make my program work with 96 dpi and 120dpi display fonts.
Using Windows 98 SE
Registered Purebasic
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
http://www.chordplanet.com
display program correct with 96dpi and 120dpi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by El_Choni.
I would check the GetTextExtentPoint32_() API, I use it a lot to achieve what you say. Previously, use:
BTW, I use 120 dpi fonts in my computer
El_Choni
I would check the GetTextExtentPoint32_() API, I use it a lot to achieve what you say. Previously, use:
Code: Select all
hDC = GetDC_(WindowID())
hFont = GetStockObject_(#DEFAULT_GUI_FONT)
OldObject = SelectObject_(hDC, hFont)
GetTextExtentPoint32_(hDC, "My text", 7, sz.SIZE)
; now you have text width and height in pixels in
; sz\cx and sz\cy
; Use those values to set the initial
; size of your gadgets (give some air around, say 4 px).
SelectObject_(hDC, OldObject)
ReleaseDC_(WindowID(), hDC)
El_Choni
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by cor.
Thanks El_Choni
Using Windows 98 SE
Registered Purebasic
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
http://www.chordplanet.com
Thanks El_Choni
Using Windows 98 SE
Registered Purebasic
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
http://www.chordplanet.com