how to hide Start Button

  • Thread starter Thread starter Magic Gooddy
  • Start date Start date
M

Magic Gooddy

Hi!
How to hide Start Button in VB.NET?
I know in VB6 and want to see this sample in VB.NET.
Can anybody create worked sample?
 
Hi Magic,

What is Start button?

To hide a button is just mybutton.visible = false

Cor
 
* "Magic Gooddy said:
How to hide Start Button in VB.NET?
I know in VB6 and want to see this sample in VB.NET.
Can anybody create worked sample?

Untested, written from scratch:

\\\
Private Declare Auto Function FindWindowEx Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal hWndChild As IntPtr, __
ByVal lpszClassName As String, _
ByVal lpszWindow As String _
) As IntPtr

Private Declare Auto Function ShowWindow Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal nCmdShow As Int32 _
) As Int32

Private Const SW_HIDE As Int32 = 0
Private Const SW_RESTORE As Long = 9

Private m_hWndStart As Long
..
..
..
Dim n As IntPtr = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Shell_TrayWnd", vbNullString)
m_hWndStart = FindWindowEx(n, IntPtr.Zero, "BUTTON", vbNullString)
ShowWindow(m_hWndStart, SW_HIDE)
///
 
* "Magic Gooddy said:
your code not work!

Sorry, there were two little typos in the code:

\\\
Private Declare Auto Function FindWindowEx Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal hWndChild As IntPtr, _
ByVal lpszClassName As String, _
ByVal lpszWindow As String _
) As IntPtr

Private Declare Auto Function ShowWindow Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal nCmdShow As Int32 _
) As Int32

Private Const SW_HIDE As Int32 = 0
Private Const SW_RESTORE As Int32 = 9

Private m_hWndStart As IntPtr
..
..
..
Dim n As IntPtr = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Shell_TrayWnd", vbNullString)
m_hWndStart = FindWindowEx(n, IntPtr.Zero, "BUTTON", vbNullString)
ShowWindow(m_hWndStart, SW_HIDE)
///

.... works as expected.
 
* "Magic Gooddy said:
But why untested? Are you afraid of your code:-)

No, but I didn't have .NET installed on the machine I used for writing
the code, so I could not test it.
 
Back
Top