by tan » 06 May 2024, 01:45
WKen wrote: ↑02 May 2024, 12:38
DllCall
Code: Select all
#Requires AutoHotkey >=2.0
#Warn
#SingleInstance
ID := WinGetID("A")
a::SendKey("b", ID) ; a::b
s::SendKey("d", ID) ; s::d
SendKey(Key, hWnd){
VK := GetKeyVK(Key),SC := GetKeySC(Key)
DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 0, "UPtr", 0)
Sleep 100
DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 2, "UPtr", 0)
}
F4::ExitApp
啊啊啊,太感谢了,非常有效!
[quote=WKen post_id=570302 time=1714671509 user_id=156309]
[url=https://www.autohotkey.com/boards/viewtopic.php?p=535956#p535956]DllCall[/url]
[code]#Requires AutoHotkey >=2.0
#Warn
#SingleInstance
ID := WinGetID("A")
a::SendKey("b", ID) ; a::b
s::SendKey("d", ID) ; s::d
SendKey(Key, hWnd){
VK := GetKeyVK(Key),SC := GetKeySC(Key)
DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 0, "UPtr", 0)
Sleep 100
DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 2, "UPtr", 0)
}
F4::ExitApp[/code]
[/quote]
啊啊啊,太感谢了,非常有效! :D