Solved

Using media Keys with iTunes Minimized

Posted on 2006-11-29
3
236 Views
Last Modified: 2007-12-19
Hi guys, i have a problem. Ive written some code that works and chages iTunes's tracks, starts, stops, etc. But the form has to be in focus the whole time. I want it so that i can be for example typing in Word, then press the next key and it changes track. Here's my code:


Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Process.Start("C:\Program Files\iTunes\iTunes.exe")
    End Sub
    Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
        Select Case keyData
            Case Keys.MediaPlayPause
                Process.Start("C:\Program Files\iTunes\Scripts\PlayPause.vbs")
            Case Keys.MediaStop
                Process.Start("C:\Program Files\iTunes\Scripts\Stop.vbs")
            Case Keys.MediaNextTrack
                Process.Start("C:\Program Files\iTunes\Scripts\Next.vbs")
            Case Keys.MediaPreviousTrack
                Process.Start("C:\Program Files\iTunes\Scripts\Previous.vbs")
            Case Keys.MediaStop
                Process.Start("C:\Program Files\iTunes\Scripts\Stop.vbs")
            Case Keys.VolumeUp
                Process.Start("C:\Program Files\iTunes\Scripts\VolumeUp.vbs")
            Case Keys.VolumeDown
                Process.Start("C:\Program Files\iTunes\Scripts\VolumeDown.vbs")
            Case Keys.VolumeMute
                Process.Start("C:\Program Files\iTunes\Scripts\VolumeMute.vbs")


        End Select

        Return MyBase.ProcessCmdKey(msg, keyData)
    End Function



End Class


I ideally want the form to be invisible but still accept the commands from the keys that i use.
Thanks very much!
0
Comment
Question by:dajoebomb
  • 2
3 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 18038570
0
 

Author Comment

by:dajoebomb
ID: 18039313
Great i managed that, but now how do i make the program invisible, e.g. not on the toolbar, or even better make it so that it goes into an icon on the system tray. thanks, got it to work by the way!
0
 

Author Comment

by:dajoebomb
ID: 18039443
Ahh i stopped being lazy and just found out how to do it, thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now