Would you please telling me how to close a webpage when i click on the command button?
Thank you very much
Printable View
Would you please telling me how to close a webpage when i click on the command button?
Thank you very much
How do you mean? Close an Internet Explorer window?
yes,i mean to close internetexplorer
Do you know the Name of the Webpage? If so, you can do something like this:
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _ ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As Long Private Const WM_CLOSE = &H10 Private Sub Command1_Click() Dim ret As Long ret = FindWindow(vbNullString, "VBForums.com - Reply to Topic - Microsoft Internet Explorer") ret = SendMessage(ret, WM_CLOSE, 0, 0) End Sub
:D
Phreak