Results 1 to 6 of 6

Thread: Docking a form to the Desktop?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Sydney, Australia
    Posts
    4

    Question

    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.


  2. #2
    Guest
    This what you want?

    Code:
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Sydney, Australia
    Posts
    4
    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.

  4. #4
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    An example with a reuseable class is avalible here:
    http://www.geocities.com/SiliconVall...6/appbar14.zip
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Sydney, Australia
    Posts
    4
    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 . . .


  6. #6
    New Member
    Join Date
    Sep 2001
    Posts
    1

    Smile that is link is not working now

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width