I think I have a basic idea of how to do this, maybe, but not a foolproof one - which is kinda what I need.
I have a program, and in that program is a button. Identifying the button's class or even hwnd if needed is easy. What I want to do is trigger a certain action any time that button is pressed - no matter HOW it is pressed. Left click, Alt + underlined letter, tab to it and press Enter, or even triggered with ControlClick, ideally. Any time that button gets pushed, I want my script to trigger.
The only way I can think to do this is to hotkey LButton and check every mouse click to see if the button was clicked on, then do the same thing with Alt+M and Enter. I'm not sure how reliable that would be, or how likely it would be to mess other things up. Is there a cleaner solution?
Trigger An Action When a Non-AHK Button Is Interacted With
Re: Trigger An Action When a Non-AHK Button Is Interacted With
You could check if the button is changing its appearance (looking flat if pushed). Probably OnMessage would be of help?
Re: Trigger An Action When a Non-AHK Button Is Interacted With
OnMessage looked promising, but it only monitors messages received by the script; I can't intercept messages to other programs. Sadly the button doesn't change appearance if it is activated with alt + underlined letter...