I have the handler of an open window which wasn't necessarily open by my process. How can I add a button to that window and make the button call a certain application (.exe) when clicked? The button could be next to the system menu or the minimize button. This should work for both XP and Vista (a different approach for each version is OK).
How to add button to other apps window title bar (XP/Vista)
Asked Answered
The standard approach is to inject a DLL into the process with SetWindowsHookEx, hooking WH_CALLWNDPROC to monitor the WM_NCPAINT message. That used to work pretty well but no more. Visual Styles and Vista UAC will make you grow a pretty long beard. Common in the Windows 3.x days, I haven't seen this done in quite a while.
Unfortunately, this doesn't give me the answer I've expected, but it's the best I've found until now. I don't even know how to phrase my question in Google... Considering the fact that answers such as "you can't do it" are valid ones, I have no choice but to accept yours. Thanks! –
Antimatter
Could you please be a little more elaborate? I know SetWindowsHookEx is a Static API call but how do we use it? I'd also like to achieve such functionality, you know. –
Simp
© 2022 - 2024 — McMap. All rights reserved.