VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



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

by Daniel S. Soper (9 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

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.
Code 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

Upload

Download this snippet    Add to My Saved Code

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

No comments have been posted about How to keep new Internet Explorer windows from popping up... great for the WebBrowser control. Why not be the first to post a comment about How to keep new Internet Explorer windows from popping up... great for the WebBrowser control.

Post your comment

Subject:
Message:
0/1000 characters