讓F8鍵失效 Visual Basic

2021-04-06 20:47:04 字數 1227 閱讀 6961

'以下在.bas

option explicit

declare function setwindowshookex lib "user32" alias _

"setwindowshookexa" (byval idhook as long, byval lpfn as long, _

byval hmod as long, byval dwthreadid as long) as long

declare function unhookwindowshookex lib "user32" _

(byval hhook as long) as long

declare function callnexthookex lib "user32" (byval hhook as long, _

byval ncode as long, byval wparam as long, lparam as any) as long

public hnexthookproc as long

public const hc_action = 0

public const wh_keyboard = 2

'如果您將以下的兩行unmark則所有鍵盤的輸入皆沒有作用

'mykbhfunc = 1  '吃掉訊息

'exit function

mykbhfunc = 0 '訊息要處理

if icode < 0 then

mykbhfunc = callnexthookex(hnexthookproc, icode, wparam, lparam)

exit function

end if

if wparam = vbkeyf8 then  '偵測 有沒有按到f8鍵

mykbhfunc = 1 '在這個hook便吃掉這個訊息

debug.print "haha"

else

call callnexthookex(hnexthookproc, icode, wparam, lparam)

end if

end function

'以下在form

private sub form_load()

call enablekbdhook

end sub

private sub form_unload(cancel as integer)

call unhookkbd

end sub

為何Eclipse的除錯快捷鍵F8失效?

為何eclipse的除錯快捷鍵f8失效?1.首先確認你的除錯快捷鍵f8沒有被你修改過 在eclipse介面下按ctrl shift l快捷鍵開啟eclipse所有快捷鍵選單 找到 resume 確定其快捷鍵是否仍為預設的f8,若不是的話,再修改回來即可,若仍為f8,那麼很可能是你電腦上安裝了其他的軟...