Jump to content

How To Check Only For Visible Windows?


Guest robinx99
 Share

Recommended Posts

Guest robinx99

Hi,

is there a way to make autoit only check for visible windows?

My Problem is I'm trying to do a script that send some commands to VirtualDub.

I tried to to use a while wend loop, which shoud stop if there is no VirtualDub Window anymore. And in this loop there is activated a Frame Server. This Function of Virtualdub hides the original window and opends a new window named 'Frameserver mode - VirtualDub'. So I can't use my loop

while (WinExists ("VirtualDub"))
...
wend

Is there a way to check only for Vissible windows or must I use a dirty trick and rename the hidden window at the end of the loop

robinx99

Link to comment
Share on other sites

the new version of AutoIt3 has WinGetState ( "title" [, "text"] )

Return Value

Success: Returns a value indicating the state of the window. Multiple values are added together so use BitAND() to examine the part you are interested in:

    1 = Window exists

    2 = Window is visible

    4 = Windows is enabled

    8 = Window is active

    16 = Window is minimized

    32 = Windows is maximized

Failure: Returns 0 and sets @error to 1 if the window is not found.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Guest robinx99

not sure if this helps.

When I have 2 Virtualdub Windows. And I want to do the same thing on every window (ends with start of frameserver, so the virtualdub window is hidden)

so a check if a window is hidden is not much of use.

If I have 2 Windows one hidden and one not. Both Windows have the same name. A check if the Window is hidden would return hidden, because of I have two windows that have the same name and the last active one is the one that is hidden.

I think I need something like "Winactivate ("Virtualdub","","NOT_HIDDEN") or if it is possible to get the number of Windows with the same name to activate a window by number.

At the moment I have a working script that renames the hidden window, but I don't think it is the best solution

robinx99

Link to comment
Share on other sites

Problems like this are one of the reason for the DetectHiddenWindows command in AutoHotkey. If there is no reasonable workaround, perhaps Jon can add a new Set option for whether scripts "see" hidden windows.

I found it strange at first that v2 never detects hidden windows, while v3 always does.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...