Sign in to follow this  
Followers 0
Unluckee

Stupid Question

4 posts in this topic

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...

Share this post


Link to post
Share on other sites



#2 ·  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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Thanks! I'll try that.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0