Bonjour
je vous expose mon probleme.
J ai un formulaire word qui s'ouvre avec IE et je souhaiterai fermer cette fenetre quand l'utilisateur clique sur "ok" ou "fermer"
J'ai essayé plusieur methodes comme :
Public Function ForceClosingWindow(ByVal hWindow As Long) As Long
Dim ProcessId As Long
Dim hProcess As Long
GetWindowThreadProcessId hWindow, ProcessId
hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId)
ForceClosingWindow = TerminateProcess(hProcess, 0)
End Functionou ca
Function closeit(mycaption As String)
Dim WinWnd As Long, RetVal As Long, lpClassName As String
'Search the window
WinWnd = FindWindow(vbNullString, mycaption)
If WinWnd = 0 Then
MsgBox "Couldn't find the window ..."
End If
ShowWindow WinWnd, SW_SHOWNORMAL
'Create a buffer
lpClassName = Space(256)
'retrieve the class name
RetVal = GetClassName(WinWnd, lpClassName, 256) 'no necessary
'Post a message to the window to close itself
PostMessage WinWnd, WM_CLOSE, 0&, 0&
End FunctionMon process IE est bien Killé mais il reste toujour un process WINWORD qui ne veut pas partir
Pouvez vous m'aider...
