borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Changing the contents of a combobox)Next Topic (Global Storage for FormName and Handle) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Is there any way to capture Form events at application level in vb 6.0 in a desktop application?
Poster Message
divy24
Level: Trainee

Registered: 25-09-2007
Posts: 3

icon Is there any way to capture Form events at application level in vb 6.0 in a desktop application?

i'm a developer with experience in c# but have no experience in VB 6.0.I'm looking for a way to capture form events at application level .Is it possible in VB 6.0.Plz do not give replies like moving to dot net.That cannot be done .The problem is that my application has hunders of forms spread across multiple projects.I'm looking for tracking the time each form has been active.I know it can  be done at the form level,but it wll require code changes at each form  which will be quite cumbersome.

I'm open to any ideas on this.Thanks in advance.

25-09-2007 at 08:01 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Is there any way to capture Form events at application level in vb 6.0 in a desktop application?

Hi Are they hosted in an MDI Parent? If so, you could get the child window changing ( from the downloads section on this form ), but there's no simple way of picking up all of the events.

What events are you capturing?
Are they the standard windows messages? (ie. activate and stuff).
If so, you could try the following.

create a class called "clsMyFormEventHandler" or something

add

public withevents m_VBForm as form


then, every time you have the code "set frm = new form1", create a new instance of this class and set the property.

This will allow you to put all of your form-event code in the same class.

Hope this points you in the right direction.
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

30-09-2007 at 07:18 PM
View Profile Send Email to User Show All Posts | Quote Reply
divy24
Level: Trainee

Registered: 25-09-2007
Posts: 3
icon Re: Is there any way to capture Form events at application level in vb 6.0 in a desktop application?

quote:
stickleprojects wrote:
Hi Are they hosted in an MDI Parent? If so, you could get the child window changing ( from the downloads section on this form ), but there's no simple way of picking up all of the events.

What events are you capturing?
Are they the standard windows messages? (ie. activate and stuff).
If so, you could try the following.

create a class called "clsMyFormEventHandler" or something

add

public withevents m_VBForm as form


then, every time you have the code "set frm = new form1", create a new instance of this class and set the property.

This will allow you to put all of your form-event code in the same class.

Hope this points you in the right direction.
Kieron



I got what u r saying.I'm capturing only the Activate event for Forms and logging the time for that time only(between activate event and deactivate event).I'm alos trying to capture app. focus lost event.Leave that apartfrom the discussion.i can do that.What i want is actually to try and get all form names  and their handles in the application at a central repository(kinda) and then do the logging on that.My requirement now is to pass each Projects' Form Collection to a global Object in the application which can be used on some Form event like activate and deactivate and then identify the form using the collection.Can you plz reply on how to pass Forms Collection effectively(No duplicates) across Projects.Thanks for ur tip.
15-10-2007 at 07:52 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Is there any way to capture Form events at application level in vb 6.0 in a desktop application?
Previous Topic (Changing the contents of a combobox)Next Topic (Global Storage for FormName and Handle) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder