CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    14

    how to get the handle of another application

    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.

  2. #2
    Join Date
    Aug 1999
    Posts
    1

    Re: how to get the handle of another application

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured