GUI ScreenIO for Windows

 ScreenIO.com


Window Position (and Z-Order) API

This API is not normally needed for GUI ScreenIO applications but is intended for specialized situations or interactions with other applications. 

This API is a wrapper around Microsoft's SetWindowPosition system call, with enough protection built in to preserve the integrity of GUI ScreenIO. We do not provide all functionality and we place limitation on which operations we will honor and which windows you can manipulate with this API. 

The term Window used herein means a panel, popup, property sheet or even the windows of other applications. 

This API is useful for moving windows and setting the Z-Order, (layering) of windows (Both GUI ScreenIO windows and any other window for which you have the Hwnd.  (Window Handle). 

We prevent the resizing of windows because this is not supported in GUI ScreenIO in most instances. 

You must call this function with the Hwnd of the panel you wish to operate upon. We supply the hwnd of each panel in the Panel-1 argument of the copybook. Operations on base panels is treated as if you had supplied the Hwnd of the main container.  

Client/Server issues

This API will only run on the Client side in a client server environment.

Note

GUI ScreenIO usually sets its main (container) window to Top Most.  This makes it appear above all other windows when the application is launched and stay above other windows (except those that also have Top-Most set).  There are times when you want to call another application (such as a web browser or email client for example) from GUI ScreenIO.  In this case, it may be desirable to set GUI ScreenIO's window to be Not the topmost, or perhaps, even set it to the bottom. 

If you can obtain the hwnd of the other application's main window you can cause GUI ScreenIO to set its Z-Order such that it will be placed immediately below that application.  However its often impractical to obtain another window's hwnd.

Even without knowledge of the hwnd of another application, you can adjust the Z order of GUI ScreenIO's window  by selecting one of the pre-defined 88 values in the copy book.  These are Bottom, Not Topmost, Top, or Topmost.   Of these, most are self explanatory.  Topmost differs from Top in that Topmost persists until you change it.  Top is fleeting at best, because any other application can overlay top, but not Topmost.  You will find that most windows applications use topmost, which causes them to be on top when focused, and only surrender their top position to other topmost windows.

When you set the WINPOS-X and Y variables both to zero, GUI ScreenIO will not move the window.  These values can be set to move windows.  You will have to experiment with values for this.

If you use this to change the Z-Order of GUI ScreenIO to launch other applications, we recommend you set it back to Topmost when the other application is no longer in use.  Otherwise, your application may disappear under others.

Files

Files available to copy to your system:

Usage

     COPY WIN32API.
     COPY BITOPS.


     
* ------------------------: Call the FUNCTION.

*                         : Move GUI ScreenIO below other windows

           SET WINPOS-HWND-BOTTOM TO TRUE

           MOVE ZERO TO WINPOS-X WINPOS-Y
           SET API-WINSOW-POSITION TO TRUE
           CALL 'GSWINAPI' USING WIN32API-PARMS
                                 WINDOWS-POSITION-PARMS
                                 WIN32API-B
                                 WIN32API-C
                                 WIN32API-D
                                 WIN32API-E
                                 WIN32API-F.

 

Parameters specific to this function

WINPOS-HWND 

This is the HWND of the window you want to adjust (move, or change the Z-Order).  It can be an HWND of a non GUI ScreenIO window if you find some way to obtain it and if your application is launched with the prerequisite permissions.  Normally, this is the HWND of the main (container), but we also allow you to use the HWND of the current Base panel as a surrogate for the main so that you do not need access to the main copybook from everywhere.  If you use the Hwnd from a popup, you could push the popup under the main, making it hard for users to find the active pane.

WINPOS-HWND-OTHER 

If this field is loaded with the HWND of another window, your GUI ScreenIO window will be appear to be layered immediately BELOW that window. Note that Below does not mean behind, simply lower in the Z order.  When windows are side by side nothing will appear to change.  However, stacked (overplayed) windows will appear to move behind other windows if you change the Z order.

If this field is one of the pre-defined 88s the GUI ScreenIO window's Z order layer will be set according to that value.

WINPOS-HWND-BOTTOM Places the window in the bottom of the Z order, "under" all other windows.  If the window previously had the TOPMOST status set  (normally a persistent status) it will lose that status.

WINPOS-HWND-NOTTOPMOST Places the window behind all TOPMOST windows, but above all other windows.

WINPOS-HWND-TOP Places the window at the top of the Z order.

WINPOS-HWND-TOPMOST Places the window at the top of the Z order and gives it persistent topmost status.  From then on, it can only be overplayed by other topmost windows.  Most windows applications run with this status.

WINPOS-X

Specified the screen coordinate (left to right) to which you want the window moved.

WINPOS-Y

Specified the screen coordinates (top to bottom) to which you want the window moved.

(Note:  There are other, simpler ways to move a GUI ScreenIO window.  See the X-POSITION and Y-POSITION values in the copybook for each panel).

WIN32API-PARMS - Used in all GSWINAPI calls

This argument is standard for all Calls to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success. 

WIN32API-ERROR-CODE

unused.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.  The only failure reason is bit count of zero.

WIN32API-A through WIN32API-F

The number of these present varies depending on how many arguments are used by the desired function.  These are not used, but must be present because this CALL requires seven arguments.


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom