dai Posted May 18, 2009 Share Posted May 18, 2009 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! Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 19, 2009 Share Posted May 19, 2009 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. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
dai Posted May 19, 2009 Author Share Posted May 19, 2009 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!!! Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 19, 2009 Share Posted May 19, 2009 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. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
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