Yeah, the title almost says all. I found many things googling, but none I could actually use, so I'm just searching for a simple method, if that is possible.
Thanks.
-
The gist of the problem is that you must PInvoke into native code in order to use these methods. PInvoke is a pretty big topic and I suggest reading up on it a bit.
Luckily though most things which can be PInvoke'd at this point have samples available on the web. For instance, take a look at the following article on CodeIdol. It gives a full winforms sample on how to use this key and many others in a c# application.
Samuel : Your link is about hooking into the input chain to be notified about input, he wants to send input. -
JardPar is correct, you will have to PInvoke to send the
VK_MEDIA_NEXT_TRACKkey. You can use theuser32.SendInputfunction to achieve this. Take a look at pinvoke.net: SendInput (user32). -
I've had better luck with keybd_event in the past. The method definition should look like this:
[DllImport("user32.dll")] public static extern void keybd_event(byte vkCode, byte scanCode, int flags, IntPtr extraInfo); -
Thank you for your answers! Maybe this evening im able to see which one works for me best.
0 comments:
Post a Comment