I am new to VB but I have done something simillar.
Hopefully this will get you on the right track if it isnt what you are
looking for.
You can do stuff to windows through their process... so
'Declare your processes array
Dim myProcesses() As System.Diagnostics.Process
'retrieve your processes ( lets say TextBox1.Text has a value of
"Notepad" ( do not put "Notepad.exe" )
myProcesses = Process.GetProcessesByName(Trim(TextBox1.Text))
'You can do a loop, but lets just work with the first instance of notepad. -
so it will be array pointer ( 0 )
If myProcesses.Length > 0 Then
'Use any one of these commands
ShowWindow(myProcesses(0).MainWindowHandle, SW_MAXIMIZE) 'show Maximized
ShowWindow(myProcesses(0).MainWindowHandle, SW_MINIMIZE) 'show Minimized
ShowWindow(myProcesses(0).MainWindowHandle, SW_SHOW) 'Show
ShowWindow(myProcesses(0).MainWindowHandle, 9) 'Restore
End If
'Now you are probably wondering where the SW_Maximize and SW_Minimze come
from... declare them on top
Private Const SW_RESTORE As Int32 = 9
Private Const SW_MAXIMIZE As Int32 = 3
Private Const SW_MINIMIZE As Int32 = 6
Private Const SW_SHOW As Int32 = 5
To find out what these values i cant re-find the website, but search google
groups for sw_restore or sw_maximize and in a
post somewhere, someone took the time to give you all the values.
Hope that helps
Miro