窗口“切换到”执行

发布于 2024-10-07 17:00:50 字数 89 浏览 0 评论 0原文

您好,我如何在我的应用程序中实现“切换到”功能,例如在 Windows 任务资源管理器中,任何人都可以给我有用的链接或响应如何做到这一点? 对所有人来说都有很多好处

Hi how can i implement "switch to" functional in my app like in windows task explorer, can any one give me useful link or response how to do it?
Tnaks a lot for all

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆蝶 2024-10-14 17:00:50

SetForegroundWindow 是更改的正常方法“当前任务”,对于“任务切换器”应用,SwitchToThisWindow 是一个更好的解决方案,因为它不需要您的应用程序处于“前台”(但是请不要滥用 SwitchToThisWindow 只是为了将您自己的应用程序带到前台)

如果这是一个类似 alt-tab 的应用程序,您可以使用 RegisterHotKey 进行注册对于特殊按键,以及 EnumWindows 枚举顶级窗口...

SetForegroundWindow is the normal way to change "current task", for "task switcher" apps, SwitchToThisWindow is a better solution since it does not require your app to be "foreground" (But please, don't abuse SwitchToThisWindow just to bring your own apps to the foreground)

If this is a alt-tab like application, you can use RegisterHotKey to register for a special key press, and EnumWindows to enumerate top-level windows...

远昼 2024-10-14 17:00:50

使用 User32.dll 中的 SwitchToThisWindow() Windows API 函数。使用 EnumWindows()FindWindow() 获取窗口句柄,然后将其传递给 SwitchToThisWindow() 以切换到应用程序。

Use the SwitchToThisWindow() Windows API function in User32.dll. Get a handle to the window using EnumWindows() or FindWindow(), then pass it to SwitchToThisWindow() to switch to the app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文