Arokh
Well-known member
- Joined
- Apr 11, 2006
- Messages
- 124
After much trail and error I was finally be able to send some keys to a different application with the Postmessage API.
But now I want to send key combinations but I dont kno how to do it and Im out of ideas too.
So here are my attempts:
Im trying to simulate a short cut in a Video Player which lets the video jump forward while pressed (CTRL+Right Arrow),
while pressing only the Arrow would only forward the video by one frame.
Using TranslateMessage doesnt work at all,
Postmessage send the keys not as a combination and forwards the video frame by frame.
Sendmessage doest do the job at all, since it just cycles the buttons on the control panel.
But now I want to send key combinations but I dont kno how to do it and Im out of ideas too.
So here are my attempts:
Code:
Structure Button
Dim Part() As String
Dim Desc As String
Dim Pushed As Int16
End Structure
...
Dim mymsg As New MSG
...
mymsg.hwnd = MPChWnd
mymsg.message = WM_KEYDOWN
mymsg.lParam = 0 Tried 15 as well
mymsg.wParam = Keys.Control
TranslateMessage(mymsg)
mymsg.wParam = Keys.Right
TranslateMessage(mymsg)
mymsg.message = WM_KEYUP
mymsg.wParam = Keys.Right
TranslateMessage(mymsg)
mymsg.wParam = Keys.Control
TranslateMessage(mymsg)
Code:
PostMessage(MPChWnd, WM_KEYDOWN, Keys.Control, 0)
PostMessage(MPChWnd, WM_KEYDOWN, Keys.Right, 0)
PostMessage(MPChWnd, WM_KEYUP, Keys.Right, 0)
PostMessage(MPChWnd, WM_KEYUP, Keys.Control, 0)
Im trying to simulate a short cut in a Video Player which lets the video jump forward while pressed (CTRL+Right Arrow),
while pressing only the Arrow would only forward the video by one frame.
Using TranslateMessage doesnt work at all,
Postmessage send the keys not as a combination and forwards the video frame by frame.
Sendmessage doest do the job at all, since it just cycles the buttons on the control panel.