I want to know how to bring forward a particular window.
SetForegroundWindow works when the window is not minimized!! but when a minimize the window, SetForegroundWindow doesn't work...
this my code:
int IdRemoto = int.Parse(textBoxID.Text);
Process[] processlist = Process.GetProcessesByName("AA_v3.3");
foreach (Process process in processlist)
{
if (!String.IsNullOrEmpty(process.MainWindowTitle))
{
if (IdRemoto.ToString() == process.MainWindowTitle)
SetForegroundWindow(process.MainWindowHandle);
}
}
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…