Jump to content

how to change font writing in windows


name15
 Share

Recommended Posts

  • Moderators

name15,

You set a font for a control by using GUICtrlSetFont (or GUISetFont if you want all controls to use the same font).

Getting the font from a control is more difficult, but PsaltyDS produced a script to do it here.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

you get wrong idea

detected type of font (like french or Germany) in window

whiteout using tool course

some time user use shortcut (shift + Alt) to change writing language in window like in Notepad

Edited by name15
Link to comment
Share on other sites

  • Moderators

name15,

If you want to distinguish between LANGUAGES (which is what French and German are) than there is nothing in AutoIt to help.

The Google Language API might be of help - you can find out about it here.

M23

Language:

English = the words used to speak or write.

French = les mots utilises pour parler/ecrire

German = die Wörter zu sprechen oder zu schreiben

Font = the variable shape of the letters used to write the words:

This is Courier

This is Tahoma

This is Comic Sans MS

Edit following your edit:

some time user use shortcut (shift + Alt) to change writing language in window like in Notepad

This is a Windows function which changes the keyboard layout - it has nothing to do with language. If you want to use AutoIt to do this, look at Send in the Help file.

M23

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

thank to make everything clear but

all i want just detected keyboard layout

i have ready read help in send but i don't get what i want

Look at _WinAPI_GetKeyboardLayout() and _WinAPI_SetKeyboardLayout() from the WinAPIEx.au3 library.

#Include <Array.au3>
#Include <GUIConstantsEx.au3>
#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $hForm, $Msg, $Button, $Index, $Label, $Layout, $List = _WinAPI_GetKeyboardLayoutList()
Global $hAutoIt = WinGetHandle(AutoItWinGetTitle())

$hForm = GUICreate('MyGUI', 250, 120)
$Layout = _WinAPI_GetKeyboardLayout($hAutoIt)
$Index = _ArraySearch($List, $Layout, 1)
$Label = GUICtrlCreateLabel('0x' & Hex($Layout, 4), 20, 34, 210, 30, 0x01)
GUICtrlSetFont(-1, 18, 800, 0, 'Tahoma')
$Button = GUICtrlCreateButton('Next Layout', 75, 90, 100, 23)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Button
            $Index += 1
            If $Index > $List[0] Then
                $Index = 1
            EndIf
            _WinAPI_SetKeyboardLayout($hAutoIt, $List[$Index])
            GUICtrlSetData($Label, '0x' & Hex($List[$Index], 4))
    EndSwitch
WEnd
Edited by Yashied
Link to comment
Share on other sites

  • Moderators

name15,

Glad we got there in the end! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

name15,

Look at Yashied's code above - it shows how to use both _WinAPI_GetKeyboardLayout and _WinAPI_SetKeyboardLayout. :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

thank for all try help me but i change code in script to use it to control writing language in notepad

but writing language doesn't change to french

#Include <Array.au3>
#Include <GUIConstantsEx.au3>
#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)
run("Notepad.exe")
Global $hForm, $Msg, $Button, $Index, $Label, $Layout, $List = _WinAPI_GetKeyboardLayoutList()
Global $hAutoIt = WinGetHandle("[CLASS:Notepad]","")
$hForm = GUICreate('MyGUI', 250, 120)
$Layout = _WinAPI_GetKeyboardLayout($hAutoIt)
$Index = _ArraySearch($List, $Layout, 1)
$Label = GUICtrlCreateLabel('0x' & Hex($Layout, 4), 20, 34, 210, 30, 0x01)
GUICtrlSetFont(-1, 18, 800, 0, 'Tahoma')
$Button = GUICtrlCreateButton('Next Layout', 75, 90, 100, 23)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Button
            $Index += 1
            If $Index > $List[0] Then
                $Index = 1
            EndIf
            _WinAPI_SetKeyboardLayout($hAutoIt, $List[$Index])
            GUICtrlSetData($Label, '0x' & Hex($List[$Index], 4))
    EndSwitch
WEnd
Link to comment
Share on other sites

  • Moderators

name15,

Those functions just set the keyboard layout - for example a French keyboard has accented characters on the number keys and an AZERTY layout. They do NOT change the language you use - it is up to you to type in the French words that these letters spell!

An example: Je tape ces mots francais avec un clavier anglais. I am typing these French words with an English keyboard.

As you can see, the language has nothing to do with the keyboard layout! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 weeks later...

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...