Window Status – Function 104
This function allows the application to query or change a session’s window size, location, or visible state, or to query a session’s window handle or font characteristics.
Prerequisite functions
Connect Window Services (function 101)
Function call
WinHLLAPI(WINDOWSTATUS,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String See the following tables.
Data Length NA (defaults to 16 or 20, depending on the status request).
PS Position NA
Return parameters
Parameter Description
Data String Set window status - a 16-byte string with the following format:
Byte 1 Short name session ID of the desired host session, or space or null for the current host session.
Byte 2 WHLL_WINDOWSTATUS_SET for set status.
Bytes 3-4 An integer containing the set values. The following are valid:
•  WHLL_WINDOWSTATUS_SIZE. Change the window size (not valid with minimize, maximize, restore, or move).
•  WHLL_WINDOWSTATUS_MOVE. Change the window x or y position (not valid with minimize, maximize, size, or restore).
•  WHLL_WINDOWSTATUS_ZORDER. Specifies window z-order placement.
•  WHLL_WINDOWSTATUS_SHOW. Set the window to visible.
•  WHLL_WINDOWSTATUS_HIDE. Set the window to invisible.
•  WHLL_WINDOWSTATUS_ACTIVATE. Activate the window. Use the _ZORDER placement if specified, otherwise set focus to the window and place it in the foreground.
•  WHLL_WINDOWSTATUS_DEACTIVATE. Deactivate the window. Use the _ZORDER placement if specified, otherwise place it in the background.
•  WHLL_WINDOWSTATUS_MINIMIZE. Set the window to minimized (not valid with maximize, restore, size, or move).
Set window status - a 16-byte string with the following format:
•  WHLL_WINDOWSTATUS_MAXIMIZE. Set the window to maximized (not valid with minimize, restore, size, or move).
•  WHLL_WINDOWSTATUS_RESTORE. Restore the window (not valid with maximize, minimize, size, or move).
Bytes 5-6 Specifies the x-coordinate of the upper-left corner of the window.
Bytes 7-8 Specifies the y-coordinate of the upper-left corner of the window.
Bytes 9-10 Specifies the width of the window.
Bytes 11-12 Specifies the height of the window.
Bytes 13-16 Specifies the z-order placement of the window (only valid for the set option when the _ZORDER option is specified). Valid values are:
•  WHLL_WINDOWSTATUS_FRONT. Place window in front.
•  WHLL_WINDOWSTATUS_BACK. Place window in back.
Query window status - a 16-byte string with the following format:
Byte 1 Short name session ID of the desired host session, or space or null for the current host session.
Byte 2 WHLL_WINDOWSTATUS_QUERY for query for status.
Bytes 3-4 An integer containing WHLL_WINDOWSTATUS_NULL. The following are possible return values. More than one status is possible:
•  WHLL_WINDOWSTATUS_SHOW. The window is visible.
•  WHLL_WINDOWSTATUS_HIDE. The window is invisible.
•  WHLL_WINDOWSTATUS_ACTIVATE. The window is activated.
•  WHLL_WINDOWSTATUS_DEACTIVATE. The window is deactivated.
•  WHLL_WINDOWSTATUS_MINIMIZE. The window is minimized.
•  WHLL_WINDOWSTATUS_MAXIMIZE. The window is maximized.
Bytes 5-6 Specifies the x-coordinate of the upper-left corner of the window.
Bytes 7-8 Specifies the y-coordinate of the upper-left corner of the window.
Bytes 9-10 Specifies the width of the window.
Bytes 11-12 Specifies the height of the window.
Bytes 13-16 Specifies the z-order placement of the window (only valid for the set option when the _ZORDER option is specified). Valid values are:
•  WHLL_WINDOWSTATUS_FRONT. Place window in front.
•  WHLL_WINDOWSTATUS_BACK. Place window in back.
Query extended window status - a 20-byte string with the following format:
Byte 1 Short name session ID of the desired host session, or space or null for the current host session.
Byte 2 WHLL_WINDOWSTATUS_EXTQUERY for query extended status.
Bytes 3-4 An integer containing WHLL_WINDOWSTATUS_NULL. The following are possible return values. More than one status is possible:
•  u WHLL_WINDOWSTATUS_SHOW. The window is visible.
•  WHLL_WINDOWSTATUS_HIDE. The window is invisible.
•  WHLL_WINDOWSTATUS_ACTIVATE. The window is activated.
•  WHLL_WINDOWSTATUS_DEACTIVATE. The window is deactivated.
•  WHLL_WINDOWSTATUS_MINIMIZE. The window is minimized.
•  WHLL_WINDOWSTATUS_MAXIMIZE. The window is maximized.
Bytes 5-6 Specifies the current font height. The size assumes a fixed-pitch font including any inter-column spacing (this value times the number of displayed columns should equal the width of the presentation space).
Bytes 7-8 Specifies the current font width. The size includes any inter-line spacing (this value times the number of displayed rows should equal the height of the presentation space).
Bytes 9-10 Specifies the distance from the left edge of the window to the first displayed column of the host screen, or zero if the host presentation space exactly fits the window.
Bytes 11-12 Specifies the distance from the top of the window to the first displayed row of the host screen, or zero if the host presentation space exactly fits the window.
Bytes 13-14 Specifies the number of the first visible row of the presentation space. This is normally one unless only a portion of the presentation space is visible in the window.
Bytes 15-16 Specifies the number of the first visible column of the presentation space. This is normally one unless only a portion of the presentation space is visible in the window.
Bytes 17-20 Specifies the window handle of the emulator session. For Win16 handles, only positions 17-18 are used.
Return code
Code Description
WHLLOK The function was successful.
WHLLNOTCONNECTED An invalid presentation space was specified, or was not connected for window services.
WHLLPARAMETERERROR An invalid option was specified.
WHLLSYSERROR The function failed due to a system error.
WHLLPSENDED The session stopped.
Remarks
All coordinate positions, screen sizes, offsets, and font sizes are in pixels. This function is not supported for 5250 emulation.
When resizing a window, the requested size and position may be slightly different then what was requested. Follow the set option with a query option to determine the final window position and size.