Apfelkiller Posted March 22, 2012 Posted March 22, 2012 Hey Guys, I scriptet this little GUI here: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("WinTitleMatchMode", 2) $Bildschirmgroesse=WinGetPos("Program Manager") $Taskleistenhoehe=WinGetPos("[Class:Shell_TrayWnd]") $Fensterbreite=150 $Fensterhoehe=70 $x=$Bildschirmgroesse[2]-$Fensterbreite-5 $y=$Bildschirmgroesse[3]-$Fensterhoehe-$Taskleistenhoehe[3]-28 GUICreate ( "" , $Fensterbreite , $Fensterhoehe , $x , $y ) $text = GUICtrlCreateInput('MouseClick("",100,100)', 20, 15, 110, 20) $Button1 = GUICtrlCreateButton("START", 20, 40, 110, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 $example=GUICtrlRead($text) $example ;execute the $example EndSelect WEnd My goal is to write whatever i want into the Input label an execute it by hitting the START button. My Problem is that i can't execute the $example variable. Someone have an idea how to solve it?
smartee Posted March 22, 2012 Posted March 22, 2012 My Problem is that i can't execute the $example variable. Oh but you can Execute it. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("WinTitleMatchMode", 2) $Bildschirmgroesse = WinGetPos("Program Manager") $Taskleistenhoehe = WinGetPos("[Class:Shell_TrayWnd]") $Fensterbreite = 150 $Fensterhoehe = 70 $x = $Bildschirmgroesse[2] - $Fensterbreite - 5 $y = $Bildschirmgroesse[3] - $Fensterhoehe - $Taskleistenhoehe[3] - 28 GUICreate("", $Fensterbreite, $Fensterhoehe, $x, $y) $text = GUICtrlCreateInput('MouseClick("",100,100)', 20, 15, 110, 20) $Button1 = GUICtrlCreateButton("START", 20, 40, 110, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 $example = GUICtrlRead($text) Execute($example) ;execute the $example EndSelect WEnd Hope this helps
Moderators JLogan3o13 Posted March 22, 2012 Moderators Posted March 22, 2012 Hi, Apefelkiller, can you please provide us with an example output of $example? You're doing a GUICtrlRead, but what would you expect the information to be? That will define how you "execute" it. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
smartee Posted March 22, 2012 Posted March 22, 2012 @JLogan3o13: look at the line $text = GUICtrlCreateInput('MouseClick("",100,100)', 20, 15, 110, 20) he did give us an example
Apfelkiller Posted March 22, 2012 Author Posted March 22, 2012 Woooooot? It's sooo simple. I just didn't try to find any "Execute" command. Thanks thats exact what I wanted.
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