Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › VBS, BAT or Anything that will work.
New Posts  All Forums:Forum Nav:

VBS, BAT or Anything that will work.

post #1 of 3
Thread Starter 
So i have these buttons in my task bar.



Now the start button at the top is a shortcut in explorer that runs an Autohotkey script script that contains this:
Code:
send ^{Esc}

Now when i try the same thing with media functions. They just plain don't work.
I have also tried this.
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "{MEDIA_PLAY_PAUSE}"
This doesn't work when launched either. However if i substitute the keys for the start menu this works.

Is there anyway i can have files in explorer that emulate media keys at all?
Earl
(28 items)
 
  
CPUMotherboardGraphicsGraphics
1055T Asus crosshair IV Asus 6870 Sapphire 6870 
RAMHard DriveHard DriveHard Drive
Corsair Dominator GT 8GB (1 spare 2GB stick) Corsair Neutron 120GB Samsung Spinpoint F3 Samsung Spinpoint F4 
Optical DriveCoolingCoolingCooling
Samsung USB slimline EK supreme HF XSPC RS 360 XSPC X20 750 Dual Bay Res 
CoolingCoolingOSOS
6x GT AP-15's bits and bobs Windows 8 Pro x64 Ubuntu 11.10 X64 (MSGE) 
MonitorMonitorMonitorMonitor
Hanns G 24" 1920x1080 Dell 17" 1280x1024 32" Sony Bravia Asus P1 Pico projector 
KeyboardPowerCaseMouse
Filco Majestouch Ninja Mx Browns ISO UK, Ducky ... OCZ fatality 1000 Coolermaster HAF X Microsoft sidewinder X8 
Mouse PadAudioAudioOther
Enjoi custom Sennheiser HD 205's Asus Xonar DX PCI-E Xbox 360 Game pad for windows 
  hide details  
Reply
Earl
(28 items)
 
  
CPUMotherboardGraphicsGraphics
1055T Asus crosshair IV Asus 6870 Sapphire 6870 
RAMHard DriveHard DriveHard Drive
Corsair Dominator GT 8GB (1 spare 2GB stick) Corsair Neutron 120GB Samsung Spinpoint F3 Samsung Spinpoint F4 
Optical DriveCoolingCoolingCooling
Samsung USB slimline EK supreme HF XSPC RS 360 XSPC X20 750 Dual Bay Res 
CoolingCoolingOSOS
6x GT AP-15's bits and bobs Windows 8 Pro x64 Ubuntu 11.10 X64 (MSGE) 
MonitorMonitorMonitorMonitor
Hanns G 24" 1920x1080 Dell 17" 1280x1024 32" Sony Bravia Asus P1 Pico projector 
KeyboardPowerCaseMouse
Filco Majestouch Ninja Mx Browns ISO UK, Ducky ... OCZ fatality 1000 Coolermaster HAF X Microsoft sidewinder X8 
Mouse PadAudioAudioOther
Enjoi custom Sennheiser HD 205's Asus Xonar DX PCI-E Xbox 360 Game pad for windows 
  hide details  
Reply
post #2 of 3
Quote:
Originally Posted by jammo2k5 View Post

So i have these buttons in my task bar.



Now the start button at the top is a shortcut in explorer that runs an Autohotkey script script that contains this:
Code:
send ^{Esc}

Now when i try the same thing with media functions. They just plain don't work.
I have also tried this.
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "{MEDIA_PLAY_PAUSE}"
This doesn't work when launched either. However if i substitute the keys for the start menu this works.

Is there anyway i can have files in explorer that emulate media keys at all?

where did you get the {MEDIA_PLAY_PAUSE} from as I didn't think sendkeys supported such values?
Also, what media player are you using? Not all of them play nice with media keys. Plus many have taskbar controls built in anyway (VLC, Winamp and WMP all do). You'll have to dig through the options to find out how to enable them though
Edited by Plan9 - 8/15/13 at 4:27am
post #3 of 3
Thread Starter 
Quote:
Originally Posted by Plan9 View Post

Quote:
Originally Posted by jammo2k5 View Post

So i have these buttons in my task bar.



Now the start button at the top is a shortcut in explorer that runs an Autohotkey script script that contains this:
Code:
send ^{Esc}

Now when i try the same thing with media functions. They just plain don't work.
I have also tried this.
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "{MEDIA_PLAY_PAUSE}"
This doesn't work when launched either. However if i substitute the keys for the start menu this works.

Is there anyway i can have files in explorer that emulate media keys at all?

where did you get the {MEDIA_PLAY_PAUSE} from as I didn't think sendkeys supported such values?
Also, what media player are you using? Not all of them play nice with media keys. Plus many have taskbar controls built in anyway (VLC, Winamp and WMP all do). You'll have to dig through the options to find out how to enable them though

I use a combination of Spotify and Foobar2K, they both work with the media functions of my Ducky Shine so i know they accept media key inputs perfectly. I also want these buttons to work as i don't want to change them every time i want to use the other player. I could also use compiled auto hotkey scripts to do this but then i just put in send *media function* just as i did with the send control esc it will not run right.
Earl
(28 items)
 
  
CPUMotherboardGraphicsGraphics
1055T Asus crosshair IV Asus 6870 Sapphire 6870 
RAMHard DriveHard DriveHard Drive
Corsair Dominator GT 8GB (1 spare 2GB stick) Corsair Neutron 120GB Samsung Spinpoint F3 Samsung Spinpoint F4 
Optical DriveCoolingCoolingCooling
Samsung USB slimline EK supreme HF XSPC RS 360 XSPC X20 750 Dual Bay Res 
CoolingCoolingOSOS
6x GT AP-15's bits and bobs Windows 8 Pro x64 Ubuntu 11.10 X64 (MSGE) 
MonitorMonitorMonitorMonitor
Hanns G 24" 1920x1080 Dell 17" 1280x1024 32" Sony Bravia Asus P1 Pico projector 
KeyboardPowerCaseMouse
Filco Majestouch Ninja Mx Browns ISO UK, Ducky ... OCZ fatality 1000 Coolermaster HAF X Microsoft sidewinder X8 
Mouse PadAudioAudioOther
Enjoi custom Sennheiser HD 205's Asus Xonar DX PCI-E Xbox 360 Game pad for windows 
  hide details  
Reply
Earl
(28 items)
 
  
CPUMotherboardGraphicsGraphics
1055T Asus crosshair IV Asus 6870 Sapphire 6870 
RAMHard DriveHard DriveHard Drive
Corsair Dominator GT 8GB (1 spare 2GB stick) Corsair Neutron 120GB Samsung Spinpoint F3 Samsung Spinpoint F4 
Optical DriveCoolingCoolingCooling
Samsung USB slimline EK supreme HF XSPC RS 360 XSPC X20 750 Dual Bay Res 
CoolingCoolingOSOS
6x GT AP-15's bits and bobs Windows 8 Pro x64 Ubuntu 11.10 X64 (MSGE) 
MonitorMonitorMonitorMonitor
Hanns G 24" 1920x1080 Dell 17" 1280x1024 32" Sony Bravia Asus P1 Pico projector 
KeyboardPowerCaseMouse
Filco Majestouch Ninja Mx Browns ISO UK, Ducky ... OCZ fatality 1000 Coolermaster HAF X Microsoft sidewinder X8 
Mouse PadAudioAudioOther
Enjoi custom Sennheiser HD 205's Asus Xonar DX PCI-E Xbox 360 Game pad for windows 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › VBS, BAT or Anything that will work.