How to add button to other apps window title bar (XP/Vista)
Asked Answered
A

1

1

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

Antimatter answered 7/11, 2008 at 15:29 Comment(0)
F
1

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.

Fides answered 7/11, 2008 at 18:32 Comment(2)
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.