winsock's SendData and GetData problem

Discussion in 'Visual Basic ( VB )' started by yoz1ris, Jan 27, 2009.

  1. yoz1ris

    yoz1ris New Member

    Joined:
    Jan 16, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    company worker
    Location:
    southern asia
    Dear friends,

    I have tried to make a simple program that enumerates Windows caption/process on a Server.
    Then, the server sends the enumerations to a Client comp through net via winsock.
    I expect the program in client comp. to list (in a textbox) the result as follow.
    -------------------------------------------------------------------------------------------------
    | Handle ID: 327888 | Class name: SysFader | Window name: SysFader || |
    | Handle ID: 5789 | Class name: Winamp v1.x | Window name: Winamp 2.79 || |
    | Handle ID: 656116 | Class name: Notepad | Window name: note - Notepad || |
    | ... |
    | |
    --------------------------------------------------------------------------------------------------
    But, in point of fact the program shows the result like this:
    --------------------------------------------------------------------------------------------------
    | Handle ID: 327888 | Class name: SysFader | Window name: SysFader || |
    | tification Window || |
    | Window || |
    | dle ID: 1179922 | Class name: ThunderRT6Main | Window name: projProcGet2|||
    | | |
    | Class name: Winamp v1.x | Window name: Winamp 2.79 || |
    | ctions Tray | Window name: Connections Tray || |
    | ... |
    | |
    --------------------------------------------------------------------------------------------------
    If this post is allowed, Please could anybody help me find the solution or forward me to any websites containing good winsock tutorial?
    Sincerely yours,

    yoz1ris:nice:


    ----------------ExcerptOfCode------------------

    'In Server's (sender) module:
    ...
    If lResult2 <> 0 Then _
    strDat = strDat & "Handle ID: " & CStr(hwnd) _
    & " | " & "Class name: " & sClassName _
    & " | " & "Window name: " & sWndName & " ||" _
    & vbCrLf & vbNullChar

    frmSend.w2.SendData strDat
    ...

    'In Client's (receiver) module:
    ...
    Private Sub w1_DataArrival(ByVal bytesTotal As Long)
    Dim strDat As String
    w1.GetData strDat
    txtList.SelText = strDat
    End Sub
    ...
    ------------------------EndOfExcerpt---------------------------
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice