I have a fullscreen application, that is hiding Windows own taskbar (as it should). I have a button method where i start IE process
Process.Start(pathWayToIE);
Which works fine, but when minimizing that window, I can't access it again, since the taskbar is hiding, as i want it to do. Is there a way to find the same process and maximize that window on the same button click, instead of open a new window of IE?
I do have this statement to see if a window is already open
var proc = Process.GetProcesses();
for(var i = 0; i < proc.Length; ++i)
{
if(proc[i].ProcessName == "msedge")
{
appName = proc[i].ProcessName;
appId = proc[i].Id;
}
}
int count = Process.GetProcesses().Where(p => p.ProcessName == appName).Count();
if (count > 1)
{
MessageBox.Show("A window is already open!");
}
So to see if a window is actually open works, but how to maximize it again i struggle with.
The whole method looks like this:
private void IE_Button_Click(object sender, RoutedEventArgs e)
{
var startEdge = @"pathwayToIE";
var appName = "";
var appId = 0;
var proc = Process.GetProcesses();
for(var i = 0; i < proc.Length; ++i)
{
if(proc[i].ProcessName == "msedge")
{
appName = proc[i].ProcessName;
appId = proc[i].Id;
}
}
Process myEdgeProcess = new Process();
ProcessStartInfo procStartInfo = new ProcessStartInfo(startEdge);
myEdgeProcess.StartInfo.FileName = startEdge;
int count = Process.GetProcesses().Where(p => p.ProcessName == appName).Count();
int currentRunningInstance = Process.GetProcesses().Where(c => c.Id == appId).Count();
if (count > 1)
{
MessageBox.Show("A window is already open!");
}
else
{
Process.Start(procStartInfo);
}
}
Thanks in advance for tips