public MainWindow() { InitializeComponent(); this.Title = "last.fm snarls " + versionString; if (hwnd == IntPtr.Zero) { snarlComWindow = new NativeWindowApplication.snarlMsgWnd(); hwnd = snarlComWindow.Handle; } if (!System.IO.File.Exists(iconPath)) { iconPath = ""; } this.userName.Text = Properties.Settings.Default.Username; SnarlConnector.RegisterConfig(hwnd, "last.fm snarls", Snarl.WindowsMessage.WM_USER + 58, iconPath); SnarlConnector.RegisterAlert("last.fm snarls", "Greeting"); SnarlConnector.RegisterAlert("last.fm snarls", "Now being played track"); SnarlConnector.RegisterAlert("last.fm snarls", "Recently played track"); SnarlConnector.RegisterAlert("last.fm snarls", "last.fm error"); SnarlConnector.RegisterAlert("last.fm snarls", "Connection error"); if (DEBUG) { SnarlConnector.RegisterAlert("last.fm snarls", "Debug messages"); } m_notifyIcon = new System.Windows.Forms.NotifyIcon(); m_notifyIcon.Text = "last.fm snarls"; m_notifyIcon.Icon = new System.Drawing.Icon(iconPathApp); m_notifyIcon.DoubleClick += new EventHandler(m_notifyIcon_Click); userName.Focus(); }
public MainWindow() { InitializeComponent(); this.Title = "last.fm snarls " + versionString; if (hwnd == IntPtr.Zero) { snarlComWindow = new NativeWindowApplication.snarlMsgWnd(); hwnd = snarlComWindow.Handle; } if(!System.IO.File.Exists(iconPath)) { iconPath = ""; } this.userName.Text = Properties.Settings.Default.Username; SnarlConnector.RegisterConfig(hwnd, "last.fm snarls", Snarl.WindowsMessage.WM_USER + 58, iconPath); SnarlConnector.RegisterAlert("last.fm snarls", "Greeting"); SnarlConnector.RegisterAlert("last.fm snarls", "Now being played track"); SnarlConnector.RegisterAlert("last.fm snarls", "Recently played track"); SnarlConnector.RegisterAlert("last.fm snarls", "last.fm error"); SnarlConnector.RegisterAlert("last.fm snarls", "Connection error"); if (DEBUG) { SnarlConnector.RegisterAlert("last.fm snarls", "Debug messages"); } m_notifyIcon = new System.Windows.Forms.NotifyIcon(); m_notifyIcon.Text = "last.fm snarls"; m_notifyIcon.Icon = new System.Drawing.Icon(iconPathApp); m_notifyIcon.DoubleClick += new EventHandler(m_notifyIcon_Click); userName.Focus(); }