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.
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.
JardPar is correct, you will have to PInvoke to send the VK_MEDIA_NEXT_TRACK
key. You can use the user32.SendInput
function 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);