bluespirit Posted April 8, 2008 Posted April 8, 2008 Is there any way of stopping a message box from losing focus? Although the MsgBox function will pause the running of a script, I can still click away from the message box and onto my main GUI window. Although the main window does not process any user input (i.e. mouse clicks) it saves them up and processes them when the message box is closed. It would be great if it acted like most windows applications, i.e. when the main GUI window was clicked it, it flashes the message box and makes it active again. J
rasim Posted April 8, 2008 Posted April 8, 2008 Like this? #include <GuiConstants.au3> $hGUI = GUICreate("Test GUI", 200, 100) $button = GUICtrlCreateButton("Test", 50, 50, 60, 25) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $button _MsgBox(64, "Some title", "Some text", $hGUI) EndSwitch WEnd Func _MsgBox($sFlag = 0, $sTitle = "", $sText = "", $hWnd = 0) DllCall("user32.dll", "int", "MessageBox", "hwnd", $hWnd, "str", $sText, "str", $sTitle, "int", $sFlag) EndFunc
bluespirit Posted April 8, 2008 Author Posted April 8, 2008 That's exactly the sort of thing I was looking for. Thanks for that. J
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