Kbase 17500: How to set a window always on top using adecomm/_topmost.p
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  20/10/1999 |
|
How to set a window always on top using adecomm/_topmost.p
INTRODUCTION:
=============
To set a window always on top in MS-Windows you should use the
MS-Windows API routines: GetParent and SetWindowPos, available in
differents DLL: user.exe and user32.dll depending on the API version
16bits or 32bits.
Progress uses these routines in the User Interface Builder and has a
program that provides this functionality: adecomm/_topmost.p.
This program simplify the calls to the appropiated DLLs (16 bits or 32
bits).
Steps to use:
- Create a new window in the UIB
- Add a button in this window label it: Always on top
- Add the following code in the CHOOSE trigger for this button
DEFINE VARIABLE rc AS INTEGER.
IF SELF:LABEL = "Normal" THEN DO:
RUN adecomm/_topmost.p ({&WINDOW-NAME}:HWND, NO, OUTPUT rc).
SELF:LABEL = "Always on top".
END.
ELSE DO:
RUN adecomm/_topmost.p ({&WINDOW-NAME}:HWND, YES, OUTPUT rc).
SELF:LABEL = "Normal".
END.
- Run the program, choose the button to set the window always on top
- Play trying to put other windows over this window
- Choosing the button again(Normal) will unset the always on top
characteristic.
NOTE:
For information about MS-Windows API routines please consult your
Microsoft documentation.
-
EDSEL Dec/1997
Progress Software Technical Support Note # 17500