Click to See Complete Forum and Search --> : Newbie in need!!! Please Help!!! Just 2 easy questions...


Thunda
February 12th, 2000, 06:25 AM
Hi I have 2 questions for you professionals,

1) How do I make it so that the user can't shut down my program, or so that it loads back up as soon as it is closed?

2) How do I get my program to display the Connect To box when you load it, like when you load internet explorer or netscape, it displays that connect to box if your not already connected to the internet, how do I get that menu to come up?

Please Help Me!!!

Lothar Haensler
February 14th, 2000, 01:30 AM
in order to not allow the user to close your program, you can set the Cancel argument to True, when trapping the QueryUnload event for your main form window.

CyberWorks
March 24th, 2000, 12:22 AM
That will work unless the user terminates the program from the taskmanager. In an extreme case when you want to keep it open (which you wouldn't normally do) you could have another ActiveX exe program running that checked to see if your app is running with the FindWindow api. There are other api's you can use as long as you know the windows handle. You get get that from the findwindow api.
Then open the app again with the shell command after its closed. When you attempt this be wary about how you are going to safely shutdown your computer.

In answer to your second question:
You can run this
Dim rs
rs = Shell("rundll32.exe rnaui.dll,RnaDial " & "Name of connection", 1)
If you want to find out the active connection its in the registry but varies between NT and 95/98. There is also an API for this.

Private Declare Function RasEnumConnections Lib "rasapi32.dll" Alias "RasEnumConnectionsA" (lpRasConn As Any, lpcb As Long, lpcConnections As Long) As Long

The functions to use the apis are get slighty large so if you need more help email me @xxxCyber@paradise.net.nz - Remove the @xxx from the email addres..(for anti spam purposes)