Oggi dopo mesi ho ripreso in mano VB 2005 ma devo essermi arrugginito.. Infatti è il 2° thread che vi posto..
Qualcuno sa dirmi dove è l'errore..
Ho usato notepad giusto per provare.. In teoria dovrebbe (almeno nelle mie intenzioni) stampare a video "CIAO" quando chiudo il notepad.. ma in realtà non mi stampa nulla..codice:Imports System.Diagnostics Public Class Form1 Dim myProcess As New Process() Private elapsedTime As Integer = 50 Private eventHandled As Boolean Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load myProcess.StartInfo.FileName = "notepad.exe" myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized AddHandler myProcess.Exited, AddressOf uscita End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click myProcess.Start() End Sub Sub uscita(ByVal sender As System.Object, ByVal e As System.EventArgs) If myProcess.HasExited = True Then MsgBox("CIAO") End If End Sub End Class
Nella Versione Definitiva dovre utilizzarlo con un PDF che una volta chiuso deve riportarmi al programma fatto in VB
Grazie

Rispondi quotando