贴于桌面的Gui示例

; 第七、第八、第九、第二十八行
; 可以让gui贴于桌面,且不被win d带走
; 测试条件有限,是否通用、稳定待确认,仅供参考


#NoTrayIcon
P8:=(A_PtrSize=8 ? "Ptr" : "")
If !hSDV:=DllCall("GetWindow", "Ptr",WinExist("ahk_class Progman"), "UInt",5, "Ptr")  ; GW_CHILD=5
hSDV:=DllCall("GetWindow", "Ptr",WinExist("ahk_class WorkerW"), "UInt",5, "Ptr")  ; GW_CHILD=5

WZX := "x1400"
WZY := "y800"
beijingse = c1c1c1        ; 背景色
zhutiyanse = 07afe2
年月日 = 5fe207
Gui, XSSJ:Destroy
Gui, XSSJ:+LastFound +HwndShijianHwnd ; +AlwaysOnTop 
Gui, XSSJ:Color, %beijingse%  
Gui, XSSJ:font, s51 c%zhutiyanse% Bold q3, Microsoft YaHei UI
Gui, XSSJ:Add, Text, vuijm, %A_Hour%∶%A_Min%∶%A_Sec%
Gui, XSSJ:Add, Progress, c%zhutiyanse% Background%zhutiyanse%  xm y+0 w373 h4 vMyProgress, 100
Gui, XSSJ:font, s25 c%zhutiyanse% q3 w550, Microsoft YaHei UI
Gui, XSSJ:Add, Text, xm y+6 vnm, %A_YYYY%年
Gui, XSSJ:Add, Text, x+3 vyrri, %A_MM%月%A_dd%日\
Gui, XSSJ:Add, Text, x+3 vxkqi, %A_dddd%
WinSet, TransColor, %zhutiyanse% 200
Gui, XSSJ:-Caption
DllCall("SetWindowLong" . P8, "Ptr", ShijianHwnd, "Int",-8, "Ptr",hSDV)
WinSet, Disable
SetTimer,gengxin,1000  
Gosub gengxin
Gosub XSSJ_A
Send, #d
Sleep, 200
Send, #d
Return


XSSJ_A:
Gui, XSSJ:Show, %WZX% %WZY% NA
Return

gengxin: 
yrri=%A_MM%月%A_DD%日\
nm=%A_YYYY%
xkqi=%A_dddd%
uijm=%A_Hour%∶%A_Min%∶%A_Sec%
FormatTime, topj, %A_Now%, hh:mm:ss
GuiControl, XSSJ:Text, yrri, %yrri%
GuiControl, XSSJ:Text, nm, %nm%年
GuiControl, XSSJ:Text, xkqi, %xkqi%
GuiControl, XSSJ:Text, uijm, %uijm%
; Btt(topj, 1865, 0, 20, "Mst")
return


^!#F11::
WZX_2 := "1400"
WZY_2 := "800"
WZX_1 := "1400"
WZY_1 := "800"
Gui, WEIZ:Destroy
Gui, WEIZ:+LastFound +Owner
Gui, WEIZ:font, s18, Microsoft YaHei UI
Gui, WEIZ:Add, Text, y11, X:
Gui, WEIZ:Add, Edit, x+10 y8 w80 vWZX_1 gWZX_A ;, 1400
Gui, WEIZ:Add, UpDown, vWZX_2 Range0-1920 0x80, 1400
Gui, WEIZ:Add, Text, x+10 y11, Y:
Gui, WEIZ:Add, Edit, x+10 y8 w80 vWZY_1 gWZY_A ;, 800
Gui, WEIZ:Add, UpDown, vWZY_2 Range0-1080 0x80, 800
Gui, WEIZ:Show
return

WZX_A:
WZY_A:
WZX_B:
WZY_B:
Gui, WEIZ:Submit, NoHide
WZX := "x" . WZX_1
WZY := "y" . WZY_1
Gosub XSSJ_A
Return


; Gui, WEIZ:Submit, NoHide
; WZX := "x" . WZX_2
; WZY := "y" . WZY_2
; Gosub XSSJ_A
; Return





^!#F10::
msgbox,4100,退出成功,你已退出时间!
exitapp
return

; XButton1::
^!#F12::
Reload         ;重启
return



F6::
WinGetPos, xxx, yyy, www, hhh, ahk_id %ShijianHwnd%
MsgBox % xxx . "==" . yyy
return

F7::
WinShow, ahk_id %ShijianHwnd%
return



给TA捐赠
共{{data.count}}人
人已捐赠
其他

调用系统播报语音

2021-12-2 16:12:00

其他

通过颜色找位置

2021-12-2 16:12:12

2 条回复 A文章作者 M管理员
  1. sunwind

    效果很棒!

  2. user15036

    学习一下,我是新人

个人中心
今日签到
有新私信 私信列表
搜索