pankajv2 Posted November 4, 2019 Share Posted November 4, 2019 i am trying to click on the ok button of the msgbox by using click control and mouse click but I am unable to click it instead of clicking on ok the position of the msgbox is shifting please help Link to comment Share on other sites More sharing options...
Nine Posted November 4, 2019 Share Posted November 4, 2019 Show the code you have “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
pankajv2 Posted November 5, 2019 Author Share Posted November 5, 2019 Local $p = "Data to be searched" if stringregexp($p) then msgbox(passed) if not stringregexp($p) then msgbox(failed) WinWait("Error") WinActive("Error") Sleep(10) MouseClick('primary', 67, 106, 1, 0) i tried using mouse control but it os not clicking but it is shifting the pos of the msgbx, plz help Link to comment Share on other sites More sharing options...
Musashi Posted November 5, 2019 Share Posted November 5, 2019 (edited) 21 minutes ago, pankajv2 said: if stringregexp($p) then msgbox(passed) I'm sorry, but almost everything here is wrong. You should consult the help, in particular the part Parameters. https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm https://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm Edited November 5, 2019 by Musashi "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
pankajv2 Posted November 5, 2019 Author Share Posted November 5, 2019 25 minutes ago, Musashi said: I'm sorry, but almost everything here is wrong. You should consult the help, in particular the part Parameters. https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm https://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm Local $p = "DataMemory\.hex in DATA MEMORY area \.\.\.\R< File successfully loaded\.\N*\R" & _ ".*?DisplayModule\.hex in PROGRAM MEMORY area \.\.\.\R< File successfully loaded\.\N*\R" & _ ".*?OTAResetManager\.hex in PROGRAM MEMORY area \.\.\.\R< File successfully loaded\.\N*\R" & _ ".*?OTAServiceManager\.hex in PROGRAM MEMORY area \.\.\.\R< File successfully loaded\.\N*\R" If StringRegExp($string, $p) Then ;MsgBox(0, "Error", "µC programming passed") If Not StringRegExp($string, $p) Then ;MsgBox(0, "Error", "µC programming failed") WinWait("Error") WinActive("Error") Sleep(10) MouseClick('primary', 67, 106, 1, 0) Thanks for your comment, but the code we have written above is working. the msg box is appearing with "ok" tab. We do not want to use the time out command to dismiss the msg box. We want to click the "OK" tab. but it is not working by using mouse cursor coordinates. could you please help. Link to comment Share on other sites More sharing options...
Musashi Posted November 5, 2019 Share Posted November 5, 2019 (edited) 4 hours ago, pankajv2 said: Thanks for your comment, but the code we have written above is working. The code you have written may work, but not the code you have provided here . BTW : Are you somehow related to the user @shreya , or is this just a double account of yours? see : https://www.autoitscript.com/forum/topic/200717-i-want-to-know-how-can-we-validate-multiple-strings-from-a-file/?do=findComment&comment=1439926 Edited November 5, 2019 by Musashi typo "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
pankajv2 Posted November 5, 2019 Author Share Posted November 5, 2019 Yes, we are working on same task, but this is not a duplicate account.☺️ Link to comment Share on other sites More sharing options...
Musashi Posted November 5, 2019 Share Posted November 5, 2019 (edited) 7 hours ago, pankajv2 said: We do not want to use the time out command to dismiss the msg box. We want to click the "OK" tab. but it is not working by using mouse cursor coordinates. could you please help. Since you provided a non-runable fragment, here just some remarks : 1. The default API-generated MsgBox from AutoIt pauses the script. It is not possible to continue, unless you response to the MsgBox or use a timeout. The rest of the script ( WinWait("Error") ... ) will not be executed until the MsgBox was closed. - a possible solution could be (untested) : https://www.autoitscript.com/forum/topic/121609-notifybox-udf/ - also have a look at (untested) : https://www.autoitscript.com/forum/topic/136149-notify-new-version-26-apr-19/ Question : "If you want to click away the message box instantly, why are you displaying it at all?" 2. If StringRegExp($string, $p) Then ;MsgBox(0, "Error", "µC programming passed") If Not StringRegExp($string, $p) Then ;MsgBox(0, "Error", "µC programming failed") Should better be written like this : ; Example : Local $sString = "This is a String" Local $p = "This" ; pattern (just for demo) If StringRegExp($sString, $p) Then MsgBox(0, "Error", "µC programming passed") Else MsgBox(0, "Error", "µC programming failed") EndIf Sorry, but without more details, it's hard to help you. Edited November 5, 2019 by Musashi seadoggie01 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
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