Jump to content
Sign in to follow this  
caramen

MsgBox 4 return value ?

Recommended Posts

caramen

Hello guy got some trouble in this easy script

 

Case $BoutonWhrite1
                 $Case1 =  MsgBox (4,"Are you sure ?" ,"Reg key gonna be changed." )
                  While 1
                    If $Case1 = "No" Then
                       ConsoleWrite(">Case -1 Started" & @CRLF)
                       ExitLoop
                    EndIf
                        $InputType = InputBox ("Value Type ?", 'Type of key to write: "REG_SZ", "REG_MULTI_SZ", "REG_EXPAND_SZ", "REG_DWORD", "REG_QWORD", or "REG_BINARY".' )
;~                      RegWrite (""&Reg1,""&$RegName1,""&$InputType, ""&$RegValue1)
                        ExitLoop
                  WEnd

I tryed

If $case1 = 1

If $case1 = -1

If $case1 = "No"

 

What is the returned value by the msg box YES or NO ?

 

The script is going wrong about the final purpose (Whrite a Registry key if the Script user unswer YES ) But dont take attention i am gonna corect after get the returned value xD it was for testing. 

Edited by caramen

My video tutorials : HERE ( In construction ) 

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Terenz

On the help of MsgBox there are all the return value:

Yes = 6 = $IDYES

No = 7 = $IDNO

MsgBox

You can see also adding:

MsgBox(0,0,$Case1)

After that MsgBox

  • Like 1

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites
caramen

nvm

Edited by caramen

My video tutorials : HERE ( In construction ) 

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
caramen

I watched the help file and missed the return value section... :>


My video tutorials : HERE ( In construction ) 

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
AutoBert
56 minutes ago, caramen said:

I tryed

If $case1 = 1

If $case1 = -1

If $case1 = "No"

 

What is the returned value by the msg box YES or NO ?

 

Don't use maic numbers use the constansts, its easier to read source:

#include <MsgBoxConstants.au3>

While 1
    $iAnwer = MsgBox($MB_ICONQUESTION + $MB_YESNO, "Title", "Are you sure ?", "Reg key gonna be changed.")
    Switch $iAnwer
        Case $IDYes
            MsgBox(0, 'You clicked:', 'Yes')
            Exit
        Case $IDNo
            MsgBox(0, 'You clicked:', 'No')
    EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites
caramen

It s working anyway so, this is just a preference thing :) Thx for the tips anyway. 

 

Case $BoutonWhrite1
                 $Case1 =  MsgBox (4,"Are you sure ?" ,"Reg key gonna be changed." )
                    If $Case1 = 7 Then
                       ConsoleWrite(">Case -1 Started" & @CRLF)
                    ElseIf $Case1 = 6 Then
                        $InputType1 = InputBox ("Value Type ?", 'Ecrivez le type de clef:'& @CRLF&'"REG_SZ", "REG_MULTI_SZ", "REG_EXPAND_SZ", "REG_DWORD", "REG_QWORD", or "REG_BINARY".' )
                        If $InputType1 = 'REG_SZ' Or 'REG_MULTI_SZ' Or 'REG_EXPAND_SZ' Or 'REG_DWORD' Or 'REG_QWORD' Or 'REG_BINARY' Then
                           MsgBox($MB_SYSTEMMODAL, "", $InputType1&" was entered")
                           ConsoleWrite(">Registre ecri" & @CRLF)
;~                      RegWrite (""&$Reg1,""&$RegName1,""&$InputType1, ""&$RegValue1)
                        Else
                           ConsoleWrite(">Registre non ecri" & @CRLF)
                        MsgBox($MB_SYSTEMMODAL, "Attention", "Le type n'est pa correct")
                        EndIf
                    EndIf

New probleme i use Input box to get the Reg key added but i want to add a security check

If the type is not like in the condition then Msgbox 

 

Why the returned value of the inputbox is activating the first condition always ??? even if i type ALLo or test or lol i want to passe it only in these case : 

'REG_SZ' Or 'REG_MULTI_SZ' Or 'REG_EXPAND_SZ' Or 'REG_DWORD' Or 'REG_QWORD' Or 'REG_BINARY'

 

but seem like it s totaly ignoring them 

 

Rofl i dont get it... So easy syntax but not working LOL ...........:'(

 

Edited by caramen

My video tutorials : HERE ( In construction ) 

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
caramen

ops i got it : 

If $InputType1 = 'REG_SZ' Or $InputType1 = 'REG_MULTI_SZ' Or $InputType1 ='REG_EXPAND_SZ' Or $InputType1 ='REG_DWORD' Or $InputType1 ='REG_QWORD' Or $InputType1 ='REG_BINARY' Then

@Synapsee

True... I am gonna do that

 

Edited by caramen

My video tutorials : HERE ( In construction ) 

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
VIP

my bad:
 

$Case1 = MsgBox(4, "Are you sure ?", "Reg key gonna be changed.")
If $Case1 = 7 Then
    ConsoleWrite(">Case -1 Started" & @CRLF)
Else
    $InputType1 = InputBox("Value Type ?", 'Ecrivez le type de clef:' & @CRLF & '"REG_SZ", "REG_MULTI_SZ", "REG_EXPAND_SZ", "REG_DWORD", "REG_QWORD", or "REG_BINARY".')
    If StringInStr('REG_SZ|REG_MULTI_SZ|REG_EXPAND_SZ|REG_DWORD|REG_QWORD|REG_BINARY', $InputType1, 1) Then
        MsgBox(64, "", $InputType1 & " was entered")
        ConsoleWrite(">Registre ecri" & @CRLF)
;~                      RegWrite (""&$Reg1,""&$RegName1,""&$InputType1, ""&$RegValue1)
    Else
        ConsoleWrite(">Registre non ecri" & @CRLF)
        MsgBox(48, "Attention", "Le type n'est pa correct")
    EndIf
EndIf

 


Regards,
 

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  

  • Similar Content

    • editcheck
      By editcheck
      Hi, after years of use autoit i am tired to type all time:
      msgbox('','','Hi')
      So, wanna mod the function for set default values... or some more changes.
      where is the function?
      or there are another modes for debug messages that i do not knowed ? XD [just wanna like alert('text')]
      And is there any place for all integrates functions ?
      Thank. Sry my english =E
    • Ackerz
      By Ackerz
      Hi guys,
      So I am trying to automate a task and this task has an input box with an already set character "9". 
      I have just decided that I don't really need the input as an option but it's good to leave however for this instance I would like it to run past this point automatically. I've tried numerous ways to try and automate the use of the "OK" button using ControlClick and various other options. I just can't seem to see where this point in the script is. Scoured the forums for anything similar but didn't have any luck finding anything. Sorry to be a pain and I hope someone can help, if I haven't explained in enough detail please don't hesitate to ask for more.
      Many thanks,
      Ackerz
       
      Local $len Local $n Local $buff Local $aMyDate $Len = InputBox("Test",$msgPrompt,"9") $len = StringStripWS($len,$STR_STRIPALL) ;Check that user has entered a vaild password length if not StringIsDigit($len) or $len = 0 Then MsgBox(48,"Error","Invaild Integer was entered" & @CRLF & "Program will now exit.") Exit EndIf ;This creates the random password. for $i = 1 to $Len ;Pick a random char between 1 and the pwsMask Length $n = int(random(1,StringLen($pwsMask))) ;Concat each char that has been picked out of pwsMask to $buff $buff = $Buff & StringMid($pwsmask,$n,1) Next  
    • xtcislove
      By xtcislove
      Hello,
      as a start in Autoit i tried something i was missing since im using Autoit. 

      I build a custom MessageBox which has a large amount of custom options and which scales its size on the parameters you set. 

      Aviable Settings:
      -Title
      -Unlimited Buttons
      -Text Color (Buttons, Text)

      -Background Color (Msgbox, Buttons, Label) 

      -Button Timeout
      -Autoclose Timeout
      -Icon (Default, No Icon, Custom)

      -Label/ Button Style. 
      -Transparency

      I tried to keep this as close as i could to a Msgbox i was used too on my batch times.

      After i was ready i realised, @Melba23 probably build a way better msgbox which would have suit my needs enterly, anyway thanks to @Melba23 because i use his Stringsize UDF. 

       
       
      local $Message = _sMsgBox("Test", 6, "Continue?") if @extended <> -1 Then MsgBox(0, @extended, $Message&" Button pressed")  
      ScalingMessageBox.au3
    • SkysLastChance
      By SkysLastChance
      I am having a hard time understanding why this is not working. I was hoping some one could help explain it to me. 
      $tags = $oIE.document.GetElementsByTagName("input") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "fTs-p3298-l0 wplEditControl" Then $target = $tag ExitLoop EndIF Next MsgBox(0,"",$target) If $target = "fTs-p3298-l0 wplEditControl" THEN MsgBox(0,"","itworked") I have tried 
       MsgBox(0,"",$target.Attribute)  MsgBox(0,"",$target.Value)  MsgBox(0,"",$target.InnerText) I would expect to see this in the msgbox
      fTs-p3298-l0 wplEditControl  
    • fenhanxue
      By fenhanxue
      in msdn :https://msdn.microsoft.com/en-us/library/windows/desktop/aa384045(v=vs.85).aspx
      it says:

       
      I want to how how can i get the Return value (S_OK  or  error value )
      here is my codes as follow:
      Local $post_data = '123' Local $post_url = 'http://127.0.0.1/test.php' Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("POST", $post_url, True) Local $Return_Value = $oHTTP.Send($post_data) $oHTTP.WaitForResponse(-1) Local $res = $oHTTP.responsetext MsgBox(0,'$Return_Value',$Return_Value);IT shows nothing ;why ? how can i get S_OK or error value ?  
×