How to add button to other apps window title bar (

2020-08-01 06:22发布

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

1条回答
戒情不戒烟
2楼-- · 2020-08-01 06:46

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.

查看更多
登录 后发表回答