Results 1 to 2 of 2

Thread: Spotify - media within systemtray

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    91

    Spotify - media within systemtray

    Hey guys, I've been wondering about spotify and people without media control on their keyboard, so this nights project was about spotify and your own program (both is in system tray) and still be able to turn the volume up/down/skip song/prev song.

    This works fine, except I would like to use this while I'm playing games in fullscreen, and so I tried this program while running a fullscreen game and ofcourse the program minimizes because it lay focus (I guess?) on spotify.

    If anyone of you have tried this, you might be able to help me with this one.
    http://spotifyomatic.codeplex.com/
    That's the link to the API.

    I might be unclear what I wanted to do with this, quick re-cap.
    -My program is running in system tray.
    -I use 2/4/5/6/8 buttons on the numpad to control spotify, with my program.
    -My code minimize fullscreen applications.


    Code:
    Public Class Form1
        Dim Spotify As New spotify()
        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
        Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            Me.WindowState = FormWindowState.Minimized
            Me.Visible = False
            e.Cancel = True
            nfi.Visible = True
        End Sub
        Private Sub nfi_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles nfi.MouseClick
            If Me.WindowState = FormWindowState.Minimized Then
                Me.Show()
                Me.WindowState = FormWindowState.Normal
            ElseIf Me.WindowState = FormWindowState.Normal Then
                Me.Hide()
                Me.WindowState = FormWindowState.Minimized
            End If
        End Sub
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            If (GetAsyncKeyState(101)) Then
                Spotify.PlayPause()
            End If
            If (GetAsyncKeyState(102)) Then
                Spotify.PlayNext()
            End If
            If (GetAsyncKeyState(100)) Then
                Spotify.PlayPrev()
            End If
            If (GetAsyncKeyState(98)) Then
                Spotify.VolumeDown()
            End If
            If (GetAsyncKeyState(104)) Then
                Spotify.VolumeUp()
            End If
        End Sub
    End Class

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    91

    Re: Spotify - media within systemtray

    Bump

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width