Lock Presentation Space API (60)

Top  Previous  Next

The Lock Presentation Space 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 to Presentation Space (1)

 

 

Call Parameters

 

 

Standard Interface

Enhanced Interface

Function Number

Must be 60

 

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 Presentation Space 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.

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:

Send Key (3)
Copy Presentation Space (5)
Search Presentation Space (6)
Copy Presentation Space to String (8)
Release (11)
Reserve (12)
Query Field Attribute (14)
Copy String to Presentation Space (15)
Search Field (30)
Find Field Position (31)
Find Field Length (32)
Copy String to Field (33)
Copy Field to String (34)
Set Cursor (40)
Send File (90)
Receive File (91)
Connect to Presentation Space (1) with the CONPHYS parameter set in a previous Set Sessions Parameter (9) function call.

 

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. EHLLAPI functions not listed are run as if there was no lock. The requesting application unlocks the presentation space window by one of the following methods:

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.
Successfully issuing the Lock Presentation Space API with the Unlock option.

 

Before exiting the application, you should unlock any presentation space windows that have been locked with the Lock Presentation Space API function. If the application exits with outstanding locks, or a Reset System (21), or Disconnect Presentation Space (2) function is issued, the locks are released.

 

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.