Jump to content

Get system font and color info!


CyberSlug
 Share

Recommended Posts

The ATTACHED include file creates a bunch of constants that you can use to get font and color information for the current display settings. (I've only tested on Windows XP, so let me know if things don't work on Windows 9x/Me.)

You can now make text match the user's preferred font instead of using 8 point MS Sans Serif 8 :lmao:

Example usage:

#include <GuiConstants.au3>
#include "GuiFontAndColors.au3"

GuiCreate("Example", 300, 200)
GuiSetBkColor($BACKGROUNDCOLOR)
GuiSetFont($MESSAGEFONTSIZE, 400, 0, $MESSAGEFONTNAME)

GuiCtrlCreateLabel(" GUI has Desktop background color", 10, 10)
    GuiCtrlSetBkColor(-1, $INFOWINDOWCOLOR);label has tooltip color
    GuiCtrlSetColor(-1, $BUTTONTEXTCOLOR);label's text color

$button = GuiCtrlCreateButton("Click Me", 100, 100)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $button Then
        MsgBox(4096, "Note...","Message boxes use the correct font automatically")
    EndIf
WEnd

GuiFontAndColors.au3

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

What is

Global const ....?

If I delete all the const's it's ok but am I missing something?

But I like the GuiFontsandColors, tx!

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...