UltraFine Posted October 31, 2008 Posted October 31, 2008 (edited) #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) If Not FileExists("C:\Folder\MyFile.txt") Then GUICtrlSetData($Edit1, "File Not Found, can not continue.") Else GUICtrlSetData($Edit1, "File Found, Starting...") EndIf If ProcessExists("ProcessName.exe") Then GUICtrlSetData($Edit1, "Can not Continue Please Close The Program.") Else GUICtrlSetData($Edit1, "Program successfully closed.") EndIf If Not WinActive($Form1, "") Then WinActivate($Form1, "") GUICtrlSetData($Edit1, "Please keep this program Active and don't minimize.") Else GUICtrlSetData($Edit1, "window found active.") EndIf GUICtrlSetData($Edit1, "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndi want it to be like this.but it always clears the first text and shows something like this.Maybe i am using a wrong Control for this GUICtrlCreateEdit() or a wrong function for setting text GUICtrlSetData().any other way to do this? Please help me to Solve my Problem. thanks Edited October 31, 2008 by L0veUK
bogQ Posted October 31, 2008 Posted October 31, 2008 (edited) Maybe i am using a wrong Control for this GUICtrlCreateEdit() or a wrong function for setting text GUICtrlSetData().any other way to do this? Please help me to Solve my Problem. thanksGUICtrlRead($Edit1) can help but probably you beter use$mylist = GUICtrlCreateList("*** End ***", 8, 8, 289, 129,$WS_VSCROLL+$LBS_DISABLENOSCROLL+$LBS_NOSEL )with the_GUICtrlListBox_InsertString($mylist,"text", 0) Edited October 31, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
Andreik Posted October 31, 2008 Posted October 31, 2008 This is an option: expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $TEMP #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) $TEMP = GUICtrlRead($Edit1) If Not FileExists("C:\Folder\MyFile.txt") Then GUICtrlSetData($TEMP & @CRLF & $Edit1, "File Not Found, can not continue.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "File Found, Starting...") EndIf $TEMP = GUICtrlRead($Edit1) If ProcessExists("ProcessName.exe") Then GUICtrlSetData($TEMP & @CRLF & $Edit1, "Can not Continue Please Close The Program.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "Program successfully closed.") EndIf $TEMP = GUICtrlRead($Edit1) If Not WinActive($Form1, "") Then WinActivate($Form1, "") GUICtrlSetData($TEMP & @CRLF & $Edit1, "Please keep this program Active and don't minimize.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "window found active.") EndIf $TEMP = GUICtrlRead($Edit1) GUICtrlSetData($TEMP & @CRLF & $Edit1, "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
UltraFine Posted October 31, 2008 Author Posted October 31, 2008 This is an option: expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $TEMP #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) $TEMP = GUICtrlRead($Edit1) If Not FileExists("C:\Folder\MyFile.txt") Then GUICtrlSetData($TEMP & @CRLF & $Edit1, "File Not Found, can not continue.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "File Found, Starting...") EndIf $TEMP = GUICtrlRead($Edit1) If ProcessExists("ProcessName.exe") Then GUICtrlSetData($TEMP & @CRLF & $Edit1, "Can not Continue Please Close The Program.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "Program successfully closed.") EndIf $TEMP = GUICtrlRead($Edit1) If Not WinActive($Form1, "") Then WinActivate($Form1, "") GUICtrlSetData($TEMP & @CRLF & $Edit1, "Please keep this program Active and don't minimize.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "window found active.") EndIf $TEMP = GUICtrlRead($Edit1) GUICtrlSetData($TEMP & @CRLF & $Edit1, "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd hi Andriek, Thanks for the quick help but this time it stops on first text. run it. expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $TEMP #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) $TEMP = GUICtrlRead($Edit1) If Not FileExists(@WindowsDir & "\Notepad.exe") Then GUICtrlSetData($TEMP & @CRLF & $Edit1, "File Not Found, can not continue.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "File Found, Starting...") EndIf $TEMP = GUICtrlRead($Edit1) If ProcessExists("Explorer.exe") Then GUICtrlSetData($TEMP & @CRLF & $Edit1, "Can not Continue Please Close The Program.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "Program successfully closed.") EndIf $TEMP = GUICtrlRead($Edit1) If Not WinActive($Form1, "") Then WinActivate($Form1, "") GUICtrlSetData($TEMP & @CRLF & $Edit1, "Please keep this program Active and don't minimize.") Else GUICtrlSetData($TEMP & @CRLF & $Edit1, "window found active.") EndIf $TEMP = GUICtrlRead($Edit1) GUICtrlSetData($TEMP & @CRLF & $Edit1, "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
Derak Posted October 31, 2008 Posted October 31, 2008 (edited) You need to use _GUICtrlEdit_AppendText (#Include <GuiEdit.au3>) and some @LFs. Here is the code to it: #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiEdit.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) If Not FileExists("C:\Folder\MyFile.txt") Then _($Edit1, "File Not Found, can not continue.") Else _GUICtrlEdit_AppendText($Edit1, "File Found, Starting..." & @LF ) EndIf If ProcessExists("ProcessName.exe") Then _GUICtrlEdit_AppendText($Edit1, "Can not Continue Please Close The Program." & @LF) Else _GUICtrlEdit_AppendText($Edit1, "Program successfully closed."& @LF) EndIf If Not WinActive($Form1, "") Then WinActivate($Form1, "") _GUICtrlEdit_AppendText($Edit1, "Please keep this program Active and don't minimize." & @LF) Else _GUICtrlEdit_AppendText($Edit1, "window found active." & @LF) EndIf _GUICtrlEdit_AppendText($Edit1, "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited October 31, 2008 by Derak [quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]
UltraFine Posted October 31, 2008 Author Posted October 31, 2008 GUICtrlRead($Edit1) can help but probably you beter use$mylist = GUICtrlCreateList("*** End ***", 8, 8, 289, 129,$WS_VSCROLL+$LBS_DISABLENOSCROLL+$LBS_NOSEL )with the_GUICtrlListBox_InsertString($mylist,"text", 0)can you provide me a example?
bogQ Posted October 31, 2008 Posted October 31, 2008 #include <WindowsConstants.au3> #Include <GuiListBox.au3> $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateList("", 8, 8, 289, 129,$WS_VSCROLL+$LBS_DISABLENOSCROLL+$LBS_NOSEL ) If Not FileExists("C:\Folder\MyFile.txt") Then _GUICtrlListBox_InsertString($Edit1,"File Not Found, can not continue.", -1) Else _GUICtrlListBox_InsertString($Edit1,"File Found, Starting...", -1) EndIf If ProcessExists("ProcessName.exe") Then _GUICtrlListBox_InsertString($Edit1,"Can not Continue Please Close The Program", -1) Else _GUICtrlListBox_InsertString($Edit1,"Program successfully closed.", -1) EndIf If Not WinActive($Form1, "") Then WinActivate($Form1, "") _GUICtrlListBox_InsertString($Edit1,"Please keep this program Active and don't minimize.", -1) Else _GUICtrlListBox_InsertString($Edit1,"window found active.", -1) EndIf _GUICtrlListBox_InsertString($Edit1,"*** End ***", -1) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd >_> TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
UltraFine Posted October 31, 2008 Author Posted October 31, 2008 You need to use _GUICtrlEdit_AppendText (#Include <GuiEdit.au3>) and some @LFs. Here is the code to it: #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiEdit.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) If Not FileExists("C:\Folder\MyFile.txt") Then _($Edit1, "File Not Found, can not continue.") Else _GUICtrlEdit_AppendText($Edit1, "File Found, Starting..." & @LF ) EndIf If ProcessExists("ProcessName.exe") Then _GUICtrlEdit_AppendText($Edit1, "Can not Continue Please Close The Program." & @LF) Else _GUICtrlEdit_AppendText($Edit1, "Program successfully closed."& @LF) EndIf If Not WinActive($Form1, "") Then WinActivate($Form1, "") _GUICtrlEdit_AppendText($Edit1, "Please keep this program Active and don't minimize." & @LF) Else _GUICtrlEdit_AppendText($Edit1, "window found active." & @LF) EndIf _GUICtrlEdit_AppendText($Edit1, "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndthanks for the help but this time it writes all the text in one line like File Not Found, can not continue.Program successfully closed.Please keep this program Active and don't minimize.*** End *** and i want it to write like File Not Found, can not continue. Program successfully closed. Please keep this program Active and don't minimize. *** End ***
Derak Posted October 31, 2008 Posted October 31, 2008 (edited) thanks for the help but this time it writes all the text in one line like File Not Found, can not continue.Program successfully closed.Please keep this program Active and don't minimize.*** End *** and i want it to write like File Not Found, can not continue. Program successfully closed. Please keep this program Active and don't minimize. *** End *** You've probably got my first code (without @LF) I've just edited it 4 min ago It should work now ^^ [Edit] There: #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiEdit.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) If Not FileExists("C:\Folder\MyFile.txt") Then _GUICtrlEdit_AppendText($Edit1, "File Not Found, can not continue." & @LF) Else _GUICtrlEdit_AppendText($Edit1, "File Found, Starting..." & @LF ) EndIf If ProcessExists("ProcessName.exe") Then _GUICtrlEdit_AppendText($Edit1, "Can not Continue Please Close The Program." & @LF) Else _GUICtrlEdit_AppendText($Edit1, "Program successfully closed."& @LF) EndIf If Not WinActive($Form1, "") Then WinActivate($Form1, "") _GUICtrlEdit_AppendText($Edit1, "Please keep this program Active and don't minimize." & @LF) Else _GUICtrlEdit_AppendText($Edit1, "window found active." & @LF) EndIf _GUICtrlEdit_AppendText($Edit1, "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited October 31, 2008 by Derak [quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]
bogQ Posted October 31, 2008 Posted October 31, 2008 _GUICtrlEdit_AppendText($Edit1, "File Not Found, can not continue." & @LF)sry Derak but i still dont think that thats best solution becose it can set visible @LF char on end of lineim still on my apinion on exsample that i geaved up there that its better list to use in this case then edit. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
UltraFine Posted October 31, 2008 Author Posted October 31, 2008 GUICreate("For You!",220,60,-1,-1,0x40000) _GUICtrlCreateMarquee("Thanks a Lot For The Help!",5,5,210,24,0xFFFF00) GUICtrlSetResizing(-1,1) GUISetState() While GUIGetMsg() <> -3 WEnd Func _GUICtrlCreateMarquee($_MarText,$_MarX,$_MarY,$_MarWidth,$_MarHeight,$_MarBGColor=-1,$_MarLoop=-1,$_MarBehavior=-1,$_MarDirection=-1,$_MarScrollAmount=-1,$_MarScrollDelay=-1) Local $_MarString="<marquee width=100% height=100%" If $_MarLoop <> -1 Then $_MarString&=" loop="&$_MarLoop If $_MarBehavior <> -1 Then $_MarString&=" behavior="&$_MarBehavior If $_MarDirection <> -1 Then $_MarString&=" direction="&$_MarDirection If $_MarScrollAmount <> -1 Then $_MarString&=" scrollamount="&$_MarScrollAmount If $_MarScrollDelay <> -1 Then $_MarString&=" scrolldelay="&$_MarScrollDelay $_MarString &= ">"&$_MarText&"</marquee>" Local $_marIE = ObjCreate("Shell.Explorer") Local $_marReturn = GUICtrlCreateObj($_marIE,$_MarX,$_MarY,$_MarWidth,$_MarHeight) $_marIE.navigate("about:blank") $_marIE.document.body.topmargin=0 $_marIE.document.body.leftmargin=0 $_marIE.document.body.scroll="no" $_marIE.document.body.bgcolor=$_MarBGColor $_marIE.document.body.innerHTML = $_MarString $_marIE=0 Return $_marReturn EndFunc
Andreik Posted October 31, 2008 Posted October 31, 2008 @L0veUK Sorry, my bad. Try this: expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $TEMP #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("GUI", 306, 146, Default, Default) $Edit1 = GUICtrlCreateEdit("", 8, 8, 289, 129) $TEMP = GUICtrlRead($Edit1) If Not FileExists("C:\Folder\MyFile.txt") Then GUICtrlSetData($Edit1,"File Not Found, can not continue.") Else GUICtrlSetData($Edit1,$TEMP & @CRLF & "File Found, Starting...") EndIf $TEMP = GUICtrlRead($Edit1) If ProcessExists("ProcessName.exe") Then GUICtrlSetData($Edit1,$TEMP & @CRLF & "Can not Continue Please Close The Program.") Else GUICtrlSetData($Edit1,$TEMP & @CRLF & "Program successfully closed.") EndIf $TEMP = GUICtrlRead($Edit1) If Not WinActive($Form1, "") Then WinActivate($Form1, "") GUICtrlSetData($Edit1,$TEMP & @CRLF & "Please keep this program Active and don't minimize.") Else GUICtrlSetData($Edit1,$TEMP & @CRLF & "window found active.") EndIf $TEMP = GUICtrlRead($Edit1) GUICtrlSetData($Edit1,$TEMP & @CRLF & "*** End ***") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
Derak Posted October 31, 2008 Posted October 31, 2008 sry Derak but i still dont think that thats best solution becose it can set visible @LF char on end of lineim still on my apinion on exsample that i geaved up there that its better list to use in this case then edit."set visible @LF char on end of line" lolWhat about the " & " there???The last code I've showed is working perfectly as required And No @LF is supposed to show up. You didn't even try the code when you said that. ^^ [quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]
UltraFine Posted October 31, 2008 Author Posted October 31, 2008 @L0veUK Sorry, my bad. Try this: ;in previous postno need to say sorry! thanks for the help.
BrettF Posted October 31, 2008 Posted October 31, 2008 & is strong concentration. Also the help file provides examples for almost every function. Take a look down the bottom of every page... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
bogQ Posted October 31, 2008 Posted October 31, 2008 "set visible @LF char on end of line" lolWhat about the " & " there???And No @LF is supposed to show up. You didn't even try the code when you said that. ^^dont woory i tryed before posting it shud b @CRLF same as Andreik in his scriptmaby i formed my coment on your script wrong and maby it sunded litle like im atacking you 4 your work sry if it did sounded like that , English isnt my home language Respect TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
Derak Posted October 31, 2008 Posted October 31, 2008 it shud b @CRLF same as Andreik in his scriptmaby i formed my coment on your script wrong and maby it sunded litle like im atacking you 4 your work sry if it did sounded like that , English isnt my home language Respect I didn't think of you as attaking my work I respect every opinion and user I see. I didn't know about this @LF showing in >.<Now I understand what you meant ^^Yeah, I guess @CRLF is much better < Respect > [quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now