Jump to content

Reading taskbar buttons


Recommended Posts

I am looking for a way to check which taskbar button is pressed(active) so that I can see which application is currently in use by the user. Checking for the active window is not possible in my situation as the main window of my application has child windows and when one of these are active the main window is deactivated.....

I could not find a usuable function in the documentation but I am sure there must be a way to read the taskbar buttons. Someone with a solution??

Link to comment
Share on other sites

I am looking for a way to check which taskbar button is pressed(active) so that I can see which application is currently in use by the user. Checking for the active window is not possible in my situation as the main window of my application has child windows and when one of these are active the main window is deactivated.....

I could not find a usuable function in the documentation but I am sure there must be a way to read the taskbar buttons. Someone with a solution??

I've not tested this, but WinSearchChildren option may make it so that WinGetTitle("") returns active main or child window (whichever is active).
Link to comment
Share on other sites

I've solved the problem by using the GetAncestor() function from user32.dll. This way, if one of the child windows is active I could find the top-level window of the active application.

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