Results 1 to 3 of 3

Thread: Start menu handle?

  1. #1

    Thread Starter
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    I looked at this thread
    http://forums.vb-world.net/showthrea...threadid=40282
    And thought - cool, maybe I can add to it and disable the start menu off the Windows key too - thus completely disabling the start menu. I can do this using various registry hacks in NT, but not 98 e.t.c e.t.c

    What I really want to do is get a handle to the start menu, and either Destroy the menu or set it to be invisible...

    I looked at it using Spy++ and it (windows) seems to create the menu each time, I can't subclass the shell cause its not my process, I think im all outta ideas on this one - anyone got any?

    (no real business need for this - just thought it might be a challenge)
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Why don't you just delete the start button?
    Oetje
    oetje@home.nl
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Hey
    Download my class @ http://www.geocities.com/despotez/WH/

    and use this code to hide (you could also close it but not recommended) the startmenu or the startbutton

    Code:
    Private Win As New WindowHandler, t&, t2&
    Private Sub HideButton()
    Dim t&
    t = Win.FindWin("Shell_TrayWnd", "")
    b = Win.FindWinEx(t, ByVal 0&, "Button", "")
    Win.Visible(b) = False
    'Optional destroy
    'Win.CloseWindow b
    End Sub
    
    Private Sub HideMenu()
    Dim b&, m&, s&
    'This hides the lower part of the startmenu
    b = Win.FindWin("BaseBar", "")
    m = Win.FindWinEx(b, ByVal 0&, "MenuSite", "")
    t = Win.FindWinEx(m, ByVal 0&, "ToolbarWindow32", "")
    Win.Visible(t) = False
    'Optional destroy:
    'Win.CloseWindow t
    'and now the top:
    s = Win.FindWinEx(m, ByVal 0&, "SysPager", "")
    t2 = Win.FindWinEx(s, ByVal 0&, "ToolbarWindow32", "")
    Win.Visible(t2) = False
    'Optional destroy:
    'Win.CloseWindow t2
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    Win.Visible(t) = True 'Return to normal
    Win.Visible(t2) = True 'Return to normal
    End Sub
    Hope it helps!

    Editing ...

    you can also disable the button or menu items with
    Win.Enabled(hWnd) = False
    It greys out the menuItem.

    [Edited by Jop on 11-16-2000 at 10:38 AM]
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

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