How can I make a window stay on top?
BlitzPlus Forums/BlitzPlus Programming/How can I make a window stay on top?| 
 | ||
| Iv got a tool window I want to stay on top when the main window is active? | 
| 
 | ||
| Use one of these with the hWnd to force it to the top of the Z-Order. SetForegroundWindow BringWindowToTop SetWindowPos (hWndInsertAfter = HWND_TOPMOST) | 
| 
 | ||
| Do these commands have to been declared as part of a dll first? | 
| 
 | ||
| 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!!! ;) | 
| 
 | ||
| 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. | 
| 
 | ||
| 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. |