如何将按钮添加到其他应用程序窗口标题栏 (XP/Vista) [英] How to add button to other apps window title bar (XP/Vista)

查看:56
本文介绍了如何将按钮添加到其他应用程序窗口标题栏 (XP/Vista)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个打开的窗口的处理程序,它不一定由我的进程打开.如何在该窗口中添加一个按钮并使该按钮在单击时调用某个应用程序 (.exe)?该按钮可能位于系统菜单或最小化按钮旁边.这应该适用于 XP 和 Vista(每个版本采用不同的方法也可以).

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

推荐答案

标准的做法是使用 SetWindowsHookEx 将 DLL 注入进程,挂钩 WH_CALLWNDPROC 以监视 WM_NCPAINT 消息.这曾经工作得很好,但现在不行了.Visual Styles 和 Vista UAC 会让你长出很长的胡子.在 Windows 3.x 时代很常见,我已经有一段时间没有看到这样做了.

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.

这篇关于如何将按钮添加到其他应用程序窗口标题栏 (XP/Vista)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆