Click to See Complete Forum and Search --> : I can do Always On-Top, but Always *Underneath*?
Chaoticmass
Dec 15th, 2001, 10:19 AM
I'm working on a shell replacement for windows (for fun) and I'd like to have my 'desktop' stay on the bottom. Are there API calls that can manage this feat?
Thanks in advance.
da_silvy
Dec 15th, 2001, 10:25 AM
something like:
Private Const HWND_BOTTOM = 1
'Move window Form1 to the upper-left corner of the screen and make
' at appear above all other windows permanently. Note how the function is told not
' to resize the window, so we don't have to worry about the lower-right coordinate.
Dim flags As Long ' the flags specifying how to move the window
Dim retval As Long ' return value
' Do not resize the window, redraw the window in its new location
flags = SWP_NOSIZE Or SWP_DRAWFRAME
retval = SetWindowPos(Form1.hWnd, HWND_BOTTOM, 0, 0, 1, 1, flags) ' move the window
let me know ;)
Chaoticmass
Dec 15th, 2001, 10:34 AM
I'll give it a shot and see what happens.
da_silvy
Dec 15th, 2001, 10:59 AM
good luck ;)
DaoK
Dec 15th, 2001, 12:07 PM
You can try that :
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub SetWindowPos Lib "User32" (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)
Private Sub Form_Activate()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Set the window position to topmost
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
da_silvy
Dec 15th, 2001, 09:52 PM
no you can't
that would set the window to the top of the zorder, right at the top
use my code ;)
DaoK
Dec 16th, 2001, 10:03 AM
Humm anyways I didnt make that code, it's AllApi.net!
da_silvy
Dec 16th, 2001, 03:33 PM
Yes, but you didn't tailor it to his needs either!
If you are going to post a variation on what is already there, make it specific and helpful, as my example puts it on the bottom - because i fixed it :rolleyes:
Hack
Dec 17th, 2001, 01:36 PM
Chaoticmass: Did you try Da_Silvy's suggestion. I'd be interested in what happened.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.