Jump to content
Sign in to follow this  
edena

GUI Input to Notepad

Recommended Posts

edena

I really want to make a GUI that when you type a text in the Input box and click a button a Notepad should pop up and the text you wrote in the GUI input box appears in the Notepad.

I've tried this for an hour now and could not figure out how to do it correctly. It seems that it's giving me errors and when I'm correcting those errors I'm getting no where.

Please help modify my code below:

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 218, 123, 192, 124)

$Input1 = GUICtrlCreateInput("Input1", 16, 24, 185, 21)

$Button1 = GUICtrlCreateButton("Button1", 56, 72, 107, 25)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case ($Input1)

ControlGetText ( "Form1", "Form1", Input1 )

Case ($Button1)

Run ("Notepad.exe")

ControlSend ( "Notepad", "Untitled - Notepad", $Input1, "" )

EndSwitch

WEnd

Thank You.

Share this post


Link to post
Share on other sites
somdcomputerguy

I've corrected your code (see the differences?), and also added formatting for my tired eyes..

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt("WinTitleMatchMode", 2)

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 218, 123, 192, 124)
$Input1 = GUICtrlCreateInput("Input1", 16, 24, 185, 21)
$Button1 = GUICtrlCreateButton("Button1", 56, 72, 107, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run ("Notepad.exe")
            Sleep(250)
            ControlSend ("Notepad", "", "Edit1", GUICtrlRead($Input1))
    EndSwitch
WEnd

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
edena

Thank You very much for the script really appreciate it,

but when I tried it few more times it's now opening notepad and there's no text written on notepad.

What's seems to be the problem?

Thank You.

Share this post


Link to post
Share on other sites
somdcomputerguy

I don't know. Try increasing the Sleep value. Remember, it's values are in milliseconds. So 500 is half a second, 1000 is 1 second..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
monoscout999

Maybe instead of sleep use WinWait()

Share this post


Link to post
Share on other sites
edena

Okay thanks it's working

Please I have 2 more questions:

1. How do you place these signs "< >", in the GUI, instead of writing them down in the input box if you were to expand from the above code you given me.

For example:

In the GUI input box you write the word "text" and it shows something like this in the Notepad: "<text>"

2. I want to make two (2) GUI Input boxes with one (1) GUI button. The first GUI input should show <text> in the first line of Notepad and the Second GUI input should show in the second line of notepad.

For example:

In the GUI you have:

Input1 [text1 ]

Input2 [text2 ]

Button

So when the button is clicked notepad appears:

<text1> in first line

<text2> in second line

Thank You.

Share this post


Link to post
Share on other sites
somdcomputerguy

@monoscout999 - good call on WinWait

@edena - the & is a concatenation character, @CRLF is a carriage return/line feed macro. See what I did here? Besides adding another input control, I just added to the ControlSend string parameter. Oh, and I replaced the Sleep with WinWait. And Oh again, I replaced ControlSend with ControlSetText. They both work the same here, I don't know the difference between them..

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt("WinTitleMatchMode", 2)

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 218, 123, 192, 124)
$Input1 = GUICtrlCreateInput("Input1", 16, 24, 185, 21)
$Input2 = GUICtrlCreateInput("Input2", 16, 45, 185, 21)
$Button1 = GUICtrlCreateButton("Button1", 56, 72, 107, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run ("Notepad.exe")
            WinWait("Notepad")
            ControlSetText("Notepad", "", "Edit1", "<" & GUICtrlRead($Input1) & ">" & @CRLF & "<" & GUICtrlRead($Input2) & ">")
    EndSwitch
WEnd
Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
edena

Wow!! Cool!!!

I kind of learned something thanks

but when I started to run the script it does only make the notepad appear but there are no text appearing on the notepad.

Share this post


Link to post
Share on other sites
edena

Sorry I think I figured it out.

Didn't put the last script "WEnd"

Thank you very much for the help

Share this post


Link to post
Share on other sites
somdcomputerguy

Thank you very much for the help

You bet.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
monoscout999

I replaced ControlSend with ControlSetText. They both work the same here, I don't know the difference between them..

ControlSend will send each key after the other, like if some one were writing the text. ControlSetText will put the entire text at once into the Edit.

Share this post


Link to post
Share on other sites
somdcomputerguy

So I guess SetKeyDelay would have not the effect on ControlSetText it would on ControlSend. I'll have to try that out later just to see. Thanks.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
edena

Can you save the file to the desktop and write the file name which is stated in Input2 also with another GUI Input3 for placing file extenstions, example: .txt or .au3?

Like you have this GUI:

Input1 (will write this on notepad like this: <Input1>)

Input2 (you will write down the file name)

Input3 (you will write the file extension option here . For example: .txt or .au3

Button

So when the button is pressed the file will appear on the desktop with the name you given from Input2 and with the file extension you given from Input3.

This is how far I've gone with the script can anyone help me with this:

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

Opt("WinTitleMatchMode", 2)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 212, 193, 192, 124)

$Input1 = GUICtrlCreateInput("Input1", 40, 24, 129, 21)

$Input2 = GUICtrlCreateInput("Input2", 40, 64, 129, 21)

$Input3 = GUICtrlCreateInput("Input3", 40, 104, 129, 21)

$Button1 = GUICtrlCreateButton("Button1", 40, 144, 131, 25)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

Run ("Notepad.exe")

WinWait("Notepad")

ControlSetText("Notepad", "", "Edit1", "<" & GUICtrlRead($Input1) & ">")

Sleep(1000)

Send("{ALTDOWN}f{ALTUP}a")

EndSwitch

WEnd

I've also tried: "FileSaveDialog" but cannot figure this out.

Thank You.

Share this post


Link to post
Share on other sites
JoHanatCent

You don't need to open Notepad to achieve all this. If you explain more what you want to achieve we can help with that.

Meanwhile try:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("WinTitleMatchMode", 2)
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 212, 193, 192, 124)
GUICtrlCreateLabel("My Note:", 40, 10)
$Input1 = GUICtrlCreateInput("Input1", 40, 24, 129, 21)
GUICtrlCreateLabel("File name:", 40, 50)
$Input2 = GUICtrlCreateInput("Input2", 40, 64, 129, 21)
GUICtrlCreateLabel("Extention:", 40, 90)
$Input3 = GUICtrlCreateInput("Input3", 40, 104, 129, 21)
$Button1 = GUICtrlCreateButton("Button1", 40, 144, 131, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Run("Notepad.exe")
WinWait("Notepad")
ControlSetText("Notepad", "", "Edit1", "<" & GUICtrlRead($Input1) & ">")
Sleep(1000)
Send("{ALTDOWN}f{ALTUP}a")
Sleep(500)
Send(GUICtrlRead($Input2) & "." & GUICtrlRead($Input3))
Sleep(500)
Send("{enter}")
EndSwitch
WEnd

Share this post


Link to post
Share on other sites
edena

Thank you very much for the script I really appreciate it.

Okay,

I want to create a one page html page that is why I really want Input1 to work just for me to start writing the html script.

But the script you given me does not write down the html tags on the notepad which are this "<" and this ">" and of course text must be written between the tags.

You can see that the previous script writes the html tags with the text given by somdcomputerguy

Thank You.

Share this post


Link to post
Share on other sites
JoHanatCent

Try without notepad:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("WinTitleMatchMode", 2)
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 212, 193, 192, 124)
GUICtrlCreateLabel("My Note:", 40, 10)
$Input1 = GUICtrlCreateInput("Input1", 40, 24, 129, 21)
GUICtrlCreateLabel("File name:", 40, 50)
$Input2 = GUICtrlCreateInput("File", 40, 64, 129, 21)
GUICtrlCreateLabel("Extention:", 40, 90)
$Input3 = GUICtrlCreateInput("Html", 40, 104, 129, 21)
$Button1 = GUICtrlCreateButton("Button1", 40, 144, 131, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Button1
   $try = '<br />' & @CRLF
   $try &= '<table width=350 border=0 style="border-width: medium medium medium medium; border-spacing: 1px; border-style: solid solid solid solid; border-collapse: separate;">' & @CRLF
   $try &= '<tr>' & @CRLF
   $try &= '<td width=60%>' & GUICtrlRead($Input1) & '</td>'
   FileWrite(GUICtrlRead($Input2) & "." & GUICtrlRead($Input3), $try)
   Sleep(1000)
   ShellExecute(GUICtrlRead($Input2) & "." & GUICtrlRead($Input3))
EndSwitch
WEnd

Share this post


Link to post
Share on other sites
edena

Thanks JoHanatCent

I think I've corrected the problem with the first script you given me. I've increased the Sleep to 1000 and it works fine.

Your second code is even better makes work more looking professional.

Thank You

Share this post


Link to post
Share on other sites
edena

Sorry I'm back so excited with the scripts and I forgot something important.

How do you save the file in a destination like in the Desktop or in My Documents.

Thank You

Share this post


Link to post
Share on other sites
edena

Hi! JohnOne,

This how I placed the "@DesktopDir" script in one of my lines but it still doesn't work. I'm really bad in scripts please can you or anyone help.

Send(@DesktopDir, GUICtrlRead($Input2) & "." & GUICtrlRead($Input3))

The full script is here:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("WinTitleMatchMode", 2)
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 212, 193, 192, 124)
GUICtrlCreateLabel("My Note:", 40, 10)
$Input1 = GUICtrlCreateInput("Input1", 40, 24, 129, 21)
GUICtrlCreateLabel("File name:", 40, 50)
$Input2 = GUICtrlCreateInput("Input2", 40, 64, 129, 21)
GUICtrlCreateLabel("Extention:", 40, 90)
$Input3 = GUICtrlCreateInput("Input3", 40, 104, 129, 21)
$Button1 = GUICtrlCreateButton("Button1", 40, 144, 131, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Run("Notepad.exe")
WinWait("Notepad")
ControlSetText("Notepad", "", "Edit1", "<" & GUICtrlRead($Input1) & ">")
Sleep(1000)
Send("{ALTDOWN}f{ALTUP}a")
Sleep(1000)
Send(@DesktopDir, GUICtrlRead($Input2) & "." & GUICtrlRead($Input3))
Sleep(1000)
Send("{enter}")
EndSwitch
WEnd

Thank You.

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  

  • Similar Content

    • Lisuter
      By Lisuter
      Hello...

      How i can write data from txt to +3 Input?
      Example:
      In txt i have:
      Michael XYZ, 21, Boston
      Olex Marshal, 17, Boston
      Alex XYZ, 19, Boston
       
      And now i want load that data to input in autoit. 

      Name          y.o          city
      [ Input1]  [Input2] [Input3]
      [ Input4]  [Input5] [Input6]
      [ Input7]  [Input8] [Input9]
       
      After load should be:
      Name               y.o            city
      [Michael XYZ]      [21]     [Boston]
      [ Olex Marshal]  [17]      [Boston]
      [ Alex XYZ]           [19]      [Boston]
       
      FileOpen("Test.txt",0)                          $aas = GUICtrlSetData($Input1, FileReadLine("Test.txt",1))             FileClose("Test.txt") But its wrong. ofcourse its load all to input 1. So now how do you load this data directly into each input separately? The comma stop sign is here. Each line is a new person
    • Blois
      By Blois
      Hi Guis,
       
      I need to create keyboard shortcut to navigate the tabs and activate them, but I could not use the code below:
      #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> #include <GUIConstantsEx.au3> HotKeySet("^{TAB}", "_TabRight") HotKeySet("^+{TAB}", "_TabLeft") $gui = GUICreate("test",450, 300) $Tab1 = GUICtrlCreateTab(20, 24, 425, 201) $TabSheet1 = GUICtrlCreateTabItem("Tabsheet 1") $lbContagemGrupos2 = GUICtrlCreateLabel("aaaa", 50, 50) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateTabItem("") $TabSheet2 = GUICtrlCreateTabItem(" ") $TabSheet3 = GUICtrlCreateTabItem(" ") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _TabRight() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos + 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Func _TabLeft() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos - 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Exit  
      can you help me?
    • Pricehacker
      By Pricehacker
      Hello again!
      I have tried searching for quite some time now but couldn´t find a single working way to change the class of your GUI that doesn´t include changing it manually after its compilation.
      First or "AutoIt v3 GUI" is a pretty boring name tbh and i would like to spice it up a bit, also, and more importantly, I would like to identify my windows by something other than its title as it will change depending on some factors and im using two different programs independently as multi threading isn't supported.
      Any help is appreciated! Thank you!
    • xtcislove
      By xtcislove
      Hello, 
      i have a Problem with  _WinAPI_SetLayeredWindowAttributes, everything is working as excepted if u are on Windows 7.

      But if u are on Windows 10 the transparent background of a control is not clickable anymore. 

      Could someone help?

      Please see example below, put cmd.jpg into the same folder as Example.au3

      Please see trigger.jpg to see which sections are not clickable in Windows 10 (the red dots, the green dots are clickable) on Windows 7 the red ones and green ones are clickable.
       
      The same problem occurs if i use 
       
       
      Example.au3


    • WilliamasKumeliukas
      By WilliamasKumeliukas
      Hello everyones reading this post,
      I'm struggling at resizing properly my radio buttons to fit long text inside without affecting others radio buttons and also adjust position of them relative to the string.
      I tried with _StringSize UDF but I guess im too tired to figure out how to use it correctly..
      I also tried: _Control_SetWidth2Text I found on this forum, it work aslong im not maximizing GUI (radio text is gone when I maximize and maximize is a must)
       
      here is the code example, I hope someone can figure out (sorry if guictrlsetpos is not included in the example, I know thats probably the way to go but I wanted to make sure there is nothing better before use it)
      Thank you
       
      Br,
      ~WilliamasKumeliukas
       
      #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Array.au3> #include <StringConstants.au3> #include <FileConstants.au3> #include <WindowsConstants.au3> #include <File.au3> #include <EditConstants.au3> #include <GUIListBox.au3> #include <ButtonConstants.au3> #include <ProgressConstants.au3> #include <ColorConstants.au3> #include <AutoitConstants.au3> #include <Misc.au3> #include <WinAPIReg.au3> #include <WinAPI.au3> #Region Opt's Opt("GUIResizeMode", 802) #EndRegion Opt's Global $q = "INTRO LINE" & @CRLF & @CRLF & "description of everything until user press start." Global $file = @TempDir & "\test.p" destroy() Global $msg, $score = 0, $rate, $com, $total = 0, $cfile, $cq, $i = 0, $time = 0, $min = 0, $sec = 0, $hour = 0, $qf, $ii = 0 Main() Func Main() Global $iGUIInitSize = 550 #Region GUI Opt("GUICloseOnEsc", 1) Global $gui = GUICreate("example", 1124, 550,-1 ,-1, BitOR($WS_MAXIMIZEBOX , $WS_MINIMIZEBOX)) Global $gui_size = WinGetClientSize($gui) Global $iFontSize = Int(2 * (.25 + (8 * $gui_size[0] / $iGUIInitSize))) / 2 Global $options = GUICtrlCreateMenu("&Options") Global $guide = GUICtrlCreateMenuItem("Guide", $options) Global $restart = GUICtrlCreateMenuItem("Restart", $options) Global $about = GUICtrlCreateMenuItem("About", $options) Global $exit = GUICtrlCreateMenuItem("Exit", $options) Global $extra = GUICtrlCreateMenu("Extras") Global $creator = GUICtrlCreateMenu("CQB", $extra ) Global $new = GUICtrlCreateMenuItem("custom QP", $creator) Global $load = GUICtrlCreateMenuItem("CQ", $creator ) Global $timer = GUICtrlCreateLabel("", 752, 472, 294, 30, $WS_BORDER) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetFont(-1, $iFontSize) GUICtrlSetState($timer, $GUI_HIDE) Global $info = GUICtrlCreateLabel( $q, 200, 20, 700, 200, $SS_CENTER ) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) $fi = GUICtrlSetFont($info, $iFontSize) Global $a = GUICtrlCreateRadio("A)", 100, 210, $WS_EX_CLIENTEDGE) $fa = GUICtrlSetFont($a, 15) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($a, 16) Global $b = GUICtrlCreateRadio("B)", 100, 310 , $WS_EX_CLIENTEDGE) $fb = GUICtrlSetFont($b, 15) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($b, 16) Global $c = GUICtrlCreateRadio("C)", 750, 210 , $WS_EX_CLIENTEDGE) $fc = GUICtrlSetFont($c, 15) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($c, 16) Global $d = GUICtrlCreateRadio( "D) ", 750, 310, $WS_EX_CLIENTEDGE) $fd = GUICtrlSetFont($d, 15) GUICtrlSetResizing (-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($d, 16) Global $sign = GUICtrlCreateLabel( $file, 420, 480, -1, -1, BitOR ( $SS_CENTER, $WS_BORDER ) ) GUICtrlSetResizing ( -1, BitOR ( $GUI_DOCKHCENTER, $GUI_DOCKVCENTER ) ) GUICtrlSetFont($sign, 12) Global $yb = GUICtrlCreateRadio("True", 200, 420, 200, 50, $BS_PUSHLIKE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER,$GUI_DOCKSIZE)) GUICtrlSetFont($yb, 15) GUICtrlSetState($yb, 32) Global $nb = GUICtrlCreateRadio("False", 700, 420, 200, 50, $BS_PUSHLIKE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER, $GUI_DOCKSIZE)) GUICtrlSetFont($nb, 15) GUICtrlSetState($nb, 32) Global $start = GUICtrlCreateButton("Start", 20, 20, 100, 50, $SS_CENTER, $WS_EX_CLIENTEDGE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER)) GUICtrlSetFont($start, 12) Global $valid = GUICtrlCreateButton("Confirm", 20, 20, 100, 50, $SS_CENTER, $WS_EX_CLIENTEDGE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER)) GUICtrlSetFont($valid, 12) GUICtrlSetState($valid, 32) GUISetState(@SW_SHOW) #EndRegion GUI While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Switch MsgBox(4096 + 4, "Warning", "Are you sure to exit?") Case 6 AdlibUnRegister("timer") If Not $qf = "" Then FileClose($file) EndIf Exit Case 7 ContinueLoop EndSwitch Case $start ;AdlibRegister("timer") ;Global $qf = StringSplit(StringStripWS(FileRead($file), 6), @CRLF, 0) ;qloop($file) GUICtrlSetData($a, "A) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") GUICtrlSetData($b, "B) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") GUICtrlSetData($c, "C) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") GUICtrlSetData($d, "D) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") Case $restart MsgBox(4096, "Warning", 'Normally, your suposed to start something before restarting it.') ContinueLoop Case $new ;GUISetState(@SW_HIDE, $gui) ;_CustomNew() ContinueLoop Case $load ;_CustomLoad() Case $about ;_About() EndSwitch WEnd EndFunc ;Main() Func timer() If $time = 0 Then Global $time = TimerInit() Global $diff = TimerDiff($time) Global $sec = Int(Mod($diff / 1000, 60)) Global $min = Int(Mod($diff / 60000, 60)) Global $hour = Int($diff / 3600000) If $sec < 10 Then $sec = "0" & $sec If $min < 10 Then $min = "0" & $min If $hour < 10 Then $hour = "0" & $hour GUICtrlSetData($timer, "Temps: " & $hour & ":" & $min & ":" & $sec) EndFunc ;==>timer Func destroy() If FileExists($file) Then FileDelete($file) EndIf DirCreate(@TempDir & "\About") FileInstall("C:\test.txt", $file) EndFunc ;==>destroy  
×