Click to See Complete Forum and Search --> : Docking a form to the Desktop?
DrEvil
Sep 14th, 2000, 06:06 PM
I have a form I want to dock to the desktop, similar to the the way the task bar docks to the desktop. I had the following suggestion...
"One thought is that the narrow window is docking itself to the edge of the desktop window, like the Windows taskbar does. I imagine the desktop area would automatically resize to accomodate the docked toolbar..."
The narrow window above refers to an Oracle8 administator toolbar that docks itself to the desktop. Then any window that is set to maximise, shuffles up under the admin toolbar! Neat trick...
Any bright ideas welcome.
This what you want?
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim StartMenu As Long
Dim What As RECT
Public Sub BorderToRight(FormName As Form)
For TempNum = 1 To 999
TempString$ = Space$(128)
TempNum2 = GetClassName(TempNum, TempString$, 128)
TempNum3 = Left$(TempString, TempNum2)
If LCase(TempNum3) = "shell_traywnd" Then GoTo StartMenuFound
Next TempNum
StartMenuFound:
GetWindowRect TempNum, What
StartMenu = What.Top * 15
FormName.Move Screen.Width - FormName.Width, 0, FormName.Width, StartMenu
End Sub
Private Sub Form_Load()
BorderToRight Me
End Sub
DrEvil
Sep 14th, 2000, 08:10 PM
Thanks Matthew - I added that code into my app. It doesn't do what we hoped but it does move the form to the top of the screen. The form does not dock though...
The only changes I made where to the "what.top * 15" to "what.top".
It definintly has the shell_traywnd fine. I don't know what this part is doing though?
StartMenuFound:
GetWindowRect TempNum, What
StartMenu = What.Top
frmThornChkGDCMin.Move Screen.Width - frmThornChkGDCMin.Width, 0, frmThornChkGDCMin.Width, StartMenu
end sub
Any further pointers would be appreciated.
gwdash
Sep 14th, 2000, 09:24 PM
An example with a reuseable class is avalible here:
http://www.geocities.com/SiliconValley/9486/appbar14.zip
DrEvil
Sep 14th, 2000, 11:28 PM
gwdash, Matthew,
Thanks for everything - The appbar14.zip does what I had in mind and a lot more. Thanks a bunch guys....
Matthew - Your code was probably what I wanted but I am to hung over from the Olympics parties to figure out what the heck to do witrh it!
Cheers,
DrEvil . . .
jasud_santosh
Aug 21st, 2002, 09:13 AM
Dear friends, i also want that stuf but I found that the link given in the message is not working now, could you please mail me on mail email id,
thanks in advance if your do so.
waiting for your reply
Santosh (India)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.