Jump to content
Sign in to follow this  
lrstndm

What are the default _WinAPI_CreateFont(...) values

Recommended Posts

lrstndm

I have a Listview in a GUI control.

I'm changing the text font using the _WinAPI_CreateFont(...) method, but when I want to set it back to default I don't know the values.

How can I get these values, or what are the values?

Thanks.

regards,

lrstndm

Edited by lrstndm

Share this post


Link to post
Share on other sites
Artisan

The default values can vary, depending on what version of Windows is running and what theme is applied (can vary from user to user on the same machine).

It's much better to just save the old font when you switch it.  _WinAPI_SelectObject() returns the pre-existing value that's being over-written, so an example is:

$hOldFont = _WinAPI_SelectObject($hDC, $NewFont)

You only need to do that the first time your script selects a different font.

 

Then, when you're releasing the font you made, you do this:

_WinAPI_SelectObject($hDC, $hOldFont)
_WinAPI_DeleteObject($hNewFont)

This restores the original font to the device context.

Edited by Artisan

Share this post


Link to post
Share on other sites
FireFox

For default values and everything related to the CreateFont function, see here.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
lrstndm

Thank you Artisan and FireFox, I will look at it:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×