Jump to content
Sign in to follow this  
frankito

Don't want to freeze my autoit Window

Recommended Posts

frankito

Hi

My problem is quite simple i guess.

I have just 1 form.

First action after form laucnhing is to download a large file.

But when script is downloading this files all other control are unreachable on my form (other button) till download is not finished.

How could i fix it ? (different thread for download ?)

Thanks

Share this post


Link to post
Share on other sites
Authenticity

Read InetGet function description. The last parameter specifies whether to wait until downloading is completed (0) or to return immediately and download in the background.

Share this post


Link to post
Share on other sites
frankito

thanks you very much for your answer, it works.

And now i got same question with another function "_INetSmtpMailCom"

I send a large file in the background using this function, but until it's not finished i can't do anything.

Basicaly i'll have the same problem with a couple of function, like a slow sqlite query, is there a way to start this function in a different thread to not freeze the window?

Share this post


Link to post
Share on other sites
Authenticity

Nope, these procedures are executed in your thread and not like InetGet which is executed in another thread. You can execute them in another process though, you can register your own message using _WinAPI_RegisterWindowMessage with your generated GUID or something and execute these tasks in another process and when the other processes finished their execution they can broadcast this message to your window to notify about the results. Much like process communication. If you require to share information which may be based on pointer like strings or structures, you should look into $WM_COPYDATA. Search the example forums.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.