Solved

Using media Keys with iTunes Minimized

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.net/WinForms: adjust Screen Resolution 6 59
VB.NET - Error - Object not set in Module 4 35
Store results in vb.net 3 23
vb.net class 3 17
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 …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

825 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