mardi 3 février 2015

WshShell keystroke multimedia Next Track windows

I have a wscript that sends a keystroke to the active window.


I have the codes for keystroke for the following media keys:


Vol + (code: &hAF)


Vol - (code: &hAE)


Prev Track (code: &hB1)


Next Track (code: &hB0) (not working)


Play/Pause (code: &hB3)


But i can't make it work the simulation of Next Track key, I think that it is related with the 0 in the hex code


This is the code to send keystroke keys:



'this script is working on W7 and W8
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(&hB0)) 'change the chr argument by any hex to send keystrokes to the active window
Set WshShell = Nothing


I used as base this link to get the codes: http://ift.tt/1xc4Lnn


The problem is that instead of send the keystroke "Media Next", this send a keystroke "°" to the active window


This hex (&hB0) translated to decimal is 176 and 176 is mapped to °


The help is very appreciated.


Thanks in advance


Aucun commentaire:

Enregistrer un commentaire