ITSky8 Posted February 23, 2008 Share Posted February 23, 2008 Hello! I would like to know how to detect the Pop Up dialog? As I have a Software which will pop up an error dialog to inform the user, and need to press he OK to shutdown the Software. For that, I would like to use AutoIT to write a monitoring tools, once detected the pop up from that Software, then Kill the process, and restart the Software again, so how to do so? Link to comment Share on other sites More sharing options...
rmarino Posted February 23, 2008 Share Posted February 23, 2008 Hello!I would like to know how to detect the Pop Up dialog? As I have a Software which will pop up an error dialog to inform the user, and need to press he OK to shutdown the Software. For that, I would like to use AutoIT to write a monitoring tools, once detected the pop up from that Software, then Kill the process, and restart the Software again, so how to do so?You can use WinWaitActive to pause a script until the pop up is produced. Link to comment Share on other sites More sharing options...
rasim Posted February 24, 2008 Share Posted February 24, 2008 (edited) ITSky8Hi! I found solution for GUI, probably possible make this action for another app. windows. #include <GuiConstants.au3> #include <GuiMenu.au3> Global $id_Open = 1000 $hGui = GUICreate("Menu test", 300, 200) GUIRegisterMsg($WM_INITMENUPOPUP, "WM_INITMENUPOPUP") GUIRegisterMsg($WM_CONTEXTMENU, "WM_CONTEXTMENU") GUISetState() Do Until GUIGetMsg() = -3 Func WM_INITMENUPOPUP($hWnd, $Msg, $wParam, $lParam) ConsoleWrite("Popup menu appear" & @LF) Return $GUI_RUNDEFMSG EndFunc Func WM_CONTEXTMENU($hWnd, $iMsg, $iwParam, $ilParam) Local $hMenu $hMenu = _GUICtrlMenu_CreatePopup () _GUICtrlMenu_InsertMenuItem ($hMenu, 0, "Open", $id_Open) _GUICtrlMenu_TrackPopupMenu ($hMenu, $iwParam) _GUICtrlMenu_DestroyMenu ($hMenu) Return True EndFunc ;==>WM_CONTEXTMENU Edited February 24, 2008 by rasim Link to comment Share on other sites More sharing options...
ITSky8 Posted February 25, 2008 Author Share Posted February 25, 2008 Hello! Does this really work, does it really work or not? ITSky8 Hi! I found solution for GUI, probably possible make this action for another app. windows. #include <GuiConstants.au3> #include <GuiMenu.au3> Global $id_Open = 1000 $hGui = GUICreate("Menu test", 300, 200) GUIRegisterMsg($WM_INITMENUPOPUP, "WM_INITMENUPOPUP") GUIRegisterMsg($WM_CONTEXTMENU, "WM_CONTEXTMENU") GUISetState() Do Until GUIGetMsg() = -3 Func WM_INITMENUPOPUP($hWnd, $Msg, $wParam, $lParam) ConsoleWrite("Popup menu appear" & @LF) Return $GUI_RUNDEFMSG EndFunc Func WM_CONTEXTMENU($hWnd, $iMsg, $iwParam, $ilParam) Local $hMenu $hMenu = _GUICtrlMenu_CreatePopup () _GUICtrlMenu_InsertMenuItem ($hMenu, 0, "Open", $id_Open) _GUICtrlMenu_TrackPopupMenu ($hMenu, $iwParam) _GUICtrlMenu_DestroyMenu ($hMenu) Return True EndFunc ;==>WM_CONTEXTMENU 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