S
Sonnich Jensen
Hi
accroding to my post from yesterday, I found this....
It should close all IE windows, and is close to what I tried.
The problem is SendMessage HWnd, WM_CLOSE, 0&, 0&
It gives a ding (like for a confirmation or warning), I guess that
something blocks it, so it is not allowed to close.
I tried other messages, WM_DESTROY and WM_QUIT, same result... or
actually none, they do not even give a ding.
Why can I not close that window?
I should mention, that I create it myself using shellexecute and wait
7 secs. So the window is open and ready.
WBR
Sonnich
Public Declare Function FindWindow Lib "user32" Alias
"FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Public Declare Function SendMessage Lib "user32" Alias
"SendMessageA" ( _
ByVal HWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Public Const WM_CLOSE As Long = &H10
Public Const IE_WINDOW_CLASS = "IEFrame"
Dim HWnd As Long
HWnd = FindWindow(IE_WINDOW_CLASS, vbNullString)
Do Until HWnd = 0
SendMessage HWnd, WM_CLOSE, 0&, 0&
HWnd = FindWindow(IE_WINDOW_CLASS, vbNullString)
Loop
accroding to my post from yesterday, I found this....
It should close all IE windows, and is close to what I tried.
The problem is SendMessage HWnd, WM_CLOSE, 0&, 0&
It gives a ding (like for a confirmation or warning), I guess that
something blocks it, so it is not allowed to close.
I tried other messages, WM_DESTROY and WM_QUIT, same result... or
actually none, they do not even give a ding.
Why can I not close that window?
I should mention, that I create it myself using shellexecute and wait
7 secs. So the window is open and ready.
WBR
Sonnich
Public Declare Function FindWindow Lib "user32" Alias
"FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Public Declare Function SendMessage Lib "user32" Alias
"SendMessageA" ( _
ByVal HWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Public Const WM_CLOSE As Long = &H10
Public Const IE_WINDOW_CLASS = "IEFrame"
Dim HWnd As Long
HWnd = FindWindow(IE_WINDOW_CLASS, vbNullString)
Do Until HWnd = 0
SendMessage HWnd, WM_CLOSE, 0&, 0&
HWnd = FindWindow(IE_WINDOW_CLASS, vbNullString)
Loop