CMFCTasksPaneTask Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CMFCTasksPaneTask Class.

The CMFCTasksPaneTask class is a helper class that represents tasks for the task pane control ( CMFCTasksPane). The task object represents an item in the task group ( CMFCTasksPaneTaskGroup). Each task can have a command that the framework executes when a user clicks on the task and an icon that appears to the left of the task name.

Syntax

class CMFCTasksPaneTask : public CObject  

Members

Public Constructors

Name Description
CMFCTasksPaneTask::CMFCTasksPaneTask Creates and initializes a CMFCTasksPaneTask object.
CMFCTasksPaneTask::~CMFCTasksPaneTask Destructor.

Public Methods

Name Description
CMFCTasksPaneTask::SetACCData Determines the accessibility data for the current task.

Data Members

Name Description
CMFCTasksPaneTask::m_bAutoDestroyWindow Determines whether the task window is automatically destroyed.
CMFCTasksPaneTask::m_bIsBold Determines whether the framework draws a task label in bold text.
CMFCTasksPaneTask::m_dwUserData Contains user-defined data that the framework associates with the task. Set to zero if the task has no associated data.
CMFCTasksPaneTask::m_hwndTask A handle to the task window.
CMFCTasksPaneTask::m_nIcon The index in the image list of the image that the framework displays next to the task.
CMFCTasksPaneTask::m_nWindowHeight The height of the task window. If the task has no task window, this value is zero.
CMFCTasksPaneTask::m_pGroup A pointer to the CMFCTasksPaneTaskGroup that this task belongs to.
CMFCTasksPaneTask::m_rect Specifies the bounding rectangle of the task.
CMFCTasksPaneTask::m_strName The name of the task.
CMFCTasksPaneTask::m_uiCommandID Specifies the command ID of the command that the framework executes when the user clicks the task. If this value is not a valid command ID, the task is treated as a simple label.

Remarks

The following illustration shows a task group that contains three tasks:

Task group, expanded

Note

If a task does not have a valid command ID, it is treated as a simple label.

Inheritance Hierarchy

CObject

CMFCTasksPaneTask

Requirements

Header: afxTasksPane.h

CMFCTasksPaneTask::CMFCTasksPaneTask

Creates and initializes a CMFCTasksPaneTask object.

CMFCTasksPaneTask(
    CMFCTasksPaneTaskGroup* pGroup,  
    LPCTSTR lpszName,  
    int nIcon,  
    UINT uiCommandID,  
    DWORD dwUserData = 0,  
    HWND hwndTask = NULL,  
    BOOL bAutoDestroyWindow = FALSE,  
    int nWindowHeight = 0);

Parameters

pGroup
Specifies the CMFCTasksPaneTaskGroup to which the task belongs.

lpszName
Specifies the name of the task.

nIcon
Specifies the index of the task's image in the image list.

uiCommandID
Specifies the command ID of the command that is executed when the task is clicked.

dwUserData
User-defined data.

hwndTask
Specifies the handle to the task window.

bAutoDestroyWindow
If TRUE, the task window will be destroyed automatically.

nWindowHeight
Specifies the height of the task window.

Remarks

CMFCTasksPaneTask::m_bAutoDestroyWindow

Determines whether the task window is automatically destroyed.

BOOL m_bAutoDestroyWindow;  

Remarks

Set to TRUE to specify that the task window ( CMFCTasksPaneTask::m_hwndTask) should be destroyed automatically; otherwise, FALSE.

CMFCTasksPaneTask::m_bIsBold

Determines whether a task label is drawn in bold text.

BOOL m_bIsBold;  

Remarks

Set this member to TRUE to display bold text for the task label.

CMFCTasksPaneTask::m_dwUserData

Contains user-defined data that is associated with the task. Set to zero if no data is associated with the task.

DWORD m_dwUserData;  

Remarks

CMFCTasksPaneTask::m_hwndTask

A handle to the task window.

HWND m_hwndTask;  

Remarks

To add a task window, call CMFCTasksPane::AddWindow.

CMFCTasksPaneTask::m_nIcon

The index position in an image list that identifies an image that is displayed next to the specified task.

int m_nIcon;  

Remarks

The image list is set by CMFCTasksPane::SetIconsList.

Set m_nIcon to -1 if you want to display the task without an image.

CMFCTasksPaneTask::m_nWindowHeight

The height of the task window. If the task has no task window, this value is zero.

int m_nWindowHeight;  

Remarks

CMFCTasksPaneTask::m_pGroup

Pointer to the CMFCTasksPaneTaskGroup to which this task belongs.

CMFCTasksPaneTaskGroup* m_pGroup;  

Remarks

Every task must have a parent group. You add groups to a task pane by calling CMFCTasksPane::AddGroup.

CMFCTasksPaneTask::m_rect

Specifies the bounding rectangle of the task.

CRect m_rect;  

Remarks

This value is calculated by the framework when the task is drawn.

CMFCTasksPaneTask::m_strName

The name of the task.

CString m_strName;  

Remarks

CMFCTasksPaneTask::m_uiCommandID

Specifies the command ID of the command that is executed when the user clicks the task. If this value is not a valid command ID, the task is treated as a simple label.

UINT m_uiCommandID;  

Remarks

CMFCTasksPaneTask::SetACCData

Determines the accessibility data for the current task.

virtual BOOL SetACCData(
    CWnd* pParent,  
    CAccessibilityData& data);

Parameters

[in] pParent
Represents the parent window of the current task.

[out] data
An object of type CAccessibilityData that is populated with the accessibility data of the current task.

Return Value

TRUE if the data parameter was successfully populated with the accessibility data of the current task; otherwise, FALSE.

See Also

Hierarchy Chart
Classes
CObject Class