Page 1 of 1

Posted: Tue Mar 04, 2003 9:26 pm
by BackupUser
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

Posted: Wed Mar 05, 2003 1:02 am
by BackupUser
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:

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)
BTW, I use 120 dpi fonts in my computer

El_Choni

Posted: Wed Mar 05, 2003 6:41 am
by BackupUser
Restored from previous forum. Originally posted by Fangbeast.

Thanks El_Choni, I've had someone whinging about the size of my projects, he uses 120 DPI and I didn't know what I should do about it either:)

We are Dyslexic of Borg, prepare to have your ass laminated!

Posted: Wed Mar 05, 2003 7:11 am
by BackupUser
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