How to access thumbnail toolbar buttons?

Question:

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:

Screenshot of what I want to control.

Asked By: zohartdev

||

Answers:

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.

Answered By: Anders
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.