I have an appliction through it opening/starting another software which always come front of my application and i have to minimize it manualy.
I want when any application/software open through my applicaion should be open in background and minimize always(no reflection).
using code like this but not working.
Any suggestion or something new. Diagnostics.Process.Start("path\Notepad.exe")
then calling below functions FindAndMinimizeWindowByTitle("notepad")
Public Const SW_MINIMIZE As Integer = 6
Public Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Integer
End Function
Public Function FindAndMinimizeWindowByTitle(ByVal Title As String) As Boolean
For Each clsProcess As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses
If (clsProcess.ProcessName = Title) Then
ShowWindow(clsProcess.MainWindowHandle, SW_MINIMIZE)
Return True
End If
Next
Return False
End Function
Subhash.C