Jump to content
Sign in to follow this  
daddydave

How do I get messages from multiple non-AutoIt windows?

Recommended Posts

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?

#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

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  

×
×
  • Create New...