Jump to content
Sign in to follow this  
Cavok

Reading taskbar buttons

Recommended Posts

Cavok

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

Share this post


Link to post
Share on other sites
MisterBates

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

Share this post


Link to post
Share on other sites
Cavok

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.

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  

×