强制窗口将高于已上大多数窗口(如任务管理器) [英] Force window to be above already top-most windows (like the Task Manager)

查看:391
本文介绍了强制窗口将高于已上大多数窗口(如任务管理器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我想显示高于一切的窗口。我的code是能够成功地迫使它高于几乎所有的窗口,除了其他最顶层的窗口。这里是code我使用:

I have a window which i would like to display above everything else. My code is able to successfully force it to be above almost every window, except for other top-most windows. Here is the code I use:

SetWindowPos(getSDLWindow(),HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);

这行执行我点击鼠标中键每次(我使用的是鼠标钩子火吧)。

This line is executed every time I click the middle mouse button (I am using a mouse hook to fire it).

在我开始了我的计划,并单击鼠标一次,从这一点上来说,我的窗口仍然高于一切常规窗口。

Once I start up my program, and middle-click once, from that point on, my window remains above all "regular" windows.

然而,所有的特殊窗口似乎集中我的应用程序窗口上方显示时,在同一类别作为我的应用程序窗口,即特殊窗口。在这一类特殊的窗口都在任务栏(其中使用开始菜单也似乎激活),右键菜单(即使是由常规的Windows生成),在任务管理器,我相信很多人。事实上,我相当肯定这是其他任何窗口中的最上面的行为这种方式。看来,通过我的 SetWindowPos 拨打我举起了我的应用程序窗口的状态到最顶层的窗口。

However, all "special windows" seem to be in the same category as my application window, i.e. special windows when focused are displayed above my application window. In this category of special windows are the taskbar (which using the start menu also seems to activate), right-click menus (even when spawned by regular windows), the Task Manager, and I am sure many others. In fact I am fairly sure any other window which is "topmost" will behave this way. It seems that through my SetWindowPos call I have elevated the status of my application window to a topmost window.

什么是整齐的是,我可以启动任务管理器,将其移到我的应用程序窗口(所以它现在覆盖它),然后在任务管理器内单击鼠标中键,现在我的应用程序窗口弹出备份在前面(而重点仍然在任务管理器)。这是不错,但我希望把它一步,使我的窗口将在顶部的不管是什么

What's neat is that I can start the Task Manager, move it over my app window (so that it is now covering it) and then middle-click inside the Task Manager, and now my app window pops back up in front (while focus remains on the Task Manager). This is nice but I'd like to take it one step further so that my window will be on top no matter what.

有没有什么方法来完成比反复烧制 SetWindowPos 在一个循环这等?我想避免,如果在所有可能的。

Are there any methods to accomplish this other than repeatedly firing SetWindowPos in a loop? I'd like to avoid that if at all possible.

推荐答案

没有,因为的有没有超级最上面的标志

也不要你,因为所有超最上面的窗口将兵戎相见其他控制

这篇关于强制窗口将高于已上大多数窗口(如任务管理器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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