OS/2, eCS & ArcaOS - Technical > Programming

how to stay a window on top

<< < (2/6) > >>

Martin Vieregg:
I'm sorry, but the WinSetWindowBits code seems not to work.

A system wide Float to top would be helpful, too, because it is also part of the Freepascal Lazarus code. (FormStyle = fsSystemStayOnTop) But all variants are non-modal.

Laurence Pithie:
One option would be to place the Main window behind the client window using WiinSetWindowPos when the client program is active. One way to  achieve that is by placing a check for the clinet program being active and calling WinSetWindowPos at the end of processing the WM_PAINT message in the main window procedure. Essentially what you woulld be doing is swapping the Z order of the two windows if the user brings the main window to the front while the client program is active.

Lars:
If your child window is a sibling of your main window (whatever "child" and "main" window means in your context), you can use WinSetWindowPos with SWP_ZORDER to place your child window on top of any other sibling windows.

Sibling windows have a common parent window. If you can show us the relationship between your "child" window and "main" window (using PMTree, for example) then it should be possible to come up with a solution.

Lars:
Or try WinSetActiveWindow. See the help for this function. The active window will be placed above all other top-level windows on the screen (see "Window activation" in the help).

Martin Vieregg:
Both "WinSetWindowPos with SWP_ZORDER" and "WinSetActiveWindow" let the window appear on top, but only for the moment until another window gets the focus. I am searching for a permanent way that another window cannot float above my window.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version