CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    84

    Question FindWindow & Close Window

    Are you often annoyed by the auto pop-up IE window?

    That's why I want to write a program to find and close all such pop windows. I noticed a kind of window by spy++. Its class is "Internet Explorer_Server". And I tried the following code:

    Dim hwnd As Long

    hwnd = FindWindow("Internet Explorer_Server", vbNullString)

    If hwnd <> 0 Then
    SendMessage hwnd, WM_CLOSE, 0&, 0&
    End If

    The hwnd is always 0 though there is a pop window which class is "Internet Explorer_Server"!

    What's the problem?

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: FindWindow & Close Window

    Well I think you have got it wrong. Any IE Window will have the Class name of IEFrame and the any child window like the page will have the class name of "Internet Explorer_Server".

    The reason why your HWND is always zero is because the window that you are trying to search for is a child window of IEFrame class.

    Why would you want to write a program for something that is already present in Internet Explorer. I am using IE 6 on Win XP SP2 and I don't get any pop-ups.

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: FindWindow & Close Window

    @AskProf: Have a look here !

  4. #4
    Join Date
    May 2005
    Posts
    49

    Re: FindWindow & Close Window

    @hans that link doesnt seem to work for me.

  5. #5
    Join Date
    May 2005
    Posts
    49

    Re: FindWindow & Close Window

    OOps my mistake, it works now, never mind

  6. #6
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: FindWindow & Close Window

    @Intercepter: You had me worried for a while, glad you got the link to work!

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

Featured