Announcement

Collapse
No announcement yet.

Getting rid of the Dial up Window in a LAN.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Getting rid of the Dial up Window in a LAN.

    I finally got rid of that pesky dial up window when I don't need it.

    If you're on a LAN and you need to access another (or even your own) computer by TCP/IP, Win95 will trigger a name resolution broadcast. This in turn will cause the dial up window to appear, even if the computer is on your LAN. I've tried everything to change this behaviour of Win95 (and probably Win98) but apparently it's not possible to make this work the right way. In Windows NT you don't need this because it can be set to behave correctly.


    I finally decided to trick windows and temporarily change the registry setting that says "Connect to the Internet as needed" (or whatever the English text is).

    This is how you can accomplish this:

    Open key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

    read the value "EnableAutoDial" (%REG_BINARY)

    If the value is 1, write a 0 into it and remember to write the 1 back after the host name resolution function.

    Get the host name (the name resolution broadcast won't trigger the dial up window).

    If the original registry value was 1, restore it.

    That's it, no more dial up windows when you don't need them.

    I don't have sample code for you but this isn't too difficult to program. It works for me.


    Peter.
    [email protected]

    #2
    Can anyone else confirm this solution works, and if possible, that it works on other versions of Win32 too? If so, I'll make it into a "FAQ". Thanks!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


      #3
      Here's some code that works.
      Most would use something like TCP OPEN instead of the cconnect line.
      Don't use the Registry functions posted recently in the source forum without changing because they can only handle Asciiz keys, not binary.

      Code:
                        zkey1 = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
                        zkey2 = "EnableAutoDial"
                        'Binary value: "EnableAutoDial"
                        dType = %REG_BINARY
                        AutoDial = GetRegistryValue(%HKEY_CURRENT_USER, dType, zkey1, zkey2, "")
                        dType = %REG_BINARY
                        IF LEN(AutoDial) THEN
                          SetRegistryValue %HKEY_CURRENT_USER, dType, zkey1, zkey2, MKL$(0)
                        END IF
                        i = cconnect(cli_sock, BYVAL VARPTR(srv_addr), SIZEOF(srv_addr))
                        IF LEN(AutoDial) THEN
                          IF ASC(AutoDial) <> 0 THEN
                            SetRegistryValue %HKEY_CURRENT_USER, dType, zkey1, zkey2, MKL$(1)
                          END IF
                        END IF
                        IF i = %SOCKET_ERROR THEN
                          'error code here, else connect was succesfull

      Hope this of some use.

      Peter.



      ------------------
      [email protected]

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎