Sign in to follow this  
Followers 0
dai

controlling windows with unknown/non-unique titles

4 posts in this topic

Hi. I would like to control several windows that match the same class but whose titles are unpredictable. If I try to control them by class, I can only control one of them (apparently the first one in the list that matches my class string). If I try to obtain the list of windows using WinList, then it is impossible to tell the class of each window since WinList only returns the title string and the handle.

As a simple example, suppose you wanted to move three different pre-existing explorer windows. You could move one of them directly using WinMove("[CLASS:ExploreWClass]", ...). But you could not move any of the others. Calling WinList would return a bunch of titles and handles but you would have no way of knowing which windows in the list are explorer windows. And even if you did, WinMove does not accept a handle as an argument.

I must be missing something important. Help!

Share this post


Link to post
Share on other sites



Welcome to the forum.

First of all, WinMove() do accept a handle, check it's page in the helpfile.

You can use _WinAPI_GetClassName() to get a class.

I checked the help file again and could not find anything about WinMove accepting a handle. However, I tried it anyway and it works! And _WinAPI_GetClassName() solves my problem. THANKS!!!

Share this post


Link to post
Share on other sites

At the end of the "title" line there is a link that says "Title special definition" which leads to the page "Window Titles and Text (Advanced)" and at the bottom of that it is explained that AutoIt has support for Window Handles / HWNDs. It's not that hard to find.

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  
Followers 0