|
-
Apr 6th, 2004, 09:26 AM
#1
Thread Starter
Addicted Member
how to close a webpage?
Would you please telling me how to close a webpage when i click on the command button?
Thank you very much
-
Apr 6th, 2004, 04:43 PM
#2
-
Apr 7th, 2004, 09:03 AM
#3
Thread Starter
Addicted Member
yes
yes,i mean to close internetexplorer
-
Apr 7th, 2004, 04:24 PM
#4
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

Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|