This blog is moved to
http://amalhashim.wordpress.com

Wednesday, February 18, 2009

Bring window to front

[DllImport("User32.dll")]
public static extern Int32 SetForegroundWindow(int hWnd);

[DllImport("user32.dll")]
public static extern int FindWindow(string lpClassName, string lpWindowName);

private void BringToFront(string className,string CaptionName)
{
SetForegroundWindow(FindWindow(className,CaptionName));
}

No comments: