VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

How to keep new Internet Explorer windows from popping up... great for the WebBrowser control

Daniel S. Soper  (9 Submissions)   Miscellaneous   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Have you ever created an application that relies on a Microsoft Internet Explorer interface (using the WebBrowser control, for example), and you want to keep those pesky IE popup windows from popping up when you don't want them to? If you have, then you know that there is no built in way to keep Internet Explorer from creating new windows under certain circumstances. This program solves this problem by performing the following functions:
(1) On startup, the program examines all of the active windows on your system and remembers which ones are Internet Explorer windows.
(2) The program then goes into a monitoring mode in which it periodically (10 times per second) checks to see if any new Internet Explorer windows have been created.
(3) If any new IE windows are found, the program posts a close window message into the new IE window's message queue, effectively destroying the window.

Inputs
None.

Returns
None.

Side Effects
When the program is active, no new Internet Explorer windows can be created, even if you want them to be.

API Declarations
The following API's are utilized in this program:
GetWindowTextLength, EnumWindows, GetWindowText, PostMessage

Rate How to keep new Internet Explorer windows from popping up... great for the WebBrowser control (2(2 Vote))
How to keep new Internet Explorer windows from popping up... great for the WebBrowser control.bas

How to keep new Internet Explorer windows from popping up... great for the WebBrowser control Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters