GetWindowTask

2.x

  HTASK GetWindowTask(hwnd)    
  HWND hwnd; /* handle of window, */  

The GetWindowTask function searches for the handle of a task associated with a window. A task is any program that executes as an independent unit. All applications are executed as tasks. Each instance of an application is a task.

Parameters

hwnd

Identifies the window for which to retrieve a task handle.

Return Value

The return value is the handle of the task associated with a particular window, if the function is successful. Otherwise, it is NULL.

See Also

EnumTaskWindows, GetCurrentTask