Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to access a 2nd applications form collection

Status
Not open for further replies.

blamberson

Programmer
Nov 19, 2003
4
US

Two vb6 applications running, how do I set a form variable to a form in the second app so that I can use the form's control collection to get info from a label on the second on a form in the second application? thanks.

 
Hmm. You might be able to do this if the second exe was an Active X executable...

What you're asking might also be possible using the API, if you know the handle of the label...
 
Thanks, I tried GetObject and get a message that can't create a reference to a form in an active x object. The second application is a compiled vb, standard exe.

I've used the API and can get the handle of the form (labels don't have handles). Plan was to set the form to a form variable then look at the form's control collection. Can't get from windows handle to form reference.
Does any of this bring any thoughts to mind?
 
Yeah - there's a tool called "Spy" something or other than ships with professional. If you have that, you can find the "handle" of the label (good point). You can then use the API to get the text of the window...

It's a while since I did this though...

If you write your exe as a seperate object, provide a public function for passing back the text...



 
Thank you for working on this.
If I could figure a way to set an object var to anything in the other application, I could then work with vb objects. Is there a way to set a vb object or instance variable to the other application to gain access? A public function in the other app would only work once I had a reference from one app to the other.

By the way, the label control is not a window. According to vb documentation, it does not have a windows handle viewed from the API or a hWnd property in vb. It is a graphic display of text written at runtime by vb, on a form. It is included in the controls collection. It is similar to a line and referred to in documentation as a "lightweight control".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top