On May 23, 11:56 am, "peete...@gmail.com" <peete...@gmail.comwrote:
Hello,
I want to maximize an other running application from my C#
application.
First I want tot test if the application is running, and then maximize
it from my csharp application.
How can I do that?
Thanks
Bart
You can use ShowWindow API via P/invoke. And use GetProcessByName from
Process class in a for-each loop then call ShowWindow function API.
For decleration more info:
http://www.pinvoke.net/default.aspx/...howWindow.html
After declaring API, simply use:
// For example maximize notepad
foreach (Process p in Process.GetProcessesByName("notepad"))
{
ShowWindow(p.MainWindowHandle, SHOW_WINDOW.SW_MAXIMIZE);
}
Thanks,
Onur Güzel