Hi Jim,

I tried this and the LOGPIXELSX and LOGPIXELSY did not change on changing the font 
settings.  The values remained at 96.  Anyways, here's how I retrieved them:

1.  call the GetDesktopWindow from User32.dll:
unsigned long GetDesktopWindow(void);

2.  call GetWindowDC from User32.dll, passing the value returned from GetDesktopWindow 
above:
unsigned long GetWindowDC(unsigned long hwnd);

3a.  call GetDeviceCaps from gdi32.dll, passing the value returned from GetWindowDC 
above, and 88 as the value for LOGPIXELSX:
unsigned long GetDeviceCaps(unsigned long hdc, long LOGPIXELSX);

3b.  call GetDeviceCaps from gdi32.dll, passing the value returned from GetWindowDC 
above, and 90 as the value for LOGPIXELSY:
unsigned long GetDeviceCaps(unsigned long hdc, long LOGPIXELSY);

I also tried calling the GetTextMetrics function, and its tmHeight element (which is 
supposed to change with font setting) doesn't change either.  I always get a value of 
16 for it.  Call this from gdi32.dll, passing the value returned from GetWindowDC 
above, and a pointer to Int32: 

unsigned long GetTextMetricsA(unsigned long hdc, long *tmHeight);


Not sure why the values don't reflect the change in settings.  Hope you can dig more 
into this.  

Regards,

Khalid Ansari


-------------------------------------------
"Jim West" <[EMAIL PROTECTED]>
Sent by: <[EMAIL PROTECTED]>
03/26/2004 09:07 AM      
To: <[EMAIL PROTECTED]>
cc: 
Subject: Large Fonts


To All:

Can anyone offer any suggestions (or have a VI) to programatically
retrieve the 'Large Fonts' vs 'Small Fonts' setting in Windows?    

I stumbled around the Microsoft knowledge base for a while but only
uncovered the 'GetDeviceCaps' API.  The API seems to have a different
prototype on my machine versus what MS describes.  MS refers to
LOGPIXELSX and LOGPIXELSY but I can't seem to figure out how to retrieve
them from within LV.

Any ideas?


Jim West
Summitek Instruments



          
          


Reply via email to