Bonjour,
je me permet de faire suite, g le ^m pb :
je voudrais pourvoir fermer une appli à partir de vbscrpit
apparamment, il faut faire appel à des api :
j'ai trouvé le code suivant sur http://faq.vb.free.fr/index.php?question=114
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_CLOSE = &H10
Private Sub Form_Load()
Dim hWnd As Long
hWnd = FindWindow(vbNullString, "Lecteur CD") If hWnd <> 0 Then Call PostMessage(hWnd, WM_CLOSE, 0, 0) Else MsgBox "Impossible de trouver la fenêtre !", vbExclamation End If
End Sub
ça ne fonctionne pas sous vbscrpit (n'accepte pas la déclaration de fonction)
savez-vous si je peux m'en dépatouiller et si oui, comment ?
merci++
Pat
|