Results 1 to 5 of 5

Thread: Closing Specific IE Windows?

  1. #1
    rsitogp
    Guest

    Question Closing Specific IE Windows?

    Hello,

    Firstly I'de like to say that I searched through the forum but didn't find a simple answer (I'm very ignorent ).

    What I want to do is build a little prog that will close some of the popups from morpheus and some other progs that keep poping up while I'm working and have the apps running in the backgroud, what I want to do is using API (I think) close certin IE windows by their urls, how can this be done?

    Thanks in advance!

  2. #2
    DerFarm
    Guest
    You have more than one problem.

    The first problem is getting the handle for the popups. This can
    be done several ways, I have a set of code for returning the
    TitleBar name and the handle, if you know a unique part of the
    Titlebar name, but I don't think you want that in this situation.

    The more significant problem is to recognize when a new
    instantiation of IE has opened. This requires some kind of
    trigger. Right of hand, I'd say that unless you wish to invest in
    some serious brain time with Win32API programming, your best
    bet would be to get a macro generator (see: iolo.com) and work
    up a macro that will recognize IE being generated, ask if you
    want it killed, and then take the appropriate response.

    Like I said, there are many solutions, and almost all will be more
    elegant than mine. However, this is fast, doesn't require all that
    much work, and the price for generator is about $30. There is
    also a trial period for the full product (about 30 days I think) that
    will let you try it.

    HTH

  3. #3
    DerFarm
    Guest
    Having said the above, I just fell across this site:

    http://www.vbapi.com/ref/index.html


    This thing shows and documents (even more important) over 300
    API calls, data structures, messaging and other stuff.

    It's not complete, but it's better than nothing. You could probably
    put together a VB program to find unwanted iterations of IE from
    them in ....oh 2 or 3 days.

    Good Luck

  4. #4
    rsitogp
    Guest
    Thanks alot! gonna see what I can whip up

  5. #5
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Using the EventVB.dll (downloadable from Merrion Computing ) you can do this thus:

    Code:
    Option Explicit
    
    Dim WithEvents vbLink As EventVB.APIFunctions
    
    Private Sub Command1_Click()
    
    Dim wndThis As ApiWindow
    
    For Each wndThis In vbLink.System.TopLevelWindows
        With wndThis
            If InStr(.WindowText, "Sprink") And .ClassName = "IEFrame" Then
                .SendMessage WM_CLOSE, 0, 0
            End If
        End With
    Next wndThis
    
    End Sub
    
    Private Sub Form_Load()
    
    Set vbLink = New EventVB.APIFunctions
    
    End Sub
    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

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