PB窗口同时注册多个全局热键
PB窗口同时注册多个全局热键 //声明APIFUNCTION Integer GlobalAddAtom(ref string lpString) LIBRARY "" ALIAS FOR "GlobalAddAtomA" Function ULong RegisterHotKey(ULong hwnd,ULong id,ULong fsModifiers,ULong vk) Library ""Function ULong UnregisterHotKey( ULong hwnd, ULong id ) Library ""
//定义实例变量Long AtomID[12] //热键ID
//Open Event//注册热键F1~F12Integer li_retString ls_dt, ls_errFor i = 1 To 12Sleep()ls_dt = "AtomId" + String(i) + String(Today(),"yyyy-mm-dd hh:mm:ss:fff")AtomId[i] = GlobalAddAtom(ls_dt)li_ret = RegisterHotKey(Handle(This), AtomId[i], 0 , 111 + i)If li_ret = 0 Then ls_err += " F" + String(i)NextIf ls_err <> '' Then MessageBox( "警告", "功能键"+ls_err+" 注册失败!" )
//Close Event//注销热键Intege
PB窗口同时注册多个全局热键 来自淘豆网www.taodocs.com转载请标明出处.