Results 1 to 4 of 4

Thread: get notice when the user connect to internet

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Posts
    5
    hello
    How can I get an event(or a notice) the minute a user logs on the internet(as in icq, when the red icon turns to green icon).
    I tried using GetInternetConnectedState but it's not the same, and it also has problem, when a user has a Lan connection.
    thnx alot

  2. #2
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    Hi ,


    My EMail Is : [email protected]

    Please Enter the following code.

    private declare function RegOpenKey lib "advapi32.dll"
    alias "RegOpenKeyA" (byval hKey as long,byval lpSubkey as string,phkResult as long) as long

    private declare function RegCloseKey lib "advapi32.dll" (byval hKey as long) as long

    private declare function RegQueryValueEx lib "advapi32.dll" alias "RegQueryValueExA" (byval hKey as long,byval lpValueName as string,byval lpReserved as as long, lpType as long,lpData as any,lpcbData as long) as long

    public function IsNetConnected() as boolean

    dim phkResult as long,lpData as long,lpcbData as long
    dim nReturnCode as long

    IsNetConnected=false

    ReturnCode=RegOpenKey(&H80000002, _
    "System\CurrentControlSet\Services\RemoteAccess", _
    phkResult)

    if ReturnCode=0& then

    lpData=0&
    lpcbData=0&
    ReturnCode=RegQueryValueEx(phkResult, _
    "Remote Connection",0&,0&,byval lpData,lpcbData)

    lpcbData=len(lpData)

    ReturnCode=RegQueryValueEx(phkResult, _
    "Remote Connection",0&,0&,lpData,lpcbData)

    if ReturnCode=0& and lpData<>0 Then
    IsNetConnected=true
    endif

    RegCloseKey(phkResult)

    End Function

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Posts
    5
    hello Santosh...
    thnx for your reply but...
    I don't want a function that returns a TRUE/FALSE of whether the user is logged on - insted I want to trap the event that is raised he moment A user is logging-in.
    Have you ever encountered that function?
    thnx again

  4. #4
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    I Think you can do a simple program that sits in the SysTray and monitors the Connection. As Soon As The Connection Is Made(TRUE is returned) just Raise n Event. Hope you know Custom Event Declaration and Event Firing.

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