Enable
Synchronization function.
The Enable function reactivates the management of a specified event. Not available in WinTask Lite.
Syntax
Enable(<Id_action>)
Parameter
<Id-action>, event to be reactivated.
See also
Example code
This example shows how an event can be enabled using the Enable command; the event is defined by the OnAction command, this event is the selection of the option Close in the Explorer menu.
Sub close()
Disable(wait_for_close_menu)
res=msgbox("Would you like to close the message box? ",4,"EXAMPLE")
if res=6 then
' if res=6 WinTask closes Explorer and stops the script
CloseWindow("EXPLORER.EXE|ExploreWClass|My Documents",2)
stop
endif
Enable(wait_for_close_menu)
EndSub
OnAction wait_for_close_menu
Menu("File|&Close")
InWindow("EXPLORER.EXE|ExploreWClass|My Documents",2)
DoSub close
EndAction
shell("explorer")
' Definition of the event, each time the user selects the option Close in the Explorer menu File,
' the script runs the procedure close().
sleep()
'leaves the management of the random events active.'leaves the management of the random events active.