timmy2

In MsgBox, how do SystemModal and TopMost differ?

3 posts in this topic

I'm probably just being dense but when I run both of these scripts (compiled) I don't detect any difference in the user experience. (am running Windows 8.1 64b)

SystemModal

#include <GUIConstantsEx.au3>
 #include <MsgBoxConstants.au3>

 $hGUI = GUICreate("Test", 500, 500)
 GUISetState()

 MsgBox($MB_SYSTEMMODAL, "SystemModal", "Press me to continue")

 While 1
     Switch GUIGetMsg()
         Case $GUI_EVENT_CLOSE
             Exit
     EndSwitch
 WEnd

 

TopMost

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

 $hGUI = GUICreate("Test", 500, 500)
 GUISetState()

 MsgBox($MB_TOPMOST, "TopMost", "Press me to continue")

 While 1
     Switch GUIGetMsg()
         Case $GUI_EVENT_CLOSE
             Exit
     EndSwitch
 WEnd

 

 

Share this post


Link to post
Share on other sites



There is not an icon on the top left of the window using the $MB_TOPMOST. 

$MB_SYSTEMMODAL 4096    System modal (dialog has an icon)

$MB_TOPMOST 262144  MsgBox() has top-most attribute set

 


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

There is not an icon on the top left of the window using the $MB_TOPMOST. 

$MB_SYSTEMMODAL 4096    System modal (dialog has an icon)

$MB_TOPMOST 262144  MsgBox() has top-most attribute set

 

Thank you, MikahS, you are correct sir!  I had not noticed the icon. 

I thought SystemModal had more to do with "blocking", but it doesn't seem to block any more than TopMost. Maybe the icon is the only diff.

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

  • Similar Content

    • Nareshm
      By Nareshm
      I have autoit script like this :
      winActivate ("BillReceipt") ControlClick ( "BillReceipt", "", "[NAME:winviewer]", "right") Send ( "{ENTER}") WinWait ("Print") ControlClick ("Print", "", "[CLASS:Button; INSTANCE:13]") Winwait ("Save As") WinActivate ("Save As") Send ("{TAB 5} {Backspace} ^v {Enter}") I need Saved successfully msgbox with file name as i saved like Filename.extension (Example = test.pdf is saved successfull)

      Please Help
    • Skysnake
      By Skysnake
      Hi Gang
      Is there a definition of what exactly 
      $MB_SYSTEMMODAL means and when it should (and not) be used?
      Like in 
      #include <MsgBoxConstants.au3> MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10) Thanks
      Skysnake
    • Verssuss
      By Verssuss
      hi guys i want avoid to multiple MsgBox by hold Hotkey "]" in my script
       
      #include <GuiConstantsEx.au3> #include <Windowsconstants.au3> #include <SendMessage.au3> #include <WinAPI.au3> ;~ HotKeySet("{[}", "_boxminus") HotKeySet("{]}", "_boxplus") HotKeySet("{ESC}", "On_Exit") $hGUI = GUICreate("", 100, 100, -1, -1, $WS_POPUP, BitOr($WS_EX_LAYERED, $WS_EX_COMPOSITED, $WS_EX_TOPMOST)) GUISetBkColor(0x00FF00) GuiCtrlCreateLabel("", 3, 3, 94, 94) GUICtrlSetBkColor(-1, 0xABCDEF) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUISetState() _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF) $box_range = 100 While 1 $pos = MouseGetPos() WinMove($hGUI, "", $pos[0] - ($box_range / 2), $pos[1] - ($box_range / 2), $box_range, $box_range) WEnd ;~ Func _boxminus() ;~ If $box_range >= 30 Then $box_range = $box_range - 10 ;~ If $box_range < 30 Then $box_range = $box_range - 1 ;~ EndFunc Func _boxplus() If $box_range < 200 Then $box_range = $box_range + 10 Else MsgBox(0,"ERROR", "Maximum size already exist") EndIf EndFunc Func On_Exit() Exit EndFunc i wish after i get first MsgBox another gonna replaced with first one or just cancel in and apeear again
      how can i make it right ???
    • AnonymousX
      By AnonymousX
      Hello,
      I'm trying to make it so that when a message box pops up that the GUI will be unresponsive until that message box has been closed. From reading through the help the closest thing I can find is the WinWaitClose function, however this doesn't work fully as desired. If user tries to click on GUI the actions are more just waiting for the message box to close, so that once it closes everything happens at once. I want it so that the GUI is completely unusable until message box is closed. 
       
      Below is test code to demonstrate the problem and help explain what I want. Any advice on this?
       
      #include <GUIConstantsEx.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example") Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) local $but = GUICtrlCreateButton("Hello", 150,150,85,25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) MsgBox( 262144,"Message","Try hitting the hello button several times,without closing this window. Now close this window and see how script wasn't restricted it just was waiting and storing the instructions") WinWaitClose("Message") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK Exit case $but MsgBox(0,"","Hello") EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example  
    • hcI
      By hcI
      Hello !
      I'm making a little script with only a tray option, no GUI.
      And i would like to know if someone created a function to set a personalized icon in top-left corner of the MsgBox and/or InputBox...
      -hcI