Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default monitor small/large font code

Need code to determine the monitor/screen setting 'small font' or 'large font'
I have code for screen resolution
In Control Panel, 'Display', my 'Settings' advanced tab shows 'small font 96 dpi normal'

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default monitor small/large font code

Sub GetScreenFont()
MsgBox GetDeviceCaps(GetDC(0), 88), vbOKOnly _
+ vbInformation, "Screen Font Size"
End Sub

Assuming you have already declared the GetDC and GetDeviceCaps functions to
get the screen resolution.

--

Vasant

"Tom Rudski" wrote in message
...
Need code to determine the monitor/screen setting 'small font' or 'large

font'.
I have code for screen resolution.
In Control Panel, 'Display', my 'Settings' advanced tab shows 'small font

96 dpi normal'.

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default monitor small/large font code

Make sure that you release the DC, see
http://msdn.microsoft.com/library/de...vcons_4esj.asp

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Sub GetScreenFont()
MsgBox GetDeviceCaps(GetDC(0), 88), vbOKOnly _
+ vbInformation, "Screen Font Size"
End Sub

Assuming you have already declared the GetDC and GetDeviceCaps functions

to
get the screen resolution.

--

Vasant

"Tom Rudski" wrote in message
...
Need code to determine the monitor/screen setting 'small font' or 'large

font'.
I have code for screen resolution.
In Control Panel, 'Display', my 'Settings' advanced tab shows 'small

font
96 dpi normal'.

TIA





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default monitor small/large font code

Hi Bob:

I didn't realize the DC needed to be released if you weren't doing anything
with it (besides getting the handle), but my API knowledge would probably
fit on the head of a pin <g.

Regards,

Vasant.

"Bob Phillips" wrote in message
...
Make sure that you release the DC, see

http://msdn.microsoft.com/library/de...vcons_4esj.asp

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Sub GetScreenFont()
MsgBox GetDeviceCaps(GetDC(0), 88), vbOKOnly _
+ vbInformation, "Screen Font Size"
End Sub

Assuming you have already declared the GetDC and GetDeviceCaps functions

to
get the screen resolution.

--

Vasant

"Tom Rudski" wrote in message
...
Need code to determine the monitor/screen setting 'small font' or

'large
font'.
I have code for screen resolution.
In Control Panel, 'Display', my 'Settings' advanced tab shows 'small

font
96 dpi normal'.

TIA







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default monitor small/large font code

Hi Vasant,

you probably haven't run into the problems that can arise, so it didn't
seem like an issue. Defensive programming<vbg

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Hi Bob:

I didn't realize the DC needed to be released if you weren't doing

anything
with it (besides getting the handle), but my API knowledge would probably
fit on the head of a pin <g.

Regards,

Vasant.

"Bob Phillips" wrote in message
...
Make sure that you release the DC, see


http://msdn.microsoft.com/library/de...vcons_4esj.asp

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Sub GetScreenFont()
MsgBox GetDeviceCaps(GetDC(0), 88), vbOKOnly _
+ vbInformation, "Screen Font Size"
End Sub

Assuming you have already declared the GetDC and GetDeviceCaps

functions
to
get the screen resolution.

--

Vasant

"Tom Rudski" wrote in message
...
Need code to determine the monitor/screen setting 'small font' or

'large
font'.
I have code for screen resolution.
In Control Panel, 'Display', my 'Settings' advanced tab shows 'small

font
96 dpi normal'.

TIA










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default monitor small/large font code

Here's a slightly modified bit of code from Randy Birch

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
' Copyright ©1996-2004 VBnet, Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
Private Declare Function GetDesktopWindow Lib "user32" _
() As Long

Private Declare Function GetDC Lib "user32" _
(ByVal hwnd As Long) As Long

Private Declare Function GetDeviceCaps Lib "gdi32" _
(ByVal hdc As Long, _
ByVal nIndex As Long) As Long

Private Declare Function ReleaseDC Lib "user32" _
(ByVal hwnd As Long, _
ByVal hdc As Long) As Long
Private Const LOGPIXELSX = 88
Private Const LOGPIXELSY = 90


Public Function ScreenFont() As String
Dim hWndDesk As Long
Dim hDCDesk As Long
Dim logPix As Long

'get the handle to the desktop window
hWndDesk = GetDesktopWindow()

'get the handle desktop display context (hDC)
hDCDesk = GetDC(hWndDesk)

'get the horizontal logical pixels
logPix = GetDeviceCaps(hDCDesk, LOGPIXELSX)

'release the hDC
Call ReleaseDC(hWndDesk, hDCDesk)

'if the return from GetDeviceCaps is 96, then
'the system is using small fonts.
If logPix = 96 Then
ScreenFont = "Small"
Else
ScreenFont = "Large"
End If

End Function

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tom Rudski" wrote in message
...
Need code to determine the monitor/screen setting 'small font' or 'large

font'.
I have code for screen resolution.
In Control Panel, 'Display', my 'Settings' advanced tab shows 'small font

96 dpi normal'.

TIA



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Large / Small :)[_2_] Excel Discussion (Misc queries) 5 January 6th 10 02:08 PM
Font & Cell colors are not showing up on my monitor in Excel. Tawnia (Tawn'ya) Setting up and Configuration of Excel 2 February 2nd 07 02:42 PM
spreadsheet prints so small even with large font steve1 Excel Discussion (Misc queries) 3 July 18th 06 06:29 AM
SMALL and LARGE Tonto Excel Discussion (Misc queries) 6 October 27th 05 07:02 AM
How to display multiple pages on one large monitor mrkrug3 Excel Discussion (Misc queries) 1 June 24th 05 01:33 AM


All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"