Skip to content

Latest commit

 

History

History
128 lines (102 loc) · 3.69 KB

nf-mstask-itask-setapplicationname.md

File metadata and controls

128 lines (102 loc) · 3.69 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:mstask.ITask.SetApplicationName
ITask::SetApplicationName (mstask.h)
This method assigns a specific application to the current task.
ITask interface [Task Scheduler]
SetApplicationName method
ITask.SetApplicationName
ITask::SetApplicationName
SetApplicationName
SetApplicationName method [Task Scheduler]
SetApplicationName method [Task Scheduler]
ITask interface
_msb_itask_setapplicationname
mstask/ITask::SetApplicationName
taskschd.itask_setapplicationname
taskschd\itask_setapplicationname.htm
taskschd
0bec25a9-e653-48b5-be41-8f513169fc8c
12/05/2018
ITask interface [Task Scheduler],SetApplicationName method, ITask.SetApplicationName, ITask::SetApplicationName, SetApplicationName, SetApplicationName method [Task Scheduler], SetApplicationName method [Task Scheduler],ITask interface, _msb_itask_setapplicationname, mstask/ITask::SetApplicationName, taskschd.itask_setapplicationname
mstask.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Mstask.lib
Mstask.dll
Windows
Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95
19H1
ITask::SetApplicationName
mstask/ITask::SetApplicationName
c++
APIRef
kbSyntax
COM
Mstask.dll
ITask.SetApplicationName

ITask::SetApplicationName

-description

[[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.

-parameters

-param pwszApplicationName [in]

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.

-returns

The SetApplicationName method returns one of the following values.

Return code Description
S_OK
The operation was successful.
E_INVALIDARG
The arguments are not valid.
E_OUTOFMEMORY
Not enough memory is available.

-remarks

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.

Examples

For an example of how to set the application name, see C/C++ Code Example: Setting Application Name.

-see-also

GetApplicationName

ITask