Jump to content

Getting active window


Recommended Posts

Greetings,

I am using WinList to get a list of windows matching a specific name. I loop through them using a For loop, and I need to make a conditional checking to make sure that it isn't the active window. WinActive only returns based on title and text, and since there are multiple windows of the same name it won't work. I need to use a function such as WinActive to retrieve a window based on a handle. How can I accomplish this? Thanks in advance.

Regards,

Eradicator

Edited by Eradicator
Link to comment
Share on other sites

Greetings,

I am using WinList to get a list of windows matching a specific name. I loop through them using a For loop, and I need to make a conditional checking to make sure that it isn't the active window. WinActive only returns based on title and text, and since there are multiple windows of the same name it won't work. I need to use a function such as WinActive to retrieve a window based on a handle. How can I accomplish this? Thanks in advance.

Regards,

Eradicator

I'm not sure if this is what you want because it's not obvious to me that what you asked for in your post matches the title you used.

The currently active window handle would be

$hWnd_Active = WInGetHandle(WingetTitle(""))

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I'm not sure if this is what you want because it's not obvious to me that what you asked for in your post matches the title you used.

The currently active window handle would be

$hWnd_Active = WInGetHandle(WingetTitle(""))

Thank you, i'll try it. I'll be using a conditional to compare to make sure that that doesn't equal the window being used in the for loop.

EDIT: Worked fine, thank you.

Edited by Eradicator
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...