-
Feb 21st, 2002, 03:10 PM
#1
Thread Starter
Member
Hide Start Menu
I can't find the API for hiding the start menu. Any help?
And yes it does have a use.
-
Feb 21st, 2002, 03:42 PM
#2
Lively Member
Do you want to hide the start button or the whole start menu?
You can hide the start button by using this simple code:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Dim Taskbar As Long
Dim StartButton As Long
Private Sub Command1_Click()
ShowWindow StartButton, SW_SHOW
End Sub
Private Sub Command2_Click()
ShowWindow StartButton, SW_HIDE
End Sub
Private Sub Form_Load()
Command1.Caption = "show start button"
Command2.Caption = "hide start button"
Taskbar = FindWindow("Shell_TrayWnd", vbNullString)
StartButton = FindWindowEx(Taskbar, ByVal 0&, "BUTTON", vbNullString)
End Sub
-
Feb 21st, 2002, 03:47 PM
#3
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As Any, ByVal lpszWindow As Any) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Function HideSButton()
Dim OurParent As Long
Dim OurHandle As Long
OurParent& = FindWindow("Shell_TrayWnd", "")
OurHandle& = FindWindowEx(OurParent&, 0, "Button", vbNullString)
ShowWindow OurHandle&, 0
End Function
Private Function ShowSButton()
Dim OurParent As Long
Dim OurHandle As Long
OurParent& = FindWindow("Shell_TrayWnd", "")
OurHandle& = FindWindowEx(OurParent&, 0, "Button", vbNullString)
ShowWindow OurHandle&, 5
End Function
Private Sub Command1_Click()
Call HideSButton
End Sub
Private Sub Command2_Click()
Call ShowSButton
End Sub
-
Feb 25th, 2002, 06:11 AM
#4
New Member
That code only hides the start button. You can still get the start menu to pop up. Is there any way of hiding a menu????
if you have the quickstart menu on the toolbar, if you drag it onto or over where the start button is meant to be it brings up the start menu!!!!!
with the quick start menu not there it works nicely!!!
-
Feb 25th, 2002, 06:44 AM
#5
Hyperactive Member
Well I don`t know what you are up to with these codes hiding the START button but if you were trying to prevent a user from having access to the Start menus then that won`t really work cause if you hit the Windows button on your keyboard, the Start menus will still show up...
-
Feb 25th, 2002, 01:28 PM
#6
Ok, then try disabling the Start Menu.
VB Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Sub Command1_Click()
Static bEnabled As Boolean
Dim lhWnd As Long
lhWnd = FindWindowEx(0&, 0&, "Shell_TrayWnd", vbNullString)
lhWnd = FindWindowEx(lhWnd, 0&, "Button", vbNullString)
Call EnableWindow(lhWnd, bEnabled)
bEnabled = Not bEnabled
End Sub
-
Feb 25th, 2002, 11:35 PM
#7
Fanatic Member
Hi
How can i change the Caption of start button
With the above code i tried using
SetWindowText(OurHandle&, "Pradeep")
SendMessage(OurHandle&, &HF, ByVal 0&, ByVal 0&)
But it dint work.. Can anybody help me out..
Pradeep
-
Nov 11th, 2012, 11:10 PM
#8
New Member
Re: Hide Start Menu
How can I get this code to work in VB 2010?
-
Jan 3rd, 2017, 12:43 PM
#9
New Member
Re: Hide Start Menu
I know this is an old topic but I am having the problem of hiding the start button yet you can still click on it. Even if you disable it you can click on it.
Check out my code sample here: http://www.vbforums.com/showthread.p...rt-Menu-Button
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
|