Example #1
0
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 0x4A)
            {
                COPYDATASTRUCT cds     = (COPYDATASTRUCT)m.GetLParam(typeof(COPYDATASTRUCT));
                string         Message = ReceiveMessage.GetMessageString(cds);
                //Console.WriteLine("Debug: " + Message);

                if (Message.StartsWith("ZUNE"))
                {
                    string[] Split = Message.Split(new string[] { "\\0" }, StringSplitOptions.None);

                    if (Split.Length >= 7)
                    {
                        string ZuneRunning = Split[2];
                        string ZuneTrack   = Split[4];
                        string ZuneArtist  = Split[5];
                        string ZuneAlbum   = Split[6];

                        SongInfo SongInfo = new SongInfo();
                        SongInfo.ZuneRunning = 1;
                        SongInfo.ZuneTrack   = ZuneTrack;
                        SongInfo.ZuneArtist  = ZuneArtist;
                        SongInfo.ZuneAlbum   = ZuneAlbum;
                        SongInfo.SendSongInfo();
                    }
                    else
                    {
                        SongInfo SongInfo = new SongInfo();
                        SongInfo.ZuneRunning = 0;
                        SongInfo.SendSongInfo();
                    }
                }
            }
            base.WndProc(ref m);
        }
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 0x4A)
            {
                COPYDATASTRUCT cds = (COPYDATASTRUCT)m.GetLParam(typeof(COPYDATASTRUCT));
                string Message = ReceiveMessage.GetMessageString(cds);
                //Console.WriteLine("Debug: " + Message);

                if (Message.StartsWith("ZUNE"))
                {
                    string[] Split = Message.Split(new string[] { "\\0" }, StringSplitOptions.None);

                    if (Split.Length >= 7)
                    {
                        string ZuneRunning = Split[2];
                        string ZuneTrack = Split[4];
                        string ZuneArtist = Split[5];
                        string ZuneAlbum = Split[6];

                        SongInfo SongInfo = new SongInfo();
                        SongInfo.ZuneRunning = 1;
                        SongInfo.ZuneTrack = ZuneTrack;
                        SongInfo.ZuneArtist = ZuneArtist;
                        SongInfo.ZuneAlbum = ZuneAlbum;
                        SongInfo.SendSongInfo();
                    }
                    else
                    {
                        SongInfo SongInfo = new SongInfo();
                        SongInfo.ZuneRunning = 0;
                        SongInfo.SendSongInfo();
                    }
                }
            }
            base.WndProc(ref m);
        }