HankHell Posted February 6, 2018 Share Posted February 6, 2018 is it possible to have more than a single msgbox open on the screen simultaneously? I'm trying to specify 2 different points where a msgbox is to open, however I can only seem to get a single box to open at once, the other one only opens after clicking "Ok". Link to comment Share on other sites More sharing options...
AdamUL Posted February 6, 2018 Share Posted February 6, 2018 (edited) Here is an example, using re-execution, that I have used to have multiple message boxes at once. expandcollapse popupIf StringInStr($CmdLineRaw, '/MsgBoxData') Then ;Creates Return Message boxes. Opt("TrayIconHide", 1) ;Hide tray icon for rerun script that shows the Message box. $CmdLineRaw = StringSplit(StringMid($CmdLineRaw, StringInStr($CmdLineRaw, '/MsgBoxData')), ';') $aMsgBoxData = StringSplit($CmdLineRaw[2], "|") Switch $aMsgBoxData[0] Case 3 MsgBox($aMsgBoxData[1], $aMsgBoxData[2], $aMsgBoxData[3]) Case 4 MsgBox($aMsgBoxData[1], $aMsgBoxData[2], $aMsgBoxData[3], $aMsgBoxData[4]) Case 5 MsgBox($aMsgBoxData[1], $aMsgBoxData[2], $aMsgBoxData[3], $aMsgBoxData[4], $aMsgBoxData[5]) EndSwitch Exit EndIf Global $iReturnBoxPID Global $sReturnBoxPIDs = "" For $i = 0 To 10 $iReturnBoxPID = _MsgBoxEx(0, "Test " & $i, "This is test " & $i & ".") $sReturnBoxPIDs &= $iReturnBoxPID & "|" Next Sleep(10000) ;Sleep to 10 sec. ;Close all open message boxes Global $aReturnBoxPIDs = StringSplit(StringTrimRight($sReturnBoxPIDs, 1), "|") For $iPID = 1 To $aReturnBoxPIDs[0] Step 1 ProcessClose($aReturnBoxPIDs[$iPID]) Next Func _MsgBoxEx($iFlag, $sTitle, $sText, $iTimeOut = 0, $iHwnd = 0) ;Show a message box for the data. If $iTimeOut = 0 And $iHwnd = 0 Then $sMsgBoxDataEx = $iFlag & '|' & $sTitle & '|' & $sText ElseIf $iTimeOut <> 0 And $iHwnd = 0 Then $sMsgBoxDataEx = $iFlag & '|' & $sTitle & '|' & $sText &'|' & $iTimeOut Else $sMsgBoxDataEx = $iFlag & '|' & $sTitle & '|' & $sText & '|' & $iTimeOut & '|' & $iHwnd EndIf If @Compiled Then Return(Run(@ScriptFullPath & ' /MsgBoxData;' & $sMsgBoxDataEx)) Else Return(Run(@AutoItExe & ' "' & @ScriptFullPath & '" /MsgBoxData;' & $sMsgBoxDataEx)) EndIf EndFunc Adam Edited February 7, 2018 by AdamUL pragma not needed. HankHell 1 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 6, 2018 Moderators Share Posted February 6, 2018 Or, much more simply - just create your own MsgBox GUIs "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
HankHell Posted February 7, 2018 Author Share Posted February 7, 2018 27 minutes ago, JLogan3o13 said: Or, much more simply - just create your own MsgBox GUIs ahhhh, very good point, ty Link to comment Share on other sites More sharing options...
jdelaney Posted February 7, 2018 Share Posted February 7, 2018 From the 'usability' perspective, it would be better to combine the messages into one popup...no one like closing 1 million popups. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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