public static bool FlashWindowEx(newMessageFrm form) { IntPtr hWnd = form.Handle; FLASHWINFO fInfo = new FLASHWINFO(); fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo)); fInfo.hwnd = hWnd; fInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; fInfo.uCount = UInt32.MaxValue; fInfo.dwTimeout = 0; return(FlashWindowEx(ref fInfo)); }
public static bool FlashWindowEx(newMessageFrm form) { IntPtr hWnd = form.Handle; FLASHWINFO fInfo = new FLASHWINFO(); fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo)); fInfo.hwnd = hWnd; fInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; fInfo.uCount = UInt32.MaxValue; fInfo.dwTimeout = 0; return FlashWindowEx(ref fInfo); }
private void friendView_MouseDoubleClick(object sender, MouseEventArgs e) { ListView.SelectedListViewItemCollection selectedItem = friendView.SelectedItems; ListViewItem lsItem = selectedItem[0]; String item = lsItem.Text; if(CheckIfFormIsOpen(item, "") == true) { } else { newMessageFrm tempMsg = new newMessageFrm(item, serverName); tempMsg.frmId = item; tempMsg.Show(); } }
static void OnNewMessage(object sender, S22.Xmpp.Im.MessageEventArgs e) { String resID = e.Jid.Resource; String domain = e.Jid.Domain; String jid = e.Jid.ToString().Replace(resID, ""); jid = jid.Replace(domain, ""); jid = jid.Replace("@/", ""); String mes = e.Message.Body; if (CheckIfFormIsOpen(jid, mes) == true){ } else { var invokingForm = Application.OpenForms[0]; // or whatever Form you can access if (invokingForm.InvokeRequired) { invokingForm.BeginInvoke(new EventHandler<S22.Xmpp.Im.MessageEventArgs>(OnNewMessage), sender, e); return; // important!!! } newMessageFrm tempMsg = new newMessageFrm(jid, domain); tempMsg._msgText(jid, mes); tempMsg.frmId = jid; tempMsg.Show(); } }