TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Doug Swenson
date: 1996-11-09 01:05:08
subject: window allways on top

JH>  AJ> I'm searching for a solution to put a window allways on top of an unkn
JH>  AJ> window (StarOffice Writer).

JH> You could use a WM_TIMER and do a WinSetWindowPos every
JH> second or so.. But then it fill float on top of all windows
JH> ofcourse. Don't know if you want that.

There was a number of messages about this sometime ago, I'll include
just some of it.  I haven't tried any of this myself:

___------------------- captured messages ---------------------------

Using WM_TIMER messages to do this is EXTREMELY inefficient.  The true
kosher method, which I confirmed with Scott Kliger (original author of
the Help Manager subsystem), is to subclass the frame, intercept the
WM_ADJUSTWINDOWPOS message, and process accordingly.

___------------------------------------------------------------------------
Packet: OS2CONCT   Date: 06-12-95 (18:28)   From: Mindy Pollack

I have a main frame window and another secondary window.  I don't want
the secondary window to be covered by the main window.  What I had
done originally, is subclass the frame of the secondary window and
prevent the zorder from occurring in the WM_ADJUSTWINDOWPOS message.

Turns out all I had to do was set the owner of the secondary window to
be the main window and it automatically stays "always on top" for me.

___------------------------------------------------------------------------
Packet: PEBBLE   Date: 05-18-95 (20:37)   From: Rick Yoder

>  So what's the accepted method of keeping a window "always on top".

The simplest way to do this is to set up a timer for the window being
kept always on top and include the following code snip in the WM_TIMER
handler:

case WM_TIMER:
    if ( SHORT1FROMMP(mp1) == ID_TIMER )
        WinSetWindowPos( hwnd,HWND_TOP,0,0,0,0,SWP_ZORDER );
    break;

One note of warning: Trying to force a window to always be on the top
can cause problems (anything from SYS3175s to completely wacky
behavior such as refusal to open data files) with seamless windows
applications.

___
 X OLX 1.53 X haiku: mourning doves on the telephone wires

--- Maximus/2 3.01
* Origin: Pebble BBS (1:202/1207)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 202/1207 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.