创建一个通知窗口
在所有窗口创建销毁时接收消息
winUtilShellhookObject.onShellHook=function(hShell,hwnd){
var tid,pid = win.getThreadProcessId(hwnd)
if(tid!= thread.getId()){
return; /*如果不想临视本线程在这里退出*/
}
select(hShell) {
case 1/*_HSHELL_WINDOWCREATED*/ {
..io.print("一个窗口创建",hwnd,"进程ID:" + pid + "线程ID:" +tid)
}
case 2/*_HSHELL_WINDOWDESTROYED*/{
..io.print("一个窗口销毁",hwnd,"进程ID:" + pid + "线程ID:" +tid)
}
}
}