求一个把程序窗口保持置底的方法或者程序

代码如下,需自行修改第三十行的壁纸路径:

blackback:=0
Return

;Ctrl+d 将当前窗口设置为桌面的子窗口(置底)
^d::
WinSet:=AlwaysAtBottom(WinExist("A"))
return

;http://www.autohotkey.com/board/topic/80573-how-to-set-a-gui-to-be-always-at-bottom/
AlwaysAtBottom(Child_ID)
 {
  WinGet, Desktop_ID, ID, ahk_class  WorkerW
  Return DllCall("SetParent", "uint", Child_ID, "uint", Desktop_ID)
 }

;Ctrl+b 恢复原状
^b::
WinSet:=undoAlwaysAtBottom(WinExist("A"))
return

undoAlwaysAtBottom(Child_ID)
 {
  Return DllCall("User32\SetParent", "Ptr",Child_ID, "Ptr",0)
 }

$#d::
if ! blackback
 DllCall("SystemParametersInfo",UInt,0x14,UInt,0,Str,"",UInt,1)
else
 DllCall("SystemParametersInfo",UInt,0x14,UInt,0,Str,"C:\Users\Dugeng\Pictures\壁纸\优雅.jpg",UInt,1)

SendInput,#d
blackback:=! blackback
Return

GuiClose:
GuiEscape:
ExitApp
Return
1 个赞

少用win+D不就好了

runany中的插件功能之一,置底功能, win+d也不会隐藏,即使你把置底的窗口最小化,按win+d 也会直接显示出来。

也是用ahk实现的,会不会跟楼主你用的Fences 3这个软件有冲突就不知道了,没用过Fences 3。

楼主可以试试

用清单软件吧,开循环提醒,不完成不清除提示。

我去看了 RunAny 的源码,他是 SetParent 到 Progman 下面,我试了下,不行,窗口完全不见了,估计是 Fences 对桌面窗口做了啥

要是开了好多窗口,又想回到桌面,用这个快捷键或点任务栏最右的地方是最简单的事吧

@dog 的提醒下,我好好去网上找了找,嗯,终于找到了据说是 Wallpaper Engine 使用的技术原理,可以把窗口放到桌面背景和图标之间 :smile_cat: 然后代码是 C++ 的 :sob: 不过核心是调用 WinAPI,我还找到了 AHK 的代码 :v: 但如果要实现互动,还要写 Hook :joy: 算了,放弃互动,能把窗口置底已经很好了,置底之后不能互动、解除只能全部一次性解除也勉强能接受。

代码在下面,有兴趣的拿去,Ctrl+Alt+Down置底当前窗口,Ctrl+Alt+Up全部取消置底

DetectHiddenWindows, On

/*
	Source: https://www.codeproject.com/articles/856020/draw-behind-desktop-icons-in-windows
*/

; Obtain Program Manager Handle
; https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499(v=vs.85).aspx
Progman := DllCall("FindWindow", "Str", "Progman", "UPtr", 0, "Ptr")

; Send Message to Program Manager
DllCall("SendMessage", "Ptr", Progman, "UInt", 0x052C, "Ptr", 0, "Ptr", 0)

; Obtain Handle to Newly Created Window
WinGet List, List, ahk_class WorkerW
Found := FALSE
WorkerW := 0
Loop % List
{
	If (Found)
	{
		WorkerW := List%A_Index%
		Break
	}
	If (DllCall("FindWindowEx", "UInt", List%A_Index%, "UInt", 0, "Str", "SHELLDLL_DefView", "UPtr", 0, "Ptr"))
		Found := TRUE
}


^!Down::
	If (Found)
	{
		; Put a Windows Form behind desktop icons
		DllCall("SetParent", UInt, WinExist("A"), UInt, WorkerW)
	}
	Else
		MsgBox, Oops
return


^!Up::
	If (Found)
	{
		id := 0
		Loop
		{
			id := DllCall("FindWindowEx", "UInt", WorkerW, "UInt", 0, "UInt", 0, "UInt", 0, "Ptr")
			if (!id)
				Break
			DllCall("SetParent", UInt, id, UInt, 0)
		}
		; Refresh WorkerW
		WinHide, ahk_id %WorkerW%
		WinShow, ahk_id %WorkerW%
	}
return
1 个赞

文件不往桌面放,, 多用win+e, 根本没有回桌面的必要

其实,我这个需求就相当于“窗口版”的稍后阅读,暂存的对象是“窗口”而不是“文字”,至于把桌面作为收集容器,是因为桌面是我习惯性访问的一个地方。

呵,注意看了,这不是我的需求,是楼主的
WIN+E不是打开资源管理器的快捷键吗?
我的资源管理器钉在任务栏上了,所以点点就行,不用快捷键
另设有宏按键,按单个键就能打开资源管理器,
无耐习惯已入骨髓,还是习惯点击打开

OSX也是吧多桌面作为收纳容器的.
你要改下思路. 用系统原生的方案最稳定.