Jump to content
Sign in to follow this  
FiNAlzFiNAle

_INetGetSource delay

Recommended Posts

FiNAlzFiNAle

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

Share this post


Link to post
Share on other sites
Rick

$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!!

Share this post


Link to post
Share on other sites
FiNAlzFiNAle

$IsCon=DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0)

IF $IsCon[0] = 0 then

; is not connected

else

; is connected

endif

Thank 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.

Share this post


Link to post
Share on other sites
herewasplato

...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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
FiNAlzFiNAle

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.

Share this post


Link to post
Share on other sites
Rick

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 by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites
FiNAlzFiNAle

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?

Share this post


Link to post
Share on other sites
herewasplato

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×