Click to See Complete Forum and Search --> : how to get the handle of another application


Jagdish Krishnan
August 12th, 1999, 10:19 AM
hi ,
could anyone help for my querry . i want to get the control of another application, ie;
when an user has launched an application and when the user cliks on some button on that
application then my application should get activated. lets say an example in netscape when the
profile manager comes up and the user presses the selects and oresses the button to proceed
i want to activate an application.



any help would be greatly appreciated.

ifox
August 13th, 1999, 03:29 AM
hi:
you can use the control "winsock"
example:
formA:
Private Sub Form_Load()
' The control's name is udpPeerA
With udpPeerA
' IMPORTANT: be sure to change the RemoteHost
' value to the name of your computer.
.RemoteHost = "***.***.***.***"
.RemotePort = 1003 ' Port to connect to.
.Bind 1005 ' Bind to the local port.
End With
End Sub

Private Sub txtSend_Change()
' Send text as soon as it's typed.
udpPeerA.SendData txtSend.Text
End Sub

Private Sub udpPeerA_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
udpPeerA.GetData strData
txtOutput.Text = strData
End Sub

formB:
Private Sub Form_Load()
' The control's name is udpPeerB
With udpPeerB
' IMPORTANT: be sure to change the RemoteHost
' value to the name of your computer.
.RemoteHost = "***.***.***.***"
.RemotePort = 1003 ' Port to connect to.
.Bind 1005 ' Bind to the local port.
End With
End Sub

Private Sub txtSend_Change()
' Send text as soon as it's typed.
udpPeerB.SendData txtSend.Text
End Sub

Private Sub udpPeerB_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
udpPeerB.GetData strData
txtOutput.Text = strData
End Sub

when your application receives the data which the other application sends, you can turn the data into
commands.