Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 don't kno how to do it and I'm out of ideas too.

 

So here are my attempts:

 

    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)

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)

 

I'm 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 doesn't work at all,

Postmessage send the keys not as a combination and forwards the video frame by frame.

Sendmessage does't do the job at all, since it just cycles the buttons on the control panel.

Posted

mhh sorry for posting in the wrong category :rolleyes:

 

I found a solution which is much better.

Instead of sending the combination I found the message that is send when

the combination is pressed and now I can directly send the forward/backward command.

 

I just discovered another usefull side of Spy++ instead of just finding the windows handles :D,

I didn't know it could also show the messages for a specific handle,

thanks for the great insight! (Which I got while searching the forum :) )

 

[EDIT]

Thanks PlausiblyDamp

I will also have a look at the link.

( I was writing this post while you already posted the link :) )

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...