urmommie Posted April 13, 2009 Posted April 13, 2009 Well im new and I don't understand the tut's but I want to make something like this MsgBox(1, "Do you want to open notepad?") If answer yes Then Run("Notepad") Send("Hello{SPACE}Bob!") ;I want the send to be typed in notepad If someone can tell me what im doing wronge thanks !
exodius Posted April 13, 2009 Posted April 13, 2009 Well Hi and welcome to the forums. This is the proper formatting for what you posted. $answer = MsgBox(4, "Open Notepad", "Do you want to open notepad?") If $answer = 6 Then ; The return value if you hit "yes" is 6 Run("Notepad") WinWait ("Untitled - Notepad") ; Waiting for the Notepad window to exist WinWaitActive ("Untitled - Notepad") ; Waiting for it to be active, otherwise Send will fail. Send("Hello{SPACE}Bob!") ;I want the send to be typed in notepad EndIf I'd highly suggest you go look up all the functions you see used there and see how I did what I did.
Kip Posted April 13, 2009 Posted April 13, 2009 Please help im new to C++So...? MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
urmommie Posted April 13, 2009 Author Posted April 13, 2009 $answer = MsgBox(4, "Open Notepad", "Do you want to open notepad?") If $answer = 6 Then ; The return value if you hit "yes" is 6 Run("Notepad") WinWait ("Untitled - Notepad") ; Waiting for the Notepad window to exist WinWaitActive ("Untitled - Notepad") ; Waiting for it to be active, otherwise Send will fail. Send("Hello{SPACE}Bob!") ;I want the send to be typed in notepad EndIf Thanks man ok I have two questions for you what does the $answer = do? and also how did you know the return value of yes? like if I wanted to also add If $answer = 5 Then; 5 being no MsgBox(1, "Notepad will not open") this will mean that if he presses no it will send him that but what is the return value and how do you find them out?
Cynagen Posted April 13, 2009 Posted April 13, 2009 Well im new and I don't understand the tut's but I want to make something like this MsgBox(1, "Do you want to open notepad?") If answer yes Then Run("Notepad") Send("Hello{SPACE}Bob!");I want the send to be typed in notepad If someone can tell me what im doing wronge thanks ! You need to select the notepad window before you continue. Opt("WinTitleMatchMode",2) Run("notepad") WinActivate("Notepad","") Send("Hello{SPACE}Bob!") Blah, blah, blah... lip service... lip service.Working on a number of projects right now, just waiting for my time to post them here on AutoIt forums.
urmommie Posted April 13, 2009 Author Posted April 13, 2009 Why are you asking about C++ here?Where do I ask?
oMBRa Posted April 13, 2009 Posted April 13, 2009 Thanks man ok I have two questions for you what does the $answer = do? and also how did you know the return value of yes? like if I wanted to also add If $answer = 5 Then; 5 being no MsgBox(1, "Notepad will not open") this will mean that if he presses no it will send him that but what is the return value and how do you find them out? return values are in the help file
urmommie Posted April 13, 2009 Author Posted April 13, 2009 return values are in the help fileI looked i can't find return values
Juvigy Posted April 13, 2009 Posted April 13, 2009 In your case MsgBox returns 1 if you press "OK" and 2 if you press "cancel" Return Value Success: Returns the ID of the button pressed. Failure: Returns -1 if the message box timed out. Button Pressed Return Value OK 1 CANCEL 2 ABORT 3 RETRY 4 IGNORE 5 YES 6 NO 7 TRY AGAIN ** 10 CONTINUE ** 11
oMBRa Posted April 13, 2009 Posted April 13, 2009 open the help file then: Autoit--->Function Reference--->Message Boxes and Dialogs---> MsgBox
urmommie Posted April 13, 2009 Author Posted April 13, 2009 open the help file then:Autoit--->Function Reference--->Message Boxes and Dialogs---> MsgBoxThanks man you own !
urmommie Posted April 13, 2009 Author Posted April 13, 2009 In your case MsgBox returns 1 if you press "OK" and 2 if you press "cancel"Return ValueSuccess: Returns the ID of the button pressed. Failure: Returns -1 if the message box timed out. Button Pressed Return Value OK 1 CANCEL 2 ABORT 3 RETRY 4 IGNORE 5 YES 6 NO 7 TRY AGAIN ** 10 CONTINUE ** 11Thanks
Marlo Posted April 13, 2009 Posted April 13, 2009 i dont get what this has to do with C++ o_0 Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
exodius Posted April 13, 2009 Posted April 13, 2009 I'm guessing that he doesn't (or at least didn't) exactly understand that AutoIt is not C++.
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