Closing all opened IE windows at once

rajbly
10-09-2001, 08:21 AM
Can anybody tell me how to Close all opened IE windows at one go.

ChiefRedBull
10-09-2001, 10:31 AM
You'd have to use the EnumWindows API to loop through them, check the window caption with GetWindowText API, then close them via DestroyWindow API.

Good luck

Chief

"How are we to learn, if those that know will not teach... ?" - Me.

Garry Clarke
10-09-2001, 06:50 PM
I was searching for info and came across this on another site, I believe it does the job you require. Like you I am new to this so I hope the code helps.
'Ever unload one of your programs, and have it still residing in memory..? Well it is probably because you forgot to unload one of your forms. This simple code unloads all loaded forms so that this doesn't have to happen to you again.

'--------------------------------------------------------------------------------


'Source Code:
'Private Sub UnloadAll()
'Dim frm As Form
'For Each frm In Forms ' Loop Through All Loaded Forms
' Unload frm ' And Unload Them...
'Next frm
'End Sub
'--------------------------------------------------------------------------------
'Usage:
'UnloadAll

'This neat little code manually creates a shortcut file that will automatically launch your default browser to the page selected. Place the shortcut on the users desktop to increase hits to your webpage..!
'--------------------------------------------------------------------------------

ChiefRedBull
10-10-2001, 05:18 AM
That will only work if the IE is part of his program. I believe he wants to close all open internet explorer windows. This means you have to find the window, then destroy it.

However - I'm curious as to why you might want to do this....


Chief

BillSoo
10-11-2001, 12:47 AM
Did you ever get sucked into a site where all of a sudden browser windows started popping up like rabbits and as fast as you kill one, another one pops up? I hate it when that happens. There was an article on the news about people who make websites similar in name to "real" websites. People accidentally mistype the name of a site and get innundated with gambling or porn ads. A utility that automatically closes all browser windows could be useful.....

ChiefRedBull
10-11-2001, 04:10 AM
True - I didn't think of that - even though I've got one of those! LoL. Sorry for being suspicious old chum. images/icons/wink.gif

Chief

KesleyK
10-11-2001, 11:20 AM
My answer is always to unplug my machine to the service (at work) or disconnect my DSL (at home). ****es me off when that happens...

Mill
10-11-2001, 11:56 AM
Or if you're at work and playing a game online or something and you get some pop-up ad windows for not-so-nice sites and you hear your boss coming around the corner and... oh never mind. LOL

Laurent
10-11-2001, 12:12 PM
hey folks you should look into a utility for internet that blocks all these windows poping! i thing northern has this utulity for internet, it's like an anti virus but for poping windows. i don't remember the name thow.... :(

ChiefRedBull
10-11-2001, 12:31 PM
Heres an extact I think I downloaded off http://www.thescarms.com/vb
It will give you all the current window titles.
Use
<font color=red>Call pGetTasks</font color=red>
in the Form_Load() to use it.

Enjoy

Chief

Mill
10-11-2001, 01:04 PM
I attempted to do this, but something doesn't quite work. The DestroyWindow API doesn't do what I thought it would do, but it also doesn't return an error.

Can someone take a look at the code and see what I'm missing?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum