The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Form_Load() MsgBox CurDir End Sub
Private Sub Form_Activate() Shell "D:\quiappelle\appelé\appelé.exe" End End Sub
bureau CurDir renvoi le chemin du fichier temporaire...
Dim watcher As ManagementEventWatcher Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim query As WqlEventQuery = New WqlEventQuery("SELECT * FROM __InstanceCreationEvent " & _ "WITHIN 1 " & _ "WHERE TargetInstance " & _ "ISA 'Win32_Process' AND TargetInstance.Name = 'calc.exe'") watcher = New ManagementEventWatcher(query) AddHandler watcher.EventArrived, AddressOf HandleEvent watcher.Start() End Sub Public Sub HandleEvent(ByVal sender As Object, ByVal e As EventArrivedEventArgs) Dim ev As ManagementBaseObject = e.NewEvent Debug.Print(ev.GetText(TextFormat.Mof)) End Sub
Hors ici, l'application que je dois surveillé est déjà lancée.