Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2008

Tip: Looking for answers? Try searching our database.

Maximize an other application from my csharp application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
peetersb@gmail.com - 23 May 2008 09:56 GMT
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
kimiraikkonen - 23 May 2008 12:07 GMT
On May 23, 11:56 am, "peete...@gmail.com" <peete...@gmail.com> wrote:
> Hello,
>
[quoted text clipped - 6 lines]
> 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/user32/ShowWindow.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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.