vb 從零開始(四)
添加快捷鍵
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要vbapi函數:
getasynckeystate←判斷函數調用時指定虛擬鍵的狀態
--------------------------------------------------------------------------------------------------------------------------------------------------------
相關api聲明:
getasynckeystate
privatedeclarefunctiongetasynckeystatelib"user32"(byvalvkeylong)integer
privatefunctionmyhotkey(vkeycode)boolean
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件:timer(interval不為空)
--------------------------------------------------------------------------------------------------------------------------------------------------------
代碼:
privatedeclarefunctiongetasynckeystatelib"user32"(byvalvkeylong)integer
privatefunctionmyhotkey(vkeycode)boolean
myhotkey=(getasynckeystate(vkeycode)