Results 1 to 4 of 4

Thread: how to close a webpage?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    VIETNAM
    Posts
    209

    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

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    How do you mean? Close an Internet Explorer window?


    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    VIETNAM
    Posts
    209

    yes

    yes,i mean to close internetexplorer

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Do you know the Name of the Webpage? If so, you can do something like this:

    VB Code:
    1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
    2. ByVal lpWindowName As String) As Long
    3. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
    4. ByVal wMsg As Long, ByVal wParam As Long, _
    5. lParam As Any) As Long
    6. Private Const WM_CLOSE = &H10
    7.  
    8.  
    9. Private Sub Command1_Click()
    10. Dim ret As Long
    11. ret = FindWindow(vbNullString, "VBForums.com - Reply to Topic - Microsoft Internet Explorer")
    12. ret = SendMessage(ret, WM_CLOSE, 0, 0)
    13. 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
  •  



Click Here to Expand Forum to Full Width