Solved

Winsock: Networking and Internet

Posted on 2000-02-19
9
255 Views
Last Modified: 2013-11-13
I'm looking for codes that will enable a PC to extract another PC's internet activity online. What i want is the ablility to obtain the IE and Netscape Navigator's internet site address and the topic as well, if available.
I've established a connection using the winsock control within 2 PCs. I just need the codes to add in to obtain the infomation on the PC that I'm monitoring. I'm looking for an easy-to-use protocol; i.e. just click and display type, a click will display a list of internet addresses that the monitored PC is currently browsing on.
And can someone teach me how to do multiple connection with that winsock control? I've tried many times but still fail. What are the things that I should do?
Points awarded could be up if necessary...
Thanx.
0
Comment
Question by:pennyroyal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 2

Expert Comment

by:orbitaltech
ID: 2538973
Well, to create multiple instances of a winsock control is not too hard. Just like any other windows control, you want to set the Index property of the Winsock control to 0. This will allow you to reference multiple instances of the control. For example:

Winsock1(0)
Winsock1(1)
Winsock1(2)  etc...

This should solve some of your problems..
0
 

Expert Comment

by:FAQ
ID: 2539123
why don't you use the API?
0
 
LVL 2

Expert Comment

by:orbitaltech
ID: 2539243
Either or would work
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:pennyroyal
ID: 2539686
What I really wanted is my first question. How to retrieve the site address and the topic from another PC who is browsing using Netscape and IE?
I appreciate the answers to my second question, but I really need the monitoring internet part before I go into the multiple connection part...
Thanx.
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2542269
Place a text box called DDELink on a form and a command button (command1)

Option Explicit

Private Sub Command1_Click()
    MsgBox GetCurrentIEURL
    MsgBox GetCurrentNetscapeURL
End Sub
Function GetCurrentNetscapeURL()
Dim commapos As Integer
Dim urltitle As String
With DDELink
    .LinkMode = 0
    .LinkTopic = "Netscape|WWW_GetWindowInfo"
    .LinkItem = &HFFFFFFFF
    .LinkMode = 2
    .LinkRequest
    .LinkMode = 0
    Debug.Print .Text
    Debug.Print Left(.Text, 20)
    commapos = InStr(.Text, ",")
    Debug.Print
    GetCurrentNetscapeURL = Mid(.Text, 2, commapos - 3)
    urltitle = Mid(.Text, commapos + 2, Len(.Text) - (commapos + 2))
  End With
End Function
Function GetCurrentIEURL()
Dim commapos As Integer
Dim urltitle As String
With DDELink
    .LinkMode = 0
    .LinkTopic = "Iexplore|WWW_GetWindowInfo"
    .LinkItem = &HFFFFFFFF
    .LinkMode = 2
    .LinkRequest
    .LinkMode = 0
    Debug.Print .Text
    Debug.Print Left(.Text, 20)
    commapos = InStr(.Text, ",")
    Debug.Print
    GetCurrentIEURL = Mid(.Text, 2, commapos - 3)
    urltitle = Mid(.Text, commapos + 2, Len(.Text) - (commapos + 2))
  End With
End Function

this is easily modified to send the data over the network
0
 
LVL 13

Accepted Solution

by:
crazyman earned 100 total points
ID: 2542289
Use EnumWindows to search for all IE windows.  Here is an example: (Taken from a PAQ)

                           '~~~~~Form Code~~~~~

                           Option Explicit

                           Private Sub Command1_Click()
                               Call fEnumWindows 'Look for IE
                           End Sub


                           '~~~~~Module Code~~~~~

                           Option Explicit

                           Public Const MAX_PATH = 260
                           Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
                           Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
                           Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

                           Public Function EnumFunc(ByVal hwnd As Long, ByVal lpData As Long) As Long
                               Dim lResult    As Long
                               Dim sWndName   As String
                               Dim szClassName As String
                           '
                           ' This callback function is called by Windows (from the EnumWindows
                           ' API call) for EVERY window that exists.  It populates the aWindowList
                           ' array with a list of windows that we are interested in.
                           '
                               EnumFunc = 1
                               szClassName = Space$(MAX_PATH)
                               sWndName = Space$(MAX_PATH)

                               lResult = GetClassName(hwnd, szClassName, MAX_PATH)
                               szClassName = Left$(szClassName, lResult)

                               If UCase(szClassName) = "IEFRAME" Then
                                   lResult = GetWindowText(hwnd, sWndName, MAX_PATH)
                                   sWndName = Left$(sWndName, lResult)
                                   'Found an IE window
                                   'Do something with the window text here
                                   Debug.Print sWndName
                               End If
                           End Function

                           Public Function fEnumWindows() As Boolean
                               Dim hwnd As Long
                           '
                           ' The EnumWindows function enumerates all top-level windows
                           ' on the screen by passing the handle of each window, in turn,
                           ' to an application-defined callback function. EnumWindows
                           ' continues until the last top-level window is enumerated or
                           ' the callback function returns FALSE.
                           '
                               Call EnumWindows(AddressOf EnumFunc, hwnd)
                           End Function
0
 
LVL 13

Expert Comment

by:crazyman
ID: 2542321
If you use any of mine please reject the current answer and accept my comment as an answer.
Cheers
0
 

Author Comment

by:pennyroyal
ID: 2551629
thanx a lot...
simply fabulous...
exactly what i need... :)
0
 

Expert Comment

by:newmembername
ID: 5042631
use winsock?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question