I know it is very easy to make a window alwatsontop, but is is possible to make it always behind?
Printable View
I know it is very easy to make a window alwatsontop, but is is possible to make it always behind?
Code:Private Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos"_
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Private Sub Form_Load()
SetWindowPos Me.hWnd, HWND_NOTOPMOST, _
0, 0, 0, 0, FLAGS
End Sub
IT DOESN'T WORK!
It makes it not on top, but not BEHIND - e.g. all other windows are on top of it despite it's focus.
Matthew
You want it to stay behind all other Windows at all times? Try putting it in a timer.
Code:Private Sub Timer1_Timer()
SetWindowPos Me.hWnd, HWND_NOTOPMOST, _
0, 0, 0, 0, FLAGS
End Sub
Unfortunately that doesn't work either
So, can anybody help?
compile that as an exe and run it. it works.
It still won't work for me, I have VB6 Pro
Hi, Matthew, I think this will be better.
Can we replace the timer by others mean?Code:Private Sub Timer1_Timer()
SetWindowPos Me.hwnd, HWND_BOTTOM, 0, 0, 0, 0, FLAGS
End Sub
Quote:
Originally posted by Matthew Gates
You want it to stay behind all other Windows at all times? Try putting it in a timer.
Code:Private Sub Timer1_Timer()
SetWindowPos Me.hWnd, HWND_NOTOPMOST, _
0, 0, 0, 0, FLAGS
End Sub