使窗口成为桌面的一部分 [英] Make a window a part of the desktop

查看:84
本文介绍了使窗口成为桌面的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个窗口,

CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_LAYERED, wc.lpszClassName, 0, WS_POPUP | WS_VISIBLE | WS_SYSMENU, ...);

桌面的一部分(我知道这可能是不可能的,但是我想尽可能地接近这种感觉。)

因此,当 WIN时我需要 + D 被击中(或单击屏幕右下角的 Show desktop 按钮)时,窗口

Thus, I need that when WIN+D is hit (or when bottom-right of the screen Show desktop button is clicked), the window should not be hidden.

在显示带有 WIN + D ?

How to prevent the window to be hidden when showing desktop with WIN+D?

注意:我最初认为可以通过防止窗口最小化
https://stackoverflow.com/questions/27781352/prevent-window-to-be-minimized?noredirect=1#comment43975051_27781352 )但作为一些用户指出,似乎
是另一个问题。

Note: I initially thought it was possible by preventing the window to be minimized (https://stackoverflow.com/questions/27781352/prevent-window-to-be-minimized?noredirect=1#comment43975051_27781352) but as pointed by some users, it seems that it is another problem.

推荐答案

米通过执行以下操作来获取桌面的窗口部分:

It is possible to make the window part of the desktop by doing:

HWND hwndOwner = GetWindow(GetWindow(GetTopWindow(0), GW_HWNDLAST), GW_CHILD);
SetWindowLong(hwndMain, GWL_HWNDPARENT, (LONG) hwndOwner);

也可以尝试其他测试: http://files.rsdn.ru/42164/quasi_owner.zip (exe +来源,已在Win7-x86上测试)。

Also try another test: http://files.rsdn.ru/42164/quasi_owner.zip (exe + sources, tested on Win7-x86).

第一个版本(实际上不起作用):

它是足够删除 WS_MINIMIZEBOX &添加 WS_EX_TOPMOST

It is enough remove WS_MINIMIZEBOX & add WS_EX_TOPMOST

这篇关于使窗口成为桌面的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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