Jump to content

Recommended Posts

Posted

Hi i need help with my little program what i what i do is i have a msgbox when he click yes it should display you click yes and if they click no it should display you click no

Program that i have is

#include <GUIConstants.au3>

msgbox(4,"Please click yes or no","Please click yes or no")

but the problem is i dont know how to continue thanks for the help in adavanced

Posted

$msg = msgbox(4,"Please click yes or no","Please click yes or no")
If  $msg = 6 Then
    MsgBox(0,"", "You answered yes")
Else
    MsgBox(0,"", "You answered no")
EndIf


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted (edited)

Another version

$msg = msgbox(4,"Please click yes or no","Please click yes or no")
If  $msg = 6 Then
    MsgBox(0,"", "You answered yes")
ElseIf $msg = 7 Then
    MsgBox(0,"", "You answered no")
EndIf

Incase there are more than 2 buttons.

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

  • Moderators
Posted

Or even:

Switch MsgBox(4,"Please click yes or no","Please click yes or no")
    Case 6
        MsgBox(0,"", "You answered yes")
    Case 7
        MsgBox(0,"", "You answered no")
EndSwitch

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.

Posted

Is there anyway to change the location of the message box?because it is being default into the center can i change it to be on the top most?thanks a lot

  • Moderators
Posted

Is there anyway to change the location of the message box?because it is being default into the center can i change it to be on the top most?thanks a lot

Instructions in the helpfile show you how to make it topmost.

The moving issue ... there are a couple of work around UDF's in the Scripts and Scraps forum.

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.

Posted (edited)

Instructions in the helpfile show you how to make it topmost.

The moving issue ... there are a couple of work around UDF's in the Scripts and Scraps forum.

I asked this question as one of my like 2nd questions

HereWasPlato Concocted this script which worked for me

;requires beta
;sure seems like a GUI would be easier
For $Int = 1 to 10 
_MoveMsgBox(0, $Int, $Int , 0 + Random(0,@DesktopWidth)-100,  Random(1,@DesktopHeight)-100)
Next

Func _MoveMsgBox($MBFlag, $MBTitle, $MBText, $x , $y)
    Local $file = FileOpen(EnvGet("temp") & "\MoveMB.au3", 2)
    If $file = -1 Then Return;if error, give up on the move
    
    Local $line0 = '#NoTrayIcon'
    Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'
    Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")'
    Local $line3 = 'WinMove("' & $MBTitle & '", "' & $MBText & '"' & ', ' & $x & ', ' & $y & ')'
    FileWrite($file,$line0 & @CRLF &  $line1 & @CRLF & $line2 & @CRLF & $line3)
    FileClose($file)
    
    Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MoveMB.au3")
    
    MsgBox($MBFlag, $MBTitle, $MBText)
    
    FileDelete(EnvGet("temp") & "\MoveMB.au3")
EndFunc;==>_MoveMsgBox
Edited by Paulie
  • Moderators
Posted

lol

"A tad" you say :nuke:

Wish I could use that, but i'm out a StringRegExp Function is it in an Include? cause i can't find it :P

They took the documentation out when they released 3.1.133... they haven't put it back yet, however, it's still a working function.

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.

Posted

They took the documentation out when they released 3.1.133... they haven't put it back yet, however, it's still a working function.

but is says Undefined function for me, and I'm using the latest release :P
  • Moderators
Posted

but is says Undefined function for me, and I'm using the latest release :P

That's only when you do an Au3Check in SciTe because it isn't in their pre-defined functions, just run it... you'll be fine.

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.

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