欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 名人名企 > [AHK V2]鼠标悬停展开窗口,鼠标离开折叠窗口

[AHK V2]鼠标悬停展开窗口,鼠标离开折叠窗口

2024/10/24 7:34:04 来源:https://blog.csdn.net/liuyukuan/article/details/140079130  浏览:    关键词:[AHK V2]鼠标悬停展开窗口,鼠标离开折叠窗口

演示鼠标悬停窗口标题栏则展开窗口,鼠标离开窗口标题栏则折叠窗口。

;作者:sunwind
;日期:2024年6月30日11:36:08
;脚本:演示鼠标悬停窗口标题栏则展开窗口,鼠标离开窗口标题栏则折叠窗口。
MyGui := Gui()
mytext:=MyGui.Add("Text",, "Please enter your name:")
MyGui.AddEdit("vName")
MyGui.always:=0
MyGui.mode:="折叠"
MyGui.Title:="悬停展开,离开折叠"
MyGui.OnEvent("Close", myGui_Close)
myGui_Close(thisGui) {  ; 声明中 this 参数是可选的.if MsgBox("Are you sure you want to close the GUI?",, "y/n") = "No"return true  ; true = 1else{MyGui.Destroy ExitApp}
}
MyGui.Show("w300 h1")
OnMessage( WM_MOUSEMOVE := 0xA0, onNcMouseMove  )
OnMessage( WM_NCMOUSELEAVE := 0x2A2,  onNcMouseLeave)onNcMouseMove(wParam, lParam, msg, hwnd) {if  (MyGui.mode="折叠"){OutputDebug "折叠->展开"WinMove , ,300,200, MyGui.TitleMyGui.mode:="展开"}}onNcMouseLeave(wParam, lParam, msg, hwnd) {if  (MyGui.mode="展开" and MyGui.always!=1){OutputDebug "展开->折叠"try{WinMove , ,300,28, MyGui.Title MyGui.mode:="折叠"}  }
}
#HotIf overTitleBar()
RButton::
{; OutputDebug overTitleBar()MyGui.always:= !MyGui.alwaysif(MyGui.always){try{WinMove , ,300,200, MyGui.TitleToolTip "持续展开"}}Else{ToolTip "鼠标悬停展开"}SetTimer(ToolTip,-1000)
} 
#HotIfoverTitleBar() { ; https://www.autohotkey.com/boards/viewtopic.php?t=31119CoordMode("Mouse")MouseGetPos(&x, &y, &hWnd)ErrorLevel := SendMessage(WM_NCHITTEST := 0x84, 0, x | y << 16, , "ahk_id " hWnd)Return (ErrorLevel = HTCAPTION := 2) and (hWnd=MyGui.Hwnd)}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com