FiNAlzFiNAle Posted May 13, 2007 Share Posted May 13, 2007 Hi all, When I use _INetGetSource my firewall will pop-up with a message asking whether to Allow or Block the attempt to connect to the Internet. If I leave the firewall message untouched, then my AutoIt script will just hang. Only until I acknowledge the firewall message then the script responses. I would like to know if there are other methods to use to check Internet connectivity (preferably without using Ping) or is there a way to avoid such a problem. I have tried using AdlibEnable to monitor my script, but it appears that Adlib does not function while AutoIt is executing _INetGetSource. Thanks Link to comment Share on other sites More sharing options...
Rick Posted May 13, 2007 Share Posted May 13, 2007 $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) IF $IsCon[0] = 0 then ; is not connected else ; is connected endif Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
FiNAlzFiNAle Posted May 13, 2007 Author Share Posted May 13, 2007 $IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) IF $IsCon[0] = 0 then ; is not connected else ; is connected endifThank you for your reply. What I would like my script to do is to attempt to connect to the Internet. If it is successful, then continue with the next part, which is to download some data from the Internet. This first attempt to connect will let the user know that my script is going to access the Internet, and let him allow it from his firewall. However, InternetGetConnectedState does not connect to the Internet. And since it does not do that, no firewall alerts will be issued to the user. Link to comment Share on other sites More sharing options...
herewasplato Posted May 13, 2007 Share Posted May 13, 2007 (edited) ...When I use _INetGetSource my firewall will pop-up with a message asking whether to Allow or Block the attempt to connect to the Internet...One option would be to add the script to the list of applications that are allowed to connect to the Net in whatever firewall app you use. Failing that, you can have your main script launch a child script as illustrated here: http://www.autoitscript.com/forum/index.ph...st&p=156488 The "child" can deal with the Firewall windows as desired.-MSP- Edited May 13, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
FiNAlzFiNAle Posted May 13, 2007 Author Share Posted May 13, 2007 One option would be to add the script to the list of applications that are allowed to connect to the Net in whatever firewall app you use.Hm .. yes I could do that, but the users of my script might not.I'd prefer if there was a method to prevent the script from freezing up when _INetGetSource is used. And the strange thing here is that Adlib functions dont work. Link to comment Share on other sites More sharing options...
Rick Posted May 13, 2007 Share Posted May 13, 2007 (edited) I dont think you have any choice as the purpose of the firewall is to allow/deny access of a program to the users machine, otherwise it wouldnt be doing its job. Unless its the windows firewall they're using then its easy to give it permission to allow the program to access the internet (providing they are of the Administrators group). Edited May 13, 2007 by Rick Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
FiNAlzFiNAle Posted May 14, 2007 Author Share Posted May 14, 2007 I understand. But is there anyway that I can continue to offer an interactive GUI while the _INetGetSource is performing its task, and not freeze up the whole script? Link to comment Share on other sites More sharing options...
herewasplato Posted May 15, 2007 Share Posted May 15, 2007 Hm .. yes I could do that, but the users of my script might not...You have your script add itself to the list of allowed apps - but that is probably only good for the Windows firewall. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now