Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using media Keys with iTunes Minimized

Posted on 2006-11-29
3
Medium Priority
?
248 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 86

Accepted Solution

by:
Mike Tomlinson earned 750 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 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