npTask plugin

About this plugin

This plugin allow you to use the Windows Vista (and above) task dialog control, that can be used to display information and receive simple input from the user.

Like a message box, it is formatted by the operating system according to parameters you set. However, a task dialog has many more features than a message box.

The plugin allow you to create many instances of task dialogs, control them with lots of events, customize with dozens of options, buttons, radios, etc., etc.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npTaskCreate

Create a new instance of an Task dialog object. The result variable store the ID of the created object instance, wich can be used on other plugin actions.

↑↑

npTaskDestroy

Destroy a previously created instanace of an Task dialog object. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error.

↑↑

npTaskDestroyAll

Destroy all previously created instances of Task dialog objects.

↑↑

npTaskExecute

Execute or in other words show the Task dialog and get the their modal result when its closed. The result variable store the numeric modal result of the dialog, corresponding to the button that close the dialog, or "False" when not. On this last case the [LastError] contain information about the possible error.

When you add custom buttons to the task dialogs, you can choose what modal result the button store when is pressed. For the case of the common task dialog buttons here is the possible numeric values:

Note when the user close the dialog using the dialog window close button (if you show it) the modal result is the same that "tcbCancel", that is 2.

↑↑

npTaskAddRadio

Add a new custom radio button to a Task dialog object instance. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error.

↑↑

npTaskAddButton

Add a new custom button to a Task dialog object instance. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error.

Note you can use this action also to updated previously added buttons properties. Just use the same button caption used when you add the button so this action update the existing button properties instead of create a new one.

↑↑

npTaskFlags

Specify flags options of a Task dialog object instance. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The possible flags options is explained here:

↑↑

npTaskIcons

Specify icons options of a Task dialog object instance. Supported are ICO (.ico) files. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error.

You can specify a common system icon (or none) for both main and footer icons, using one of the following values:

Also is possible to you specify custom icons from both main and footer icons. You need to provide the path of the icon files and set "tfUseHiconMain" and "tfUseHiconFooter" flags on npTaskFlags.

↑↑

npTaskTexts

Specify texts options of a Task dialog object instance. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error.

Remember: if you set the flag "tfEnableHyperlinks" on npTaskFlags you can add hyperlinks on text, footer, and expanded texts.

↑↑

npTaskButtons

Specify common buttons options of a Task dialog object instance. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error.

You can specify one or more of the following values: tcbOk, tcbYes, tcbNo, tcbCancel, tcbRetry, tcbClose. On the this values can also be used to the "default button" variable.

↑↑

npTaskProgress

Specify the progress bar options of a Task dialog object instance. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error.

↑↑

npOnTaskTimer

Set a subroutine to be executed when a Task dialog timer event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event.

To use this event you need to set the flag "tfCallbackTimer" on npTaskFlags. The event is fired every 200 milliseconds, and you receive the "Tickcount" of the timer, and can reset the counter set the Reset variable to "True".

↑↑

npOnTaskExpanded

Set a subroutine to be executed when a Task dialog expanded event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event. The Is Expanded variable store "True" if the dialog is expanded when the event is fired, or "False" if the dialog is not expanded at this time.

↑↑

npOnTaskProgress

Set a subroutine to be executed when a Task dialog progress event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event.

To use this event you need to set the flag "tfCallbackTimer" and "tfShowProgressBar" on npTaskFlags. If you need can use the action npTaskProgress in order to update the progress bar position and other properties.

↑↑

npOnTaskRadio

Set a subroutine to be executed when a Task dialog radio button clicked event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event.

The Radio ID variable store the ID of the selected radio button. This ID is the zero index of the radio button, so for the first button the Radio ID is zero, the second button have the Radio ID 1, the third button the ID 2 and so on.

↑↑

npOnTaskButton

Set a subroutine to be executed when a Task dialog button clicked event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event.

The Modal Result variable store the modal result of the pressed button. The Can Close variable can be set to "False" if you want that the dialog are not closed once the button is pressed. If the Can Close variable is ignored or set to "True" the dialog is closed.

↑↑

npOnTaskCreated

Set a subroutine to be executed when a Task dialog created event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event.

↑↑

npOnTaskDestroyed

Set a subroutine to be executed when a Task dialog destroyed event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event.

↑↑

npOnTaskConstructed

Set a subroutine to be executed when a Task dialog constructed event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event.

↑↑

Set a subroutine to be executed when a Task dialog hyperlink clicked event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event. The URL variable store the URL of the hyperlink that is clicked.

↑↑

npOnTaskVerification

Set a subroutine to be executed when a Task dialog verification checkbox clicked event is fired. The result variable store "True" if everything is OK, or "False" when not. On this last case the [LastError] contain information about the possible error. The Instance ID variable store the ID of the task dialog object that launch the event. The Is Checked variable store "True" if the dialog verification checkbox is checked, or "False" if not.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑