Jump to content

How to set font size?


Recommended Posts

The start button will display the coordinates of the mouse, if the scrollwheel is clicked,m ti displays dec color whre mosue is, if it is lcicked again it will display hex color of mouse, and lcicked again it will go back to coord mode, and so on...and so on....

NEW HELP ON SCRIPT, VIEW LAST POST!

Alrgiht, this was from helpfile, But how can I set the font size to this?

ControlSetText("Untitled -", "", "Edit1", "New Text Here" )

Thanks for eny help!

Edited by bigassmuffin
Link to comment
Share on other sites

Hm if you only want to change font size in notepad, it would help of course, to simulate, what you would press to change font size:

Run("notepad.exe")
WinWait("Unbenannt -")
ControlSetText("Unbenannt -", "", "Edit1", "New Text Here" )
Sleep(1000)
Send("!os{TAB}{TAB}")
Send("20");fontsize
Send("{ENTER}")

(german notepad version)

But i fear, that's not what you want to have. I don't know how to make sth like that, with a control not being a part of your own gui:

GUICtrlSetFont ($id_edit, 20)

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

I found how to change start button in example forum, so I made this useful script:

The start button will display the coordinates of the mouse, if the scrollwheel is clicked,m ti displays dec color whre mosue is, if it is lcicked again it will display hex color of mouse, and lcicked again it will go back to coord mode, and so on...and so on....

TWO problems, one big one small:

1) I get an error on this line:

ElseIf _IsPressed("04") ThenoÝ÷ Ù8Z¶X§z(ºWlk"¶¬rå^zX¬¦·¬±çméÜ¢{b¢{ØìºØ"½ë®º+ØÞyÖ°k+h©~í²,Þ²f¥êߢ¼!z{az·­é'b+l¡ùî·«²)íë-j»[j²·w)uèþØ^ËZzg§¶Çè­Ø Ûº××!jx~í²,Þ{azb&i×°êÞ~í²,Þq¨gè¬çyÛhm觷)ç¢×¬~æ²,Þ£)j{-ÊWoÝ÷ Úȳzl¥©ì·)^

If you have a suggestion or cna help with either problem, I would gladly appreciate it, and heck, this may be useful for u!

Edited by bigassmuffin
Link to comment
Share on other sites

NEWEST CODE!

Closest and neatest code Ive worked otu so far, I still need to know how t0o change font size and how I can get the _ispressed parts working!

Opt('WinTitleMatchMode', 4)
HotKeySet("{ESCAPE}", '_Exit')

_ChangeStartButton()

Func _ChangeStartButton()
While 1
    $pos = MouseGetPos()
    ;(2 digit, 3 digit) or (3 digit, 2 digit)
    ;regular font size
    If $pos[0] <=99 Then
        If $pos[1] >=100 Then
            If $pos[1] <=999 then       ;(x<=99, y>=100 and y<=999)
                ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
            ElseIf $pos[1] >=1000 then  ;(x<=99, y>=1000)
                ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
            EndIf
        ElseIf $pos[1] <=99 Then        ;(x<=99, y<=99)
            ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
        EndIf
        
    ElseIf $pos[0] >=100 Then
        If $pos[1] >=100 Then
            If $pos[1] <=999 then       ;(x>=100, y>=100)
                ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
            ElseIf $pos[1] >=1000 then  ;(x>=100, y>=1000)
                ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
            EndIf
        ElseIf $pos[1] <=99 Then        ;(x>=100, y<=99)
            ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
        EndIf
        
    ElseIf $pos[0] >=1000 Then
                If $pos[1] >=100 Then
            If $pos[1] <=999 then       ;(x>=1000, y>=100 and y<=999)
                ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
            ElseIf $pos[1] >=1000 then  ;(x>=1000, y>=1000)
                ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
            EndIf
        ElseIf $pos[1] <=99 Then        ;(x>=1000, y<=99)
            ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", $pos[0] & "," & $pos[1])
        EndIf
        
    ElseIf _IsPressed("04") Then        ;If scroll wheel is pressed
         _DecStartButton()
    EndIf
Wend
EndFunc
        
Func _DecStartButton()
    $var = PixelGetColor($pos[0], $pos[1])
        ControlSetText("classname=Shell_TrayWnd  ","Notification Area", "Button1", $var)
    If _IsPressed("04") Then        ;If scroll wheel is pressed
        _HexStartButton()
    EndIf
EndFunc
    
Func _HexStartButton()
    $var = PixelGetColor($pos[0] , $pos[1])
    ControlSetText("classname=Shell_TrayWnd","Notification Area", "Button1", Hex($var, 6))
    If _IsPressed("04") Then    ;If scroll wheel is pressed
        _ChangeStartButton()
    EndIf
EndFunc
        
        
        
Func _Exit()
    Exit 0
EndFunc
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...