; Tooltip Trap ; 获取Tooltips的文本,需要Win7 ; TT出现时按ScrollLock获取,热键还可设置成NumberLock、Sc163、Insert,Pause等 ; 能够获取浏览器、office等软件里的TT,如果有获取不了的请反馈给nepter #SingleInstance,force CoordMode,mouse,screen if !uia:=ComObjCreate("{ff48dba4-60ef-4201-aa87-54103eef594e}","{30cbe57d-d9d0-452a-ab13-7ac5ac4825ee}"){ msgbox 需要Win7以上版本。 ExitApp } return ;SC163:: ScrollLock:: item:=TTrap() if !item.1 return gui,3:Destroy for k,v in item { gui,3:add,edit,x5 w480 -Tabstop vedit%k%,%v% GuiControlGet,pos,3:Pos,edit%k% if (posh>800) GuiControl,3:Move,edit%k%,h800 gui,3:add,button,X+5 yp-2 vbtn%k% gcp2cb,复制到剪贴板 } gui,3:show,,你获取了 return cp2cb: n:=SubStr(A_GuiControl,4) GuiControlGet,txt,,edit%n% if txt Clipboard:=txt gui,3:Destroy return 3GuiEscape: gui,3:Destroy return TTrap(){ global uia item:={} MouseGetPos,x,y,hwnd DllCall(vt(uia,5),"ptr",uia,"ptr*",root) DllCall(vt(uia,6),"ptr",uia,"ptr",hwnd,"ptr*",element) DllCall(vt(uia,23),"ptr",uia,"int",30003,"ptr",variant(ptr,3,50022),"ptr*",newCondition) DllCall(vt(element,6),"ptr",element,"int",4,"ptr",newCondition,"ptr*",found) DllCall(vt(found,3),"ptr",found,"int*",length) if !length { ObjRelease(found) DllCall(vt(root,6),"ptr",root,"int",2,"ptr",newCondition,"ptr*",found) DllCall(vt(found,3),"ptr",found,"int*",length) } loop % length { DllCall(vt(found,4),"ptr",found,"int",A_Index-1,"ptr*",newElement) DllCall(vt(newElement,23),"ptr",newElement,"ptr*",name) item.Insert(StrGet(name,"utf-16")) ObjRelease(newElement) } ObjRelease(found) ObjRelease(element) ObjRelease(root) return item } variant(ByRef var,type=0,val=0){ return (VarSetCapacity(var,8+2*A_PtrSize)+NumPut(type,var,0,"short")+NumPut(val,var,8,"ptr"))*0+&var } vt(p,n){ return NumGet(NumGet(p+0,"ptr")+n*A_PtrSize,"ptr") }