ZZEBULON
Messages postés17Date d'inscriptionmardi 1 juillet 2003StatutMembreDernière intervention23 février 2010
-
11 janv. 2004 à 14:09
PatLogan
Messages postés16Date d'inscriptionmercredi 12 février 2003StatutMembreDernière intervention 8 juin 2004
-
28 avril 2004 à 15:58
ZZEBULONComment accéder à un API depuis un script VBS?
:question)
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 ?