Jump to content

Recommended Posts

Posted

I am trying to create a personal startup script for my computer and I don't know how to get the output from the msgbox. (i need to know what the result of the MsgBox is)

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        Tailor Mitchell (tailormitchell@hotmail.com)
;
; Script Function:
;   Personal startup script
;
; ----------------------------------------------------------------------------

; Script Start
#include <Inet.au3>

; Check to see if its running
$g_szVersion = "Startup Script 1.0"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)
; End Check

MsgBox(4132, "Startup", "Would you like to run the startup items?", 10) 
If MsgBox(6) Then 
    Run("Startup.au3")
ElseIf MsgBox(7)
    Sleep(10)
    Exit
ElseIf MsgBox(2)
    Sleep(10)
    Exit
Else
    Sleep(10)
    Exit

That's what I got so far...

Posted (edited)

I am trying to create a personal startup script for my computer and I don't know how to get the output from the msgbox. (i need to know what the result of the MsgBox is)

assign the result of a message box to a variable, like:

#include <Inet.au3>

; Check to see if its running
$g_szVersion = "Startup Script 1.0"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)
; End Check

$result = MsgBox(4132, "Startup", "Would you like to run the startup items?", 10) 
If $result = 6 Then
Run("Startup.au3")
Else
Sleep(10); why sleep before exit?
Exit
EndIf

***edit***

i had started to do a select case, then decided against it, had forgotten to remove the Select line

Edited by cameronsdad
Posted

local $options = BitOR($MB_YESNO, $MB_ICONQUESTION, $MB_DEFBUTTON2)
if MsgBox($options, "Title:", "Are you sure you want to shoot yourself?") = $IDNO then
    return
endif

Should get you started. The online help contains further advice. You'l also find the complete list of $MB and $ID constants in the include files in case the help does not list them.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...