Lock Window Services API (61)

Top  Previous  Next

The Lock Window Services API function allows the application to obtain or release exclusive control of the presentation space window over other Windows 32-bit applications. While locked, no other application can connect to the presentation space window.

 

Successful processing of this function with the Lock causes EHLLAPI presentation space window functions requested from other EHLLAPI applications to be queued until the requesting application unlocks the presentation space. Requests from the locking application are processed normally.

 

3270

5250

Yes

No

 

 

Prerequisite Calls

 

Connect Window Services (101)

 

 

Call Parameters

 

 

Standard Interface

Enhanced Interface

Function Number

Must be 61

 

Data String

See the following table.

 

Length

Must be 3

Must be 8

PS Position

NA

 

 

 

Data String Contents

 

 

Byte

 

Definition

Standard

Enhanced

 

1

1

A 1-character presentation space short name (PSID).

 

2-4

Reserved.

2

5

One of the following characters:

L to lock the API.
U to unlock the API.

3

6

One of the following characters:

R to return if the presentation space is already locked by an application.
Q to queue the Lock request if the presentation space is already locked by an application.

 

7-8

Reserved.

 

 

Return Parameters

 

Return Code

Explanation

0

The Lock Window Services API function was successful.

1

An incorrect host presentation space short session ID was specified or was not connected.

2

An error was made in specifying parameters.

9

A system error was encountered.

38

Requested function was not complete.

43

The API was already locked by another EHLLAPI application (on LOCK) or API not locked (on UNLOCK).

 

 

Remarks

 

The following EHLLAPI functions are queued when a lock is in effect:

Window Status (104)
Change Switch List Name (105)
Change PS Window Name (106)

 

These queued requests are not serviced until the lock is removed. When the lock is removed, the queued requests are processed in first-in-first-out (FIFO) order.

The requesting application unlocks the presentation space window by one of the following methods:

Successfully issuing the Lock Window Services API with the UNLOCK option.
Disconnecting from the presentation space while still owning the Lock.
Issuing the Reset System (21) function while still owning the Lock.
Stopping the application while still owning the Lock.
Stopping the session.

 

Before exiting the application, you should Unlock any presentation space windows that have been locked with the Lock Window Services API function. If the application exits with outstanding locks, the subsystem releases the locks.

 

It is recommended that applications lock the presentation space only for short periods of time and only when exclusive use of the presentation space is required.