efjay Posted March 7, 2006 Share Posted March 7, 2006 Hello, I am trying to create a simple message box with ok and cancel options. I have an autorun cd which runs an install with admin credentials but i want to give the option to cancel the installation. I cant figure out how to do this, I presume i need an if statement. can anyone help? Thanks Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 7, 2006 Moderators Share Posted March 7, 2006 MsgBox(1, 'test', 'testing') PS - Also in the helpfile under MsgBox() Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Joon Posted March 7, 2006 Share Posted March 7, 2006 C:\Program Files\AutoIt3\Examples\GUI\Advanced\msgboxwizard.au3 is handy also. Link to comment Share on other sites More sharing options...
Cloudsx Posted March 7, 2006 Share Posted March 7, 2006 try (MsgBox(1,"here your title", "here your text") Link to comment Share on other sites More sharing options...
JustMeAgain Posted March 7, 2006 Share Posted March 7, 2006 Hello, I am trying to create a simple message box with ok and cancel options. I have an autorun cd which runs an install with admin credentials but i want to give the option to cancel the installation. I cant figure out how to do this, I presume i need an if statement. can anyone help? ThanksYou'll want to do something like this: $prompt = msgbox(4129, "Continue?", "Click OK to auto run this CD or Cancel to exit now.") if $prompt = "2" exit <the rest of you code goes here> I find the AutoIt Help Index very useful and I usually keep it open beside SciTE while coding. Look up the options for "MsgBox" and all the other powerful commands in AutoIt. Or use the online manual. Link to comment Share on other sites More sharing options...
efjay Posted March 7, 2006 Author Share Posted March 7, 2006 (edited) thanks all for the replies. I tried all suggestions but they only gave me the box with options but didnt terminate the script. JustMeAgain's script worked fine. I did try the help as well but couldnt figure it out, but now it makes sense. Thanks again. Edited March 7, 2006 by efjay Link to comment Share on other sites More sharing options...
efjay Posted March 7, 2006 Author Share Posted March 7, 2006 Actually the examples pretty much answered my question, thanks for the heads up Joon Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 7, 2006 Moderators Share Posted March 7, 2006 thanks all for the replies. I tried all suggestions but they only gave me the box with options but didnt terminate the script. JustMeAgain's script worked fine. I did try the help as well but couldnt figure it out, but now it makes sense. Thanks again.If MsgBox(1, 'Test', 'Testing') = 2 Then Exit Will Exit if the Cancel Button is Pressed, change it to 1 if you want it to exit when the OK button is pressed. ahmeddzcom 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
efjay Posted March 7, 2006 Author Share Posted March 7, 2006 (edited) Thanks SmOke_N, thats even clearer. Edited March 7, 2006 by efjay Link to comment Share on other sites More sharing options...
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