Tuna Posted June 19, 2010 Share Posted June 19, 2010 ok stupid newbie question lets say I have a program to shut down my comp after it has run. I want to put a msgbox up with the yes and no buttons.( this much I can do) how do I get it to stop shutdown by clicking on no. and continue shutdown if yes is clicked or box times out? Link to comment Share on other sites More sharing options...
JohnOne Posted June 19, 2010 Share Posted June 19, 2010 Show the code you have AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 19, 2010 Moderators Share Posted June 19, 2010 Tuna,Welcome to the AutoIt forum. You need to check the return from your MsgBox. From the Help file for MsgBox:Return Value - Success: Returns the ID of the button pressed. Button Pressed Return Value YES 6 NO 7So you need something like this:$iReply = MsgBox(4, "ShutDown", "Dou you really want to shutdowm?") If $iReply = 6 Then MsgBox(0, "Reply", "You pressed 'Yes'") If $iReply = 7 Then MsgBox(0, "Reply", "You pressed 'No'")There are fancier ways to do it, but we will start with that!To shut down - look in the Help file for Shutdown. As you might have noticed - the Help file is a good place to look for help on AutoIt. As you are obviously new to coding, might I suggest that you read the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) - this will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. I know you want to start coding NOW, but a little study will save you a lot of trouble later on, believe me. I hope this helps. Enjoy coding in Autoit. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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