有新消息来时闪烁任务栏并且保持聊天记录内容滚动到最底端

/// /// 有新消息来时闪烁任务栏并且保持聊天记录内容滚动到最底端,QQ就是这么玩滴~ /// /// /// [DllImport("user32.dll")] public static extern bool FlashWindow(IntPtr hWnd, bool bInvert); private void chatrcd_rtb_TextChanged(object sender, EventArgs e) { chatrcd_rtb.ScrollToCaret(); if (this.WindowState == FormWindowState.Minimized) { FlashWindow(this.Handle, true); } } /// /// 当窗口恢复后取消任务栏的闪烁效果 /// 当窗口最小化时判断是否要隐藏到系统托盘 /// /// /// private void chat_frm_SizeChanged(object sender, EventArgs e) { switch (this.WindowState) { case FormWindowState.Normal: FlashWindow(this.Handle, false); break; case FormWindowState.Minimized: if (_hideFlag) { notifyIcon1.Visible = true; this.Visible = false; } break; } }

你可能感兴趣的:(记录)