Jump to content
Tuts 4 You

force HUD window over another


kolynet

Recommended Posts

Posted

i would like to achieve to get my transparent window over another, but dont want to lose z-order, so i need to force my hud to be always the 2nd in z-order (to be the top of a specific window). Is there a good workaround for this?


Posted

I'm not exactly sure of your question but if you change any window position Z-Order will always change with it, there is no work-a-around to force one window over another without changing Z-Order. If you know both window handles you can ensure the one you want at the top of the Z-Order remains there by checking if it is still in the foreground using the GetForegroundWindow function. You can even organise them in Z-Order if desired providing you know the window handles.


 


http://msdn.microsoft.com/en-us/library/windows/desktop/ms633505%28v=vs.85%29.aspx



If GetForegroundWindow_() <> hWnd                                                 ; Check if the window is in the foreground (top window in Z-Order)
  SetWindowPos_(hWnd,#HWND_TOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)               ; If it's no longer in the foreground set it TopMost again
EndIf

Because I saw this topic it reminded me to release an update to one of my tools, PinMe!. I have packaged it up and uploaded it to Tuts 4 You, you may find it helpful - check the SuperPin! feature...


 


https://tuts4you.com/download.php?view.3551


 


Ted.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...