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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB - Interwindow communication.

Status
Not open for further replies.

Siberd

Technical User
Jun 24, 2001
35
0
0
US
Hello,
I have a small aplication which does some math from numbers generated by the user. It then displays the result as a text label, the aptly named, Label1 .
I would like now to send this string to another window, for arguments sake, the following:

Window Handle: &000000
Window Text: ABC
Window Class Name: My_Window
WIndow Style: XXXXXXXXX
Window ID Number: &00

Being relativley new to VB i don't have the first clue on how this might be acheived.
Many thanks for your time
Sib


/Sib
programmer in the making
icq: 44167565
e-mail: siberdude@ntlworld.com
 
Are you trying to send information between forms in the same program you made, or communicate with another application?
 
If the second window is a separate form in the same application:
Sub WhateverPutsYourOriginalDataInTheFirstlable()
Form2.Newlabel.Caption=Form1.Oldlable.Caption
end sub

If the first label text is set at design time, put line 2 aboveit in the Sub Form_Load that appears when you double click on the form in design mode

If the new window in in another application you put a winsock control on both forms and use it to communicate as per the example in the MSDN
 
It is a serperate window, over which i have no design/programming control. its a games application, and my program would be a tool to use with it, sending a string to the input box on it.
For those who may know more, its Ultima Online.
*wanders off to search MSDN*
/Sib
programmer in the making
icq: 44167565
e-mail: siberdude@ntlworld.com
 

since you know the programs main window handle you could then enumerate throught the child windows looking for your label and then use the SendMessage API to send your values to the label.

Good Luck
 
Is it actually using real controls? Many games like UO, EQ, DAoC, AO... don't use real controls but read data from the keyboard directly and just display it. There are a few macro programs out there for these games you might want to look at before trying to right your own....especially since setting windowtext might not work for what you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top