I can't find the API for hiding the start menu. Any help?
And yes it does have a use.
I can't find the API for hiding the start menu. Any help?
And yes it does have a use.
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
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
Please use [Code]your code goes in here[/Code] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.
Creating A Wizard In VB.NET
Paging A Recordset
What is wrong with using On Error Resume Next
Good Article: Language Enhancements In Visual Basic 2010
Upgrading VB6 Code To VB.NET
Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked
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!!!
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...![]()
>!v!<
Free your mind, stop thinking
http://inspirone.blogspot.com
Please rate this post if it helped you
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
Please use [Code]your code goes in here[/Code] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.
Creating A Wizard In VB.NET
Paging A Recordset
What is wrong with using On Error Resume Next
Good Article: Language Enhancements In Visual Basic 2010
Upgrading VB6 Code To VB.NET
Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked
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![]()
Learn by others experience as you cannot live long to experience them all.
www.freewebs.com/pradeepkrao
LOOK AT MY GAMES AT MY WEB SITE.
How can I get this code to work in VB 2010?