WinCreateSwitchEntry: Difference between revisions
Appearance
m Martini moved page OS2 API:WinCreateSwitchEntry to OS2 API:PMI:WinCreateSwitchEntry |
mNo edit summary |
||
Line 1: | Line 1: | ||
; WinCreateSwitchEntry(anchorBlockHndl, switchControlStruct) : Add the entry into the task list. | ; WinCreateSwitchEntry(anchorBlockHndl, switchControlStruct) : Add the entry into the task list. | ||
=== Parameters === | === Parameters === | ||
; anchorBlockHndl - [[ | ; anchorBlockHndl - [[HAB]] - input : The anchor block handle. | ||
; switchControlStruct - [[ | ; switchControlStruct - [[SWCNTRL]] - input : The switch control structure contains information about the newly created task list entry. | ||
=== Returns === | === Returns === | ||
[[ | [[HSWITCH]] with values of: | ||
; The switch handle : succuss | ; The switch handle : succuss | ||
; [[ | ; [[NULLHANDLE]] : unsuccessful | ||
[[ | [[WinGetLastError]] could return: | ||
* [[OS2 API:PMI:error#PMERR_INVALID_PARAMETERS|PMERR_INVALID_PARAMETERS]] | * [[OS2 API:PMI:error#PMERR_INVALID_PARAMETERS|PMERR_INVALID_PARAMETERS]] | ||
* [[OS2 API:PMI:error#PMERR_INVALID_PROCESS_ID|PMERR_INVALID_PROCESS_ID]] | * [[OS2 API:PMI:error#PMERR_INVALID_PROCESS_ID|PMERR_INVALID_PROCESS_ID]] | ||
Line 22: | Line 18: | ||
* [[OS2 API:PMI:error#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]] | * [[OS2 API:PMI:error#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]] | ||
* [[OS2 API:PMI:error#PMERR_NO_SPACE|PMERR_NO_SPACE]] | * [[OS2 API:PMI:error#PMERR_NO_SPACE|PMERR_NO_SPACE]] | ||
=== Define (C/C++) === | === Define (C/C++) === | ||
INCL_WINSWITCHLIST or INCL_WIN or INCL_PM | INCL_WINSWITCHLIST or INCL_WIN or INCL_PM | ||
=== Calling conversion === | === Calling conversion === | ||
Line 34: | Line 26: | ||
=== Example Code === | === Example Code === | ||
HAB anchorBlockHndl; | |||
SWCNTRL switchControlStruct; | |||
HSWITCH rc; | |||
... | ... | ||
rc = WinCreateSwitchEntry(anchorBlockHndl, switchControlStruct); | rc = WinCreateSwitchEntry(anchorBlockHndl, switchControlStruct); | ||
Line 42: | Line 34: | ||
=== Related Functions === | === Related Functions === | ||
[[ | *[[WinAddSwitchEntry]] | ||
[[ | *[[WinQuerySwitchEntry]] | ||
[[ | *[[WinQuerySwitchList]] | ||
[[ | *[[WinQueryWindowProcess]] | ||
[[ | *[[WinRemoveSwitchEntry]] | ||
[[ | *[[WinSwitchToProgram]] | ||
=== Notes === | === Notes === | ||
Typically, programs add their main window's title to the task list but not the secondary windows. Programs normally specify a frame window handle as the [[ | Typically, programs add their main window's title to the task list but not the secondary windows. Programs normally specify a frame window handle as the [[SWCNTRL]].hwnd argument. | ||
Should you create a standard window with the [[FCF#FCF_TASKLIST|FCF_TASKLIST]] flag you don't need to call [[WinAddSwitchEntry]] to add the text to the task list. [[WinCreateStdWindow]] updates the title bar text along with the task list text. The frame will retain the [[FCF#FCF_TASKLIST|FCF_TASKLIST]] flag through the style [[FS#FS_TASKLIST|FS_TASKLIST]] with your call [[WinSetWindowText]] on the frame window handle, which changes both the standard window title bar text and the task list text. | |||
[[Category: | [[Category:Win]] |
Revision as of 19:36, 22 December 2016
- WinCreateSwitchEntry(anchorBlockHndl, switchControlStruct)
- Add the entry into the task list.
Parameters
- anchorBlockHndl - HAB - input
- The anchor block handle.
- switchControlStruct - SWCNTRL - input
- The switch control structure contains information about the newly created task list entry.
Returns
HSWITCH with values of:
- The switch handle
- succuss
- NULLHANDLE
- unsuccessful
WinGetLastError could return:
- PMERR_INVALID_PARAMETERS
- PMERR_INVALID_PROCESS_ID
- PMERR_INVALID_PROGRAM_TYPE
- PMERR_INVALID_SESSION_ID
- PMERR_INVALID_SWITCH_HANDLE
- PMERR_INVALID_WINDOW
- PMERR_NO_SPACE
Define (C/C++)
INCL_WINSWITCHLIST or INCL_WIN or INCL_PM
Calling conversion
Example Code
HAB anchorBlockHndl; SWCNTRL switchControlStruct; HSWITCH rc; ... rc = WinCreateSwitchEntry(anchorBlockHndl, switchControlStruct); ...
Related Functions
- WinAddSwitchEntry
- WinQuerySwitchEntry
- WinQuerySwitchList
- WinQueryWindowProcess
- WinRemoveSwitchEntry
- WinSwitchToProgram
Notes
Typically, programs add their main window's title to the task list but not the secondary windows. Programs normally specify a frame window handle as the SWCNTRL.hwnd argument.
Should you create a standard window with the FCF_TASKLIST flag you don't need to call WinAddSwitchEntry to add the text to the task list. WinCreateStdWindow updates the title bar text along with the task list text. The frame will retain the FCF_TASKLIST flag through the style FS_TASKLIST with your call WinSetWindowText on the frame window handle, which changes both the standard window title bar text and the task list text.