?
Solved

How to capture window display events in VB

Posted on 2003-03-23
5
Medium Priority
?
180 Views
Last Modified: 2010-05-01
I want to write a VB app that sits in the background waiting for other applications to pop up dialogs, then send an event to that dialog box's Ok button to close it. In particular (although I'd like the app to be as generic as possible), I want to be able to automatically close those pesky Outlook XP messages that say another program is trying to access Outlook.

I believe that I need to monitor the message stack, and whenever a window display event arrives, I get the window handle, check the window title and for a control with particular text (such as 'Another program is accessing Outlook'), look for a control (button) with a particular string (such as 'Ok', or 'Cancel'), and send a mouse click event to that control.

What I can't figure out is how to monitor the event stack for other applications from VB.

Any help is appreciated.

Chuck Rothman
0
Comment
Question by:chuck_rothman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:makman
ID: 8194279
Hi Chuck,
It seems u need a process control to know the applications running in your pc and then.Stop the specified application.
Well the following code will give you the list of Procees in your Pc from which you can again code to stop the proceess you dont want.

*** code removed at the request of its author by Netminder, Site Admin ***
*** to view the code please see the link below ***

Please go through the link to know more:
http://www.mvps.org/vbnet/index.html?http://www.mvps.org/vbnet/api/_func/metht.htm
Regards,
Makman
0
 

Author Comment

by:chuck_rothman
ID: 8196717
Thanks for your reply. however, I think you mis-understood me. I don't want to kill the application. All I want to do is close the dialog box.

I need capture all of the window creation events, check the window titles and text, and close the dialogs I want by sending mouseclick events to the Ok or cancel buttons. I know how to send the events if I have the window handle, but I don't know how to monitor the event stack to capture all of the window creation events.

0
 

Expert Comment

by:CleanupPing
ID: 8531767
Hi chuck_rothman,
This old question (QID 20560478) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8958882
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

-->PAQ - with points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
EE Cleanup Volunteer
0
 

Accepted Solution

by:
AnnieMod earned 0 total points
ID: 9286826
Per recommendation.

AnnieMod
Community Support Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question