Solved

Using media Keys with iTunes Minimized

Posted on 2006-11-29
3
242 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

636 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