题外话:发现有人喜欢抄文章。但凡你懂,估计你也不会来抄吧?这就是差别。爱抄的很难懂,懂的不屑于抄。
此类依赖 extooltip.ahk extype.ahk clickable.ahk
声明:
- 所贴出的代码纯属个人原创
- 所有代码经过测试才贴,但不保证所有功能最终完成,可能后续会有更新,欢迎随时回顾
- 所有非原创的代码,会声明,尽量给出引用出处
主要接口
- SelWin(n)
- PrepareWin(sec, bg, params*)
- Init()
- OnStart()
- OnPause()
- OnResume()
- OnStop()
// in your main page
#include <nolshot.ahk>
Init()
{
PrepareWin([YourProcessId])
// do something
}
// OnStart()
// OnPause()
// OnStop()
// OnResume()
nolshot.ahk
#include <nol.ahk>
^q::
ExitApp
return
^1::
tryinit()
global g_timer
global g_window
try{
OnStart()
g_timer.DoStart()
}catch{}
return
^2::
global g_timer
global g_window
try{
F:= Func("OnPause")
if F
{
F.Call()
}
}catch{}
return
^3::
global g_timer
global g_window
try{
F:= Func("OnResume")
if F
{
F.Call()
}
}catch{}
return
^4::
try{
F:= Func("OnStop")
if F
{
F.Call()
}
}catch{}
return
tryinit()
{
static inited := false
if inited
return
inited := true
try
{
Init()
}catch{}
}
nol.ahk
#include clickable.ahk
#include extooltip.ahk
#include extype.ahk
global g_timer := new MyTimer()
global g_windowlist := []
global g_window :=
SelWin(n)
{
global g_windowlist
global g_window
g_window := g_windowlist[n]
g_window.Act()
g_window.DoMove(0,0)
g_window.SetSize( 1296,759)
return g_window
}
PrepareWin(sec, bg, params*)
{
global g_windowlist
for index ,param in params
{
winname := "ahk_pid " param
win := new Clickable(winname, sec,bg)
g_windowlist.Push(win)
}
}