daddydave Posted May 21, 2008 Posted May 21, 2008 I want to get messages from any visible window: regardless of whether it is created by my program. Here is what I am trying, none of my debug output is showing. What do you suggest? expandcollapse popup#include <GUIConstants.au3> #include <Debug.au3> Opt("MustDeclareVars", 1) Global $var[100] Global $hWnd, $msg, $i $var = WinList() _DebugSetup ("What's going on?") While 1 For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then $hWnd = $var[$i][1] GUISwitch($hWnd) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE _DebugOut("Closed") Case $msg = $GUI_EVENT_MINIMIZE _DebugOut("Minimized") Case $msg = $GUI_EVENT_MAXIMIZE _DebugOut("Maximized") EndSelect EndIf Next WEnd Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible
Zedna Posted May 21, 2008 Posted May 21, 2008 (edited) Look at AnyGUIEDIT: Your code is absolutelly wrong. All GUIxxx() functions can be used only with your AutoIt's GUI windows Edited May 21, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
daddydave Posted May 22, 2008 Author Posted May 22, 2008 Thanks for the fast reply, Zedna, that example looks like good stuff!
daddydave Posted May 26, 2008 Author Posted May 26, 2008 (edited) It turns out I don't need to monitor messages per se. I found a nice example very similar to what I want to do:http://www.autoitscript.com/forum/index.ph...mp;#entry161762_GuiTarget from the AnyGUI link you gave uses some of the API functions used by the example above, but it took me a while to find it.So thanks again! Edited May 26, 2008 by daddydave
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