Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 23:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Button ; <

Discussion on Button ; < within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 28
Received Thanks: 0
Button ; <

Hey!
How i can set to button run exe program?

I click to button and next program (exe) started

thanks
Dostrix is offline  
Old 04/07/2010, 20:26   #2
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
Run or ShellExecute
mipez is offline  
Thanks
1 User
Old 04/07/2010, 20:50   #3
 
elite*gold: 1
Join Date: Oct 2008
Posts: 1,078
Received Thanks: 276
Quote:
Originally Posted by mipez View Post
Run or ShellExecute
...wenn schon :P

I think "Run" isn't such a good Function to Call a new Process, i prefer ShellExecute.

I'm not able to understand what you need to know, but i'll show you what you some solutions to solve your Problem:

Call 1 Process by pressing a button:
PHP Code:
$button GUICtrlCreateButton (...)
...

Switch 
GuiGetMsg()
     Case 
$button
           ShellExecute 
(...)
...
EndSwitch 
This Code isn't executable, you'll have to fill in the Parameters and so on

Call 2 or more process by pressing a button:
PHP Code:
Dim $array_with_executable [3]

$array_with_executable [0] = "C:\Path1"
$array_with_executable [1] = "C:\Path2"
$array_with_executable [2] = "C:\Path3"

$i 0

$button 
GUICtrlCreateButton (...)
...


Switch 
GuiGetMsg()
     Case 
$button
           ShellExecute 
($array_with_executable[$i], ... )
           
$i $i 1
...
EndSwitch 
These example don't inlcude any error preventing Stuff or so
.nAno is offline  
Old 04/07/2010, 20:59   #4
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
Quote:
Originally Posted by .nAno View Post
PHP Code:
Dim $array_with_executable [3]

$array_with_executable [0] = "C:\Path1"
$array_with_executable [1] = "C:\Path2"
$array_with_executable [2] = "C:\Path3"

$i 0

$button 
GUICtrlCreateButton (...)
...


Switch 
GuiGetMsg()
     Case 
$button
           ShellExecute 
($array_with_executable, ... )
           
$i $i 1
...
EndSwitch 
Isses nicht leichter einfach eine ShellExecute nach der anderen auszuführen?
Isn't it easier to execute one ShellExecute after another?
PHP Code:
While 1
    $msg 
GUIGetMsg()
    Switch 
$msg
        
Case $button
            ShellExecute
("exename","""yourpath")
            
ShellExecute("exename","""yourpath")
            
ShellExecute("exename","""yourpath")
            ...
    EndSwitch
WEnd 
mipez is offline  
Old 04/07/2010, 21:27   #5
 
elite*gold: 1
Join Date: Oct 2008
Posts: 1,078
Received Thanks: 276
i guess "next Programm" doesn't mean start all Programms at once
.nAno is offline  
Old 04/07/2010, 21:33   #6
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
Quote:
Originally Posted by .nAno View Post
i guess "next Programm" doesn't mean start all Programms at once
Ah you mean: Click the button the first time -> first prog starts, Click it a second time -> second prog starts, and so on Oo
Well, that speaks for itself xD

(Warum reden wir eig englisch? xD)
mipez is offline  
Old 04/07/2010, 21:36   #7
 
elite*gold: 1
Join Date: Oct 2008
Posts: 1,078
Received Thanks: 276
because this thread is an englisch one :P
.nAno is offline  
Old 04/07/2010, 21:38   #8
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
Quote:
Originally Posted by .nAno View Post
because this thread is an englisch one :P
...english xD

Ah, hey Dostrix, did ya understand?
mipez is offline  
Old 04/08/2010, 15:00   #9
 
elite*gold: 0
Join Date: Feb 2009
Posts: 28
Received Thanks: 0
but I want to set up a another bot which is located in the same folder.
and whats is "yourpath" ? its np. "C:\Documents and Settings\Rafał\Pulpit\Dostrix Bot" ?
Dostrix is offline  
Old 04/08/2010, 17:57   #10
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
Quote:
Originally Posted by Dostrix View Post
but I want to set up a another bot which is located in the same folder.
and whats is "yourpath" ? its np. "C:\Documents and Settings\Rafał\Pulpit\Dostrix Bot" ?
Well, path means the location of the folder where your .exe should be.
mipez is offline  
Old 04/08/2010, 19:17   #11
 
elite*gold: 0
Join Date: Feb 2009
Posts: 28
Received Thanks: 0
its dont work : <
Quote:
While 1
$msg = GUIGetMsg()
Switch $msg
Case $button
ShellExecute("Jedzenie","", "C:\Documents and Settings\Rafał\Pulpit\Dostrix Bot")
...
EndSwitch
WEnd
and i have
Quote:
$button = GUICtrlCreateButton("Jedzenie", 20, 20, 60, 30)
GUICtrlSetOnEvent($button , "button")
Dostrix is offline  
Old 04/08/2010, 20:45   #12
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
ShellExecute("Jedzenie.exe","", "C:\Documents and Settings\Rafał\Pulpit\Dostrix Bot")

You forgot .exe^^
mipez is offline  
Old 04/08/2010, 20:51   #13
 
elite*gold: 0
Join Date: Feb 2009
Posts: 28
Received Thanks: 0
again dont work : <
Dostrix is offline  
Old 04/09/2010, 12:08   #14
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
...grr...
Don't know why, but try this:
Code:
$path = "C:\Documents and Settings\Rafał\Pulpit\Dostrix Bot"
ShellExecute($path & "\Jedzenie.exe","", $path)
This little \ troubled me many times in my own scripts.
mipez is offline  
Old 04/09/2010, 14:00   #15
 
elite*gold: 0
Join Date: Feb 2009
Posts: 28
Received Thanks: 0
Quote:
While 1
$msg = GUIGetMsg()
Switch $msg
Case $button
$path = "C:\Documents and Settings\Rafał\Pulpit\Dostrix Bot"
ShellExecute($path & "\Jedzenie.exe","", $path)
...
EndSwitch
WEnd
nothing : <
Dostrix is offline  
Reply


Similar Threads Similar Threads
Thanks Button
04/13/2010 - Main - 7 Replies
Hi liebe Com, Ich wollte fragen wie ihr den Thanks Button editiert also eingefügt habt MfG
WarRock statt KOREANISCHE BUTTON --> Englische BUTTON
02/26/2010 - WarRock - 6 Replies
Bin mir nicht sicher ob es diesen Thread schon gibt aber hab bis jetzt nichts gesehen hier. Funktionen Für WarRock Korea Koreanische Schriften (Button) weg und englische Schriften (Button) hin Anleitung
GUI Button
03/22/2009 - Metin2 - 3 Replies
Geht es? - Das der Button in einer GUI immer aktiv ist? Normal - wird ein Button bestätigt wird die Aktion ausgeführt. Jetzt möchte ich aber auch wenn schon etwas ausgeführt wird einen weiteren Button betätigen um eine andere Aktion ausführen zu können. Kann man das nicht irgendwie "umschreiben"?
Why i cant see my Add-On Button
09/06/2008 - World of Warcraft - 2 Replies
I cant see it. When i log on with my Acc i cant see it i know where it is but... Sorry for my English it isnt perfect :S
help button
04/02/2008 - Conquer Online 2 - 1 Replies
hello everyone is there any way to eliminate the Help Button it is annoying



All times are GMT +1. The time now is 23:40.


Powered by vBulletin®
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2023 elitepvpers All Rights Reserved.