Sign in to follow this  
Followers 0
Queener

active msgbox & prompt

2 posts in this topic

#1 ·  Posted (edited)

 

#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $StatusView = GUICreate("Window Title",600,400,-1,-1, BitOR($WS_SIZEBOX, $WS_SYSMENU), $WS_EX_TOPMOST) GUISetFont(14, 400, Default, "Arial") $CtrlStatus = GUICtrlCreateLabel("This is a test", 0, 0, 600, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetFont(-1, 10, 400, Default, "Arial Black") GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUISetState(@SW_SHOW, $StatusView) While 1     $Event = GUIGetMsg()     If $Event = $GUI_EVENT_CLOSE Then         ExitLoop     EndIf WEnd Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)     Local $aPos = ControlGetPos($StatusView, "", $CtrlStatus)     Local $iSize = $aPos[3] - 4         If $iSize > 10 Then         $iSize = 10     ElseIf $iSize <= 0 Then         $iSize = 1     EndIf         GUICtrlSetFont($CtrlStatus, $iSize, 400, Default, "Arial Black")     Return $GUI_RUNDEFMSG EndFunc

 

 

 

I used this code and tweaked a little. The resize windows does work, but it appear that when a msgbox or inputbox is triggered, it's hidden behind the gui. Is there a way I can't bring it forward? I tried winactive/winactivate as well.

 

 

EDIT: Nevermind... I read the code again and realize I saw $WS_EX_TOPMOST then did a research on it and that was the cause of the GUI always on top of all application regardless... So when removing that; I now see my msgbox when prompted.

Edited by Queener
Resolved

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites



Use 5. parameter (hwnd) of MsgBox, and MsgBoxes of your Gui (created with '$WS_EX_TOPMOST' as extended style) will be in front of your Gui.

Next time format your script better before posting.

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
Sign in to follow this  
Followers 0