• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

How do I detect errors with VB.net on a External Application

I have an application I wrote in VB.net  3.5 It does some work for me by monitoring the time my users have on an application that I did not write. I have no control over this 3rd Party application. This is how my app works.

The users click my icon and I throw a stopwatch up in the corner of the screen my app then launches the 3rd Party application using Process.Start("application.exe")

Every once in a while the application(3rd Party) will throw errors, like rundll32 can not start or memory violation errors some errors are throw by the application it's self and some are generic windows errors. I'd like to have my helper app detect the errors and log them. I already have a timer event firing to update the stop clock.

The Ideas I had were a couple, if there is someone I can look for find Forms and identify when that error pops up

or to take a screenshot of the errors that I know and then some how every second try and match what is on the screen with my error signature. This because I would have to do it ever second would need to be very light weight and fast. I have about 5-6 known errors.

Any help would be appreciated, If you have other ideas of how I could accomplish this I am all ears.
0
JasonPJohnson
Asked:
JasonPJohnson
  • 3
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You could use FindWindow()/FindWindowEx() or EnumWindows()/EnumChildWindows() in your Timer event to determine if the errors are currently displayed.  Matches can be made on dialog title, dialog classname, or a combination of them both.  You could even dismiss them automatically using SendMessage().
0
 
JasonPJohnsonAuthor Commented:
Let me try this tomorrow morning and see how it works thanks
0
 
JasonPJohnsonAuthor Commented:
Ok so I have a list of all my hWnd's but how to get the properties  like title
0
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You can use the GetWindowText() API.

The code here may be helpful:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_26376975.html#33353089

0
 
JasonPJohnsonAuthor Commented:
ok good I got the window and I got the window title using the GetWindowText API.... Now I can detect when that window pops up now can I detect when a "label" in that window displays "Finished"
0
 
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now