Exemplo n.º 1
0
 public void PlayNext()
 {
     if (!this.IsSpotifyRunning)
     {
         return;
     }
     Win32PInvoke.PostMessage(_mainWindow, 0x319, IntPtr.Zero, new IntPtr(0xB0000));
 }
Exemplo n.º 2
0
        // Based on http://spotifycontrol.googlecode.com/svn/trunk/SpotifyControl/ControllerClass.vb

        public void PlayPause()
        {
            if (!this.IsSpotifyRunning)
            {
                return;
            }
            Win32PInvoke.PostMessage(_mainWindow, 0x319, IntPtr.Zero, new IntPtr(0xE0000));

            PropertyChanged.Notify(() => IsPlaying);
        }
Exemplo n.º 3
0
        public void VolumeDown()
        {
            if (!this.IsSpotifyRunning)
            {
                return;
            }

            //This will press the ctrl key then send a the KeyDown to the spotifyHandle
            Win32PInvoke.keybd_event(Keys.ControlKey, 0x1D, Win32PInvoke.KeyEvent.None, UIntPtr.Zero);
            Win32PInvoke.PostMessage(_mainWindow, 0x100, new IntPtr((int)Keys.Down), IntPtr.Zero);

            //Wait a little
            Thread.Sleep(100);

            //Release the ctrlkey
            Win32PInvoke.keybd_event(Keys.ControlKey, 0x1D, Win32PInvoke.KeyEvent.KeyUp, UIntPtr.Zero);
        }