Solved

Using media Keys with iTunes Minimized

Posted on 2006-11-29
3
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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