|
-
Nov 14th, 2000, 01:10 PM
#1
Thread Starter
Addicted Member
I know it is very easy to make a window alwatsontop, but is is possible to make it always behind?
-
Nov 14th, 2000, 02:38 PM
#2
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
-
Nov 14th, 2000, 02:43 PM
#3
Thread Starter
Addicted Member
Doesn't work
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
-
Nov 14th, 2000, 02:49 PM
#4
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
-
Nov 14th, 2000, 02:52 PM
#5
Thread Starter
Addicted Member
No
Unfortunately that doesn't work either
-
Nov 15th, 2000, 08:49 AM
#6
Thread Starter
Addicted Member
-
Nov 17th, 2000, 05:26 PM
#7
Addicted Member
compile that as an exe and run it. it works.
Brian
Programming: VB5 Pro (SP3) - QBasic 1.1,4.5
Internet: HTML 4, CSS, JavaScript
Visit AltInt.com!
-
Nov 18th, 2000, 08:36 AM
#8
Thread Starter
Addicted Member
It still won't work for me, I have VB6 Pro
-
Nov 19th, 2000, 01:17 AM
#9
PowerPoster
Hi, Matthew, I think this will be better.
Code:
Private Sub Timer1_Timer()
SetWindowPos Me.hwnd, HWND_BOTTOM, 0, 0, 0, 0, FLAGS
End Sub
Can we replace the timer by others mean?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|