Jump to content

Get handle to a window


 Share

Recommended Posts

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

  • Developers

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

Have you checked with the supplied au3info.exe to see if you can identify the window on any other unique information?

Jos

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

Link to comment
Share on other sites

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...

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...