Jump to content

WinChangeSwitchEntry: Difference between revisions

From EDM2
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
;WinChangeSwitchEntry(switchHndl, switchControlStruct) : Modifies the specified entry in the task list.
Modifies the specified entry in the task list.


=== Parameters ===
==Syntax==
WinChangeSwitchEntry(switchHndl, switchControlStruct)
 
== Parameters ==
;switchHndl - [[HSWITCH]] - input : The task list switch handle.
;switchHndl - [[HSWITCH]] - input : The task list switch handle.
;switchControlStruct - [[SWCNTRL]] - input : Switch control data.
;switchControlStruct - [[SWCNTRL]] - input : Switch control data.


 
== Returns ==
=== Returns ===
[[ULONG]] with values of:
[[ULONG]] with values of:
; Zero : success
; Zero : success
; Non-zero : unsuccessful
; Non-zero : unsuccessful
[[WinGetLastError]] could return:
[[WinGetLastError]] could return:
* [[OS2 API:PMI:error#PMERR_INVALID_PARAMETERS|PMERR_INVALID_PARAMETERS]]
* [[PM Error Codes#PMERR_INVALID_PARAMETERS|PMERR_INVALID_PARAMETERS]]
* [[OS2 API:PMI:error#PMERR_INVALID_PROCESS_ID|PMERR_INVALID_PROCESS_ID]]
* [[PM Error Codes#PMERR_INVALID_PROCESS_ID|PMERR_INVALID_PROCESS_ID]]
* [[OS2 API:PMI:error#PMERR_INVALID_PROGRAM_TYPE|PMERR_INVALID_PROGRAM_TYPE]]
* [[PM Error Codes#PMERR_INVALID_PROGRAM_TYPE|PMERR_INVALID_PROGRAM_TYPE]]
* [[OS2 API:PMI:error#PMERR_INVALID_SESSION_ID|PMERR_INVALID_SESSION_ID]]
* [[PM Error Codes#PMERR_INVALID_SESSION_ID|PMERR_INVALID_SESSION_ID]]
* [[OS2 API:PMI:error#PMERR_INVALID_SWITCH_HANDLE|PMERR_INVALID_SWITCH_HANDLE]]
* [[PM Error Codes#PMERR_INVALID_SWITCH_HANDLE|PMERR_INVALID_SWITCH_HANDLE]]
* [[OS2 API:PMI:error#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]]
* [[PM Error Codes#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]]
* [[OS2 API:PMI:error#PMERR_NO_SPACE|PMERR_NO_SPACE]]
* [[PM Error Codes#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 Convention ===
== Calling Convention ==
[[Cdecl32]]
[[Cdecl32]]


=== Example Code ===
== Example Code ==
  HSWITCH switchHndl;
  HSWITCH switchHndl;
  SWCNTRL switchControlStruct;  
  SWCNTRL switchControlStruct;  
Line 33: Line 35:
  ...
  ...


=== Related Functions ===
== Related Functions ==
*[[WinAddSwitchEntry]]
*[[WinAddSwitchEntry]]
*[[WinCreateSwitchEntry]]
*[[WinCreateSwitchEntry]]
Line 40: Line 42:
*[[WinQueryWindowProcess]]
*[[WinQueryWindowProcess]]


=== Notes ===
== Notes ==
If the standard window was created with [[OS2 API:Constant:FCF#FCF_TASKLIST|FCF_TASKLIST]] it is not necessary to call WinChangeSwitchEntry; [[WinSetWindowText]], on its handle, changes the title bar and task list text.
If the standard window was created with FCF_TASKLIST it is not necessary to call WinChangeSwitchEntry; WinSetWindowText, on its handle, changes the title bar and task list text.


If you want to change a few fields, not many, it is advisable to initialize the switch control structure via [[WinQuerySwitchEntry]].  Then modify those fields and call '''WinChangeSwitchEntry''' for the update.
If you want to change a few fields, not many, it is advisable to initialize the switch control structure via [[WinQuerySwitchEntry]].  Then modify those fields and call '''WinChangeSwitchEntry''' for the update.


[[Category:Win]]
[[Category:Win]]

Latest revision as of 21:49, 6 August 2023

Modifies the specified entry in the task list.

Syntax

WinChangeSwitchEntry(switchHndl, switchControlStruct)

Parameters

switchHndl - HSWITCH - input
The task list switch handle.
switchControlStruct - SWCNTRL - input
Switch control data.

Returns

ULONG with values of:

Zero
success
Non-zero
unsuccessful

WinGetLastError could return:

Define (C/C++)

INCL_WINSWITCHLIST or INCL_WIN or INCL_PM

Calling Convention

Cdecl32

Example Code

HSWITCH switchHndl;
SWCNTRL switchControlStruct; 
ULONG   rc;
...
rc = WinChangeSwitchEntry(switchHndl, switchControlStruct);
...

Related Functions

Notes

If the standard window was created with FCF_TASKLIST it is not necessary to call WinChangeSwitchEntry; WinSetWindowText, on its handle, changes the title bar and task list text.

If you want to change a few fields, not many, it is advisable to initialize the switch control structure via WinQuerySwitchEntry. Then modify those fields and call WinChangeSwitchEntry for the update.