Home > Software design >  How to access thumbnail toolbar buttons?
How to access thumbnail toolbar buttons?

Time:05-03

I'm trying to make some controls with apps (for example Discord or any app that has thumbnail toolbar buttons). I've already tried to google, search or just look at the docs. Is there any possible way to do that in python? (Screenshot of what I want to control.)

CodePudding user response:

I don't think there is a way to access the toolbar and certainly not from another process.

You can however use something like Spy to find the button id in WM_COMMAND and then send a message yourself to perform a toolbar button click. This is of course application specific and the id could change if the application is updated.

When a thumbnail button is clicked, the application receives a WM_COMMAND message with the high word of the wParam set to THBN_CLICKED and the low word set to the button ID. This message is dispatched to the window to which the thumbnail belongs.

  • Related