Thread: closing microsoft internet explorer

  1. #1
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    closing microsoft internet explorer

    I wrote an applacation that used EnumWindows to find and check every window to see if "Microsoft Internet Explorer" was in its title. It then used SendMessage with WM_DESTROY to close the Microsoft Internet Explorer Window.
    It seems to target the windows okay but instead of just closing the window it closes the internet content of the window. This left the menus, frame, and rest of the program non-responsive. You then needed to CRTL-ALT-DELete the window to get it to go away. Does anyone have an idea of why the windows do not close correctly?
    Thank You in advance and for even glancing at my problem!
    Here is a screen shot.
    Last edited by canine; 03-13-2002 at 11:00 PM.
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Try sending a WM_EXIT or WM_CLOSE. Use Spy++ to find which is sent when you close IE manually.

    Probably not getting a PostQuitMessage(0); from the destroy.
    Remember any mem alloc'ed will not be freed unless IE is told to clean it up.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    thank you i will try those other messages but what is Spy++?
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Try DestroyWindow to kill off the app - from msdn:..destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY..

    That is, you are being left with the non-client area of the wnd because that is not being destroyed.

    Alternatively you can send both messages.

    spy++ is a utility/tool that comes with msvc - and I always forget about its existence.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    >>spy++ is a utility/tool that comes with msvc

    Allowing you to look at the messages generated by an app. Can filter msg's, so only looking for say mouse msg's.
    Handy to tell what msg (and where to) an action in an app generates.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    spy++

    if I don't use msvc can i still get spy++? ( I searched the internet for a download but could not find it.)

  7. #7
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    I tryed to attach Spy++ to this post (but it was too big so i linked to it) i dont know if it is illegal to distribute it w/o MSVC++ or not so, you are taking a chance downloading it


    Spy++ Download

  8. #8
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    Smile

    mie "cannot find the server" of that link. i wonder why.
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  9. #9

  10. #10
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    it needs a .dll file, and probably more after that... thanx anyway but mabey if it has its own folder i could get that.
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  11. #11
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Try this. Again, I cannot be responsible for your illegal use of this if you do not own MSVC++ version 6.

    I can't post the rest, but those are the dll and other associations i think.
    Last edited by golfinguy4; 03-18-2002 at 05:05 PM.

  12. #12
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    Smile

    so WM_NCDESTROY worked and thank you all for spy++ it will be very helpful! finallay my MIE killer program works!
    Visit My Site!
    Or Download My finally finnished program. MIE killer!
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. mysterious Internet Explorer TCP connections to Microsoft webserver?
    By Sebastiani in forum Networking/Device Communication
    Replies: 3
    Last Post: 07-13-2008, 01:30 PM
  3. Apps that act "differently" in XP SP2
    By Stan100 in forum Tech Board
    Replies: 6
    Last Post: 08-16-2004, 10:38 PM
  4. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  5. Replies: 2
    Last Post: 10-29-2002, 04:56 PM