Jump to content

WinAddSwitchEntry: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Line 9: Line 9:


=== Returns ===
=== Returns ===
[[OS2 API:DataType:HSWITCH|HSWITCH]] with values of:
[[HSWITCH]] with values of:
; The switch handle : succuss
; The switch handle : succuss
; [[OS2 API:DataType:NULLHANDLE|NULLHANDLE]] : unsuccessful
; [[OS2 API:DataType:NULLHANDLE|NULLHANDLE]] : unsuccessful
Line 20: Line 20:
* [[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]]
=== Module ===


=== Define (C/C++) ===
=== Define (C/C++) ===
INCL_WINSWITCHLIST or INCL_WIN or INCL_LIST
INCL_WINSWITCHLIST or INCL_WIN or INCL_LIST
=== Export name/Ordinal ===


=== Calling conversion ===
=== Calling conversion ===
Line 32: Line 28:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:SWCNTRL|SWCNTRL]] switchControlStruct;
  SWCNTRL switchControlStruct;
  [[OS2 API:DataType:HSWITCH|HSWITCH]] rc;
  HSWITCH rc;
  ...
  ...
  rc = WinAddSwitchEntry(switchControlStruct);
  rc = WinAddSwitchEntry(switchControlStruct);
Line 39: Line 35:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:WinCreateStdWindow|WinCreateStdWindow]]
*[[WinCreateStdWindow]]
[[OS2 API:WinCreateSwitchEntry|WinCreateSwitchEntry]]
*[[WinCreateSwitchEntry]]
[[OS2 API:WinQuerySwitchEntry|WinQuerySwitchEntry]]
*[[WinQuerySwitchEntry]]
[[OS2 API:WinQuerySwitchList|WinQuerySwitchList]]
*[[WinQuerySwitchList]]
[[OS2 API:WinQueryWindowProcess|WinQueryWindowProcess]]
*[[WinQueryWindowProcess]]
[[OS2 API:WinRemoveSwitchEntry|WinRemoveSwitchEntry]]
*[[WinRemoveSwitchEntry]]
[[OS2 API:WinSwitchToProgram|WinSwitchToProgram]]
*[[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 [[OS2_API:DatatType:SWCNTRL|SWCNTRL]].hwnd argument.
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 [[OS2 API:Constant:FCF#FCF_TASKLIST|FCF_TASKLIST]] flag you don't need to call [[OS2 API:WinAddSwitchEntry|WinAddSwitchEntry]] to add the text to the task list.  [[OS2_API:WinCreateStdWindow|WinCreateStdWindow]] updates the title bar text along with the task list text.  The frame will retain the [[OS2 API:Constant:FCF#FCF_TASKLIST|FCF_TASKLIST]] flag through the style [[OS2 API:Constant:FS#FS_TASKLIST|FS_TASKLIST]] with your call [[OS2 API:WinSetWindowText|WinSetWindowText]] on the frame window handle, which changes both the standard window title bar text and the task list text.
 
=== OS Version Introduced ===
 
 
 
[[OS2_API | Back to OS/2 API]]


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.


[[Category:The OS/2 API Project]]
[[Category:Win]]

Revision as of 16:02, 3 December 2016

WinAddSwitchEntry

WinAddSwitchEntry(switchControlStruct)
Add an entry to the task list.

Parameters

switchControlStruct - SWCNTRL - input
The switch control data structure which contains information about the entry.

Constants

None

Returns

HSWITCH with values of:

The switch handle
succuss
NULLHANDLE
unsuccessful

WinGetLastError could return:

Define (C/C++)

INCL_WINSWITCHLIST or INCL_WIN or INCL_LIST

Calling conversion

Cdecl32

Example Code

SWCNTRL switchControlStruct;
HSWITCH rc;
...
rc = WinAddSwitchEntry(switchControlStruct);
...

Related Functions

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.