469,920 Members | 2,335 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,920 developers. It's quick & easy.

How to Minimize, Maximize External Running Program through my VB.Net Application

I am New Member on this site. And also new learner to .Net.
I have a query, I have to minimize/maximize the currently running some
applications on my system through my VB.Net application.

Please can any one help me..!!!
Nov 21 '05 #1
2 36753
If you want the current application minimized/maximized then do this:

Me.WindowState = FormWindowState.Maximized
Me.WindowState = FormWindowState.Minimized
Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #2
"Ramkishan Algude via DotNetMonster.com" <fo***@nospam.DotNetMonster.com>
schrieb:
I have a query, I have to minimize/maximize the currently running some
applications on my system through my VB.Net application.

P/invoke with 'ShowWindow':

\\\
Imports System.Diagnostics
..
..
..
Private Declare Function ShowWindow Lib "user32.dll" ( _
ByVal hWnd As IntPtr, _
ByVal nCmdShow As SHOW_WINDOW _
) As Boolean

<Flags()> _
Private Enum SHOW_WINDOW As Integer
SW_HIDE = 0
SW_SHOWNORMAL = 1
SW_NORMAL = 1
SW_SHOWMINIMIZED = 2
SW_SHOWMAXIMIZED = 3
SW_MAXIMIZE = 3
SW_SHOWNOACTIVATE = 4
SW_SHOW = 5
SW_MINIMIZE = 6
SW_SHOWMINNOACTIVE = 7
SW_SHOWNA = 8
SW_RESTORE = 9
SW_SHOWDEFAULT = 10
SW_FORCEMINIMIZE = 11
SW_MAX = 11
End Enum

Private Sub MaximizeAllNotepads()
For Each p As Process In Process.GetProcessesByName("notepad")
ShowWindow(p.MainWindowHandle, SHOW_WINDOW.SW_MAXIMIZE)
Next p
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by EmilH | last post: by
reply views Thread by Chico Jayanthan | last post: by
reply views Thread by =?Utf-8?B?Ym9hdGFibGU=?= | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.