之前做过好几个快速获取代码的工具
大多设计上存在一些花里胡哨的想法,现在返璞归真做了个只快速显示和复制的小工具,仅仅70行代码就可以快速获取信息
相对于ahkinfo等工具的优势在于简练,东西少,一眼能看到想要的东西
演示视频
#NoTrayIcon ;不显示托盘图标
#Persistent ;~让脚本持久运行
#SingleInstance,Force ;~运行替换旧实例
#i::GetCode()
GetCode(){
Gui dev:Destroy
Gui dev:Font,s14
Gui dev:Add, Text, w-2 h-2 section,
CoordMode,Mouse, Window
MouseGetPos, xw, yw
WinGetTitle, Title, A
WinGet, path, ProcessPath, A
WinGet,ProcessName,ProcessName ,A
WinGetClass, class, A
CoordMode,Mouse, Screen
MouseGetPos, xs, ys
Gui, Add, ListView, r20 w700 gMyListView, name|content
hclick=
(
hclick(%xs%, %ys%, 1, 0, "Screen", true)
)
click=
(
Click,%xw%,%yw%
)
wait=
(
winwait, %Title% ahk_exe %ProcessName% ahk_class %class%
)
cclick=
(
ControlClick,x%xw% y%yw%,%Title% ahk_exe %ProcessName%
)
csend=
(
ControlSend,, ^{enter},%Title% ahk_exe %ProcessName%
)
win=
(
WinActivate,%Title% ahk_exe %ProcessName%
)
ifw=
(
#IfWinActive, ahk_exe %ProcessName%
)
LV_Add("","wintitle",Title)
LV_Add("","class","ahk_class " class)
LV_Add("","process-name","ahk_exe " processname)
LV_Add("","process-path","ahk_exe " path)
LV_Add("","mouse-window",xw " " yw)
LV_Add("","mouse-screen",xs " " ys)
LV_Add("","gui","gui,show,x" xs " y" ys)
LV_Add("","hclick",hclick)
LV_Add("","click",click)
LV_Add("","wait",wait)
LV_Add("","cclick",cclick)
LV_Add("","csend",csend)
LV_Add("","win",win)
LV_Add("","ifw",ifw)
LV_ModifyCol()
LV_ModifyCol(2, "Integer")
Gui, Show
return
GuiClose:
ExitApp
MyListView:
if (A_GuiEvent = "DoubleClick")
{
LV_GetText(text, A_EventInfo,2)
clipboard:="" , Clipboard:=text
ToolTip,Clipboard=%text%
}
return
大哥,你是少打了一个括号么
大道至简
少了个右大括号 双击复制当前行 非常好用,好评,点赞
ControlSend,, ^{enter},%Title% ahk_exe %ProcessName%,老师这个是后台发送回车吗?%Title% 是标题,%ProcessName%是进程名吗?希望可以回复一下我,我这个界面应该怎么脚本应该怎么写啊