Sign in to follow this  
Followers 0
Emiel Wieldraaijer

Run a Function in the Background

9 posts in this topic

#1 ·  Posted (edited)

HI All,

This is my first post on this forum so please be gentle :whistle:

I'm also new to AutoIT/Programming and i've got a little problem

I'm call a Func which Loops... to check if a connection is persistent..

But this will disable the other functions in the GUI so i'm not able to disconnect

Is there a way to call a function in the background ?

TIA

Emiel

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites



You've already got a loop going for the GUI, presumably. Check the state just once in the function, and call the function in the GUI loop.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

@lod3n

Thnx for the reply .. i get your point .. and i had a look at the code .. but the only loop is the one which checks the tray

Emiel


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

GUIGetMsg()?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

@AzKay

Do you mean i can resolve it by using GuiGetMessage just like the tray menu ?

Thnx


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

The proper way to do this is called "GUIOnEventMode" the functions that are used with this special mode are called "GUICtrlSetOnEvent" and "GUISetOnEvent".

Edit: I should also say, that you don't run the function in the background, but you run the GUI in the background and should put your function in the main loop. :]

Edited by Manadar

Share this post


Link to post
Share on other sites

@Manadar

Thnx very much (=dankjewel in Dutch).. i'll try to figure it out


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

@All

Sorry but all you GURU's were wrong

Because i couldn't get it working i thought lets spend a lot of time by reading every item in the Help File

I was lucky

The function for running a function in the background exists

Start a Background Function => AdlibEnable ( "function" [, time] )

End a Background Function => AdlibDisable ( )

Thanks for your time

Emiel


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

Because i couldn't get it working i thought lets spend a lot of time by reading every item in the Help File

That is fantastic news! Also, it's good you solved your problem.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

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  
Followers 0