Keymaker Posted January 25, 2009 Share Posted January 25, 2009 I am writing a "wrapper" program for an audio player using AutoIT. I need the window handle so I can manipulate the windows controls. Unfortunately, the player's window title changes depending on which song or track is playing so I can't reliably use that to get the window handle. The Process name does not change though. Is there a way I can get the window handle if I know the process name? Thanks Keymaker Link to comment Share on other sites More sharing options...
Developers Jos Posted January 25, 2009 Developers Share Posted January 25, 2009 Have you checked with the supplied au3info.exe to see if you can identify the window on any other unique information? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Keymaker Posted January 25, 2009 Author Share Posted January 25, 2009 Have you checked with the supplied au3info.exe to see if you can identify the window on any other unique information?JosHello Jos,Yes, I did. It has the ubiquitous #32770 as the class label. However, the controls in the window are relatively unique, so if if there was way to enumerate the controls of a window, I could check all the windows of class #32770 and see which one had a certain control. That may be another option and any suggestions on how to acomplish that are welcome.ThanksKeymaker Link to comment Share on other sites More sharing options...
zfisherdrums Posted January 26, 2009 Share Posted January 26, 2009 Hello Jos, Yes, I did. It has the ubiquitous #32770 as the class label. However, the controls in the window are relatively unique, so if if there was way to enumerate the controls of a window, I could check all the windows of class #32770 and see which one had a certain control. That may be another option and any suggestions on how to acomplish that are welcome. Thanks Keymaker I like your workaround. Check out WinGetClassList for control class enumeration. What may also work is to send a command to a control that you are reasonably assured will be unique to your app. For example, sending ControlGetHandle( "[CLASS:#32770]", "", "Play" ). If it returns a valid handle, you can obtain the parent window using _WinAPI_GetParent(). Hope this helped, Zach Fisher... Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
rasim Posted January 26, 2009 Share Posted January 26, 2009 @KeymakerSee here 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