Window problem

RayMcManus

New Member
Hi,

I was wondering if there's a way that I can make a normal Progress window act like a dialog box, where it doesn't let you click outside of the box. It doesn't seem to work right as a dialog box, but I need it to stay in front of all of the other screens.
 

Chris Kelleher

Administrator
Staff member
This code will keep the current window on top of all the others, so it acts sort of like a dialog box:

Code:
DEFINE VARIABLE result-code AS INTEGER NO-UNDO.

/* Make the CURRENT-WINDOW topmost. (Also, make it
   small so it won't cover everything.) */
VIEW CURRENT-WINDOW.
ASSIGN CURRENT-WINDOW:HEIGHT = 2
       CURRENT-WINDOW:WIDTH  = 40.

RUN adecomm/_topmost.p 
     (INPUT CURRENT-WINDOW:HWND, /* Pass the HWND */
      INPUT yes,                 /* YES - Topmost */
                                 /* NO - Normal   */
      OUTPUT result-code).       /* OK - non-zero */

/* Show the result code */
MESSAGE "Result Code =" result-code VIEW-AS ALERT-BOX.

-Chris
 
Top