` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Windows API: Get font size resolution
2003-04-29 -- Jeff Berlinghoff
 
Newsgroups: comp.lang.clarion > Can anyone recomment the best call to use to determine the screen resolution > and font size use? Can't say this is the *best* way, but it worked for me. I assume when you say font size, you mean Large Fonts or not? To determine if large fonts are in use, I used: GetDeviceCaps(UNSIGNED, UNSIGNED),UNSIGNED,PASCAL GetDC(UNSIGNED),UNSIGNED,PASCAL ReleaseDC(UNSIGNED,UNSIGNED),UNSIGNED,PASCAL Sample code: sh=SYSTEM{Prop:Handle} HDC=GetDC(sh) fGDC=90 LargeFonts=CHOOSE(GetDeviceCaps(HDC,fGDC)=120,1,0) sh=ReleaseDC(sh,HDC) To determine the area you have to (re)draw your window in: SystemParametersInfo(UShort,UShort,*?,UShort),UShort,Pascal,Raw,| Name('SystemParametersInfoA') WorkArea GROUP,PRE(WA) X Signed Y Signed Width Signed Height Signed END IF ~SystemParametersInfo(48,0,WorkArea,0) RETURN END ! now you can inspect the WorkArea coordinates > I need to get this information for automatic window sizing. I went down this path in Clarion4. Was fun, but never quite completed it. Good luck. Jeff Berlinghoff P.S. You might also want to subclass your windows and watch for event WM_DISPLAYCHANGE (0x007E) so that you can respond to the user changing resolutions while your app is running.


Today is May 12, 2024, 10:31 am
This article has been viewed 35121 times.
Google search has resulted in 37 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: