Buen Dia..
tengo un codigo para iniciar un proceso con una ventana sobre poniendola y que cuando se cierre esa ventana se cierre con el proceso que se inicio.
donde hay una parte donde inicia el proceso sin tener una ruta especifica
Dim programName As String = "SetUp_v100001.exe"
System.Diagnostics.Process.Start(Application.StartupPath & "\" & programName)
pero dentro de este codigo no puedo buscar la forma de que inicie
el proceso de forma maximizada
si les sirve el codigo lo dejo aki
Public Class SetUp_v101
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim programName As String = "SetUp_v100001.exe"
System.Diagnostics.Process.Start(Application.StartupPath & "\" & programName)
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Me.WebBrowser1.AllowWebBrowserDrop = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = DateString
Label2.Text = TimeOfDay
End Sub
Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
If e.CloseReason = CloseReason.UserClosing Then
If MsgBox("Realmente desea salir?", MsgBoxStyle.YesNo, "Finalizar SetUp") = MsgBoxResult.Yes Then
Application.Exit()
For Each prc As Process In Process.GetProcesses
If prc.MainWindowTitle.Contains("Setup_v100001") Then
prc.Kill()
ElseIf prc.ProcessName = "SetUp_v100001.exe" Then
prc.Kill()
Me.Close()
End If
Next
Else
e.Cancel = True
End If
End If
End Sub
End Class
Hola,
Este codigo deberia funcionar en el evento FormActivate antes que se inicie todo. Si no funciona ahi, prueba en el formLoad, aunque yo lo hago en el activate.
Me.WindowState = FormWindowState.Maximized
Saludos, espero te sirva.
checa si te sirve algo de aqui:
Private Sub Form_Resize()
Select Case Me.WindowState
Case Is = 0
Call Shell("notepad", 1) 'abre normal
Case Is = 1
Call Shell("notepad", 2) 'abre minimizado
Case Is = 2
Call Shell("notepad", 3) 'abre maximizado
End Select
End Sub