|
-
Jul 13th, 2000, 02:12 AM
#1
Thread Starter
Lively Member
In VB 6.0 how can I detect for Small font or Large Font setting.
-
Jul 13th, 2000, 07:52 AM
#2
Addicted Member
Here try this... it's a function that I made a while ago to get the font setting even if a custom size is used. it returns the percentage of the font ie. small font is 96 dpi or 100% and large font is 120 dpi or 125%... I use it for helping to control screen resolution issues from computer to computer...
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" _
(ByVal hwnd As Long, ByVal hdc As Long) As Long
Const LOGPIXELSX = 88
'size of small font
Const SmallFont = 96 'dpi (100%)
Private Function ScreenFont() As Long
'get the font size (in %) that is being used on the current computer
Dim hWnd, hDC, logPix, r As Long
hWnd = GetDesktopWindow()
hDC = GetDC(hWnd)
logPix = GetDeviceCaps(hDC, LOGPIXELSX)
r = ReleaseDC(hWnd, hDC)
ScreenFont = logPix
End Function
-
Jul 14th, 2000, 12:53 AM
#3
Thread Starter
Lively Member
Thax indeed for that :-). thats fast reply. hmmm!!!
I was using the following technique quite while now using the following one line .....
If GetSystemMetrics(15) <> 19 And QueryValue(HKEY_LOCAL_MACHINE, Config\0001\Display\Settings", "DPIPhysicalX") <> 96 Then
msgbox "This Application works only with system font set to SMALL fonts."
End
End If
.........until i received a call that it worked otherwise. thats how i pressed the panick button. but anyway i will try these. please let me know whats wrong with the above ones...
-
Jul 21st, 2001, 12:05 AM
#4
Hyperactive Member
Ok... so this tells us what the font scaling is. I have designed my program and it looks really screwed up if the user uses anything other than small fonts... what can I do to change the font scaling? Is there an API that I can call to set the font scaling to 100% (96 dpi) for use in my program?
If not... any ideas on scaling information?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|