ITask::SetApplicationName method (mstask.h)
[[This API may be altered or unavailable in subsequent versions of the operating system or product. Please use the Task Scheduler 2.0 Interfaces instead.] ]
This method assigns a specific application to the current task.
HRESULT SetApplicationName( LPCWSTR pwszApplicationName );
A null-terminated string that contains the name of the application that will be associated with the task. Use an empty string to clear the application name.
The SetApplicationName method returns one of the following values.
||The operation was successful.|
||The arguments are not valid.|
||Not enough memory is available.|
If you do not specify a path for the application, the Task Scheduler searches the environment path to find the correct path. If the application name specifies a program, the name should use the .exe extension to ensure that the Task Scheduler user interface properly displays the application's icon.
After calling SetApplicationName, make sure you call IPersistFile::Save to save the modified task to disk.
For an example of how to set the application name, see C/C++ Code Example: Setting Application Name.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Redistributable||Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95|