Hi All,
I have an window application, when running second instance of my application I want to show the existing UI to foreground.
I have used the below code:
public static void ShowToFront(IntPtr window)
{
ShowWindowAsync(window, SW_SHOWNORMAL);
SetForegroundWindow(window);
}
Also,
protected override void WndProc(ref Message message)
{
if (message.Msg == WM_SHOWFIRSTINSTANCE)
{
ShowToFront(this.Handle);
}
base.WndProc(ref message);
}
Using the above code, I was not able to bring my UI to front. It was blinking on the taskbar.
Please help me on this.
Thanks in advance...