Start Close Intercept (41)

Top  Previous  Next

The Start Close Intercept function allows the application to intercept close requests generated when a user selects the close option from the emulator session window. This function intercepts the close request and discards it until a Stop Close Intercept (43) function is requested.

 

After using this function, your application program can use the Query Close Intercept (42) function to determine when a close request has occurred.

 

3270

5250

Yes

Yes

 

 

Prerequisite Calls

 

There are no prerequisite calls for this function.

 

 

Call Parameters

 

Byte

Definition

 

 

Standard Interface

Enhanced Interface

Function Number

Must be 41

 

Data String

See the following table

 

Length

5 or 6

Must be 12

PS Position

NA

 

 

The data string contains the following items.

 

Byte

 

Definition

Standard

Enhanced

 

1

1

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

 

2-4

Reserved.

4-5

 

The data in these positions is ignored by EHLLAPI. However, no error is caused if the migrating program has data in these positions. This data is accepted to provide compatibility with migrating applications.

6

5

Specify M to request asynchronous message mode (Windows only).

 

6-8

Reserved.

2-3

9-12

When M is specified in position 5 (6 for 16-bit), the window handle of the window that receives the message should be set. The message is a return value of RegisterWindowMessage (PCSHLL) (not equal 0).

 

 

Return Parameters

 

This function returns a data string and a return code.

 

Data String

 

If asynchronous message mode is not specified in position 5 (6 for standard interface) and the function is completed successfully, the following data string is returned.

 

Byte

 

Definition

Standard

Enhanced

 

1

1

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

 

2-8

Reserved.

 

9-12

4 byte value in which the event object address is returned by EHLLAPI. The application can wait for this event object. (32-bit only).

 

Data String

 

If M (asynchronous message mode) is specified in position 5 (6 for standard interface) and the function is completed successfully, the following data string is returned.

 

Byte

 

Definition

Standard

Enhanced

 

1

1

A 1-character presentation space short name (PSID)

 

2-8

Reserved

2-3

9-10

Task ID of asynchronous message mode

 

Note:

If a user selects the close option, an application window receives a message. The message is a return value of RegisterWindowMessage (PCSHLL). The wParam parameter will contain the Task ID returned by this function call. The HIWORD of the lParam parameter will contain the Return Code 26, which shows a close intercept occurred, and the LOWORD of the lParam parameter will contain the function number 41.

 

Return Code

 

The following codes are defined:

 

Return Code

Explanation

0

The Start Close Intercept function was successful.

1

An incorrect host presentation space was specified.

2

A parameter error occurred.

9

A system error occurred.

10

The function is not supported by the emulation program.

 

 

Remarks

 

1.The returned event object or semaphore is in a non-signaled state when the start request function returns. The event object is in the signaled state each time a close request occurs. To receive notification of multiple close request events, put the event object into the signaled state each time using SetEvent or the Query Close Intercept (42) function.
2.After using this function, your application program can use the Query Close Intercept (42) function to determine when a close request has occurred. The application can wait on the returned event object to determine when the event has occurred.
3.This is not an exclusive call. Multiple applications can request this function for the same short session ID.
4.If there are no applications intercepting close requests for a session, any subsequent close requests selected by the user from the emulator operations dialog result in a normal stop requested for that session.