How can I make a window stay on top?

BlitzPlus Forums/BlitzPlus Programming/How can I make a window stay on top?

CopperCircle(Posted 2004) [#1]
Iv got a tool window I want to stay on top when the main window is active?


Eikon(Posted 2004) [#2]
Use one of these with the hWnd to force it to the top of the Z-Order.

SetForegroundWindow
BringWindowToTop
SetWindowPos (hWndInsertAfter = HWND_TOPMOST)


CopperCircle(Posted 2004) [#3]
Do these commands have to been declared as part of a dll first?


Pineapple(Posted 2004) [#4]
They are WinAPI functions, you declare them in your BlitzPlus/userlibs folder as .decls file, there's a little readme.txt file in there that helps explain things, or check out the userlibs samples in the code archive to see how they work.

I also recommend downloading this:

http://www.mentalis.org/agnet/apiguide.shtml

to get the parameters and return type information of each function!

Dabz

:)

P.S. Have fun!!! ;)


CopperCircle(Posted 2004) [#5]
Thanks, that API Guide is great, still can`t achive what I want though, all the commands keep the window on top but also set the focus to the window.


Binary_Moon(Posted 2004) [#6]
Just use setwindowpos on it's own

I've got a little app I wrote that sits on the top of the screen (like a minimised win amp)

SetWindowPos(hwnd,-1,x,y,w,h,0)


is what i use and it works fine.