PDA

View Full Version : [vb6] nascondere il pulsante start


uMoR
12-10-2003, 20:26
qualcuno sa dirmi qualche api o simile per nascondere il bottone start dalla barra delle applicazioni ?

matpez
12-10-2003, 20:48
Dovrebbe esserci tutto... :p


Option Explicit

Public Enum SET_WINDOWS
SW_HIDE
SW_SHOW
SW_DESTROY
End Enum

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 SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long


Public Sub SetStartButton(ByVal StartButton As SET_WINDOWS)

Dim lHandle As Long
Dim lFindClass As Long


'mostro/nascondo/distruggo lo StartButton
lFindClass = FindWindow("Shell_TrayWnd", "")
lHandle = FindWindowEx(lFindClass, 0, "Button", vbNullString)

If StartButton = SW_DESTROY Then
SendMessage lHandle, StartButton, 0, 0
Else
ShowWindow lHandle, StartButton
End If

End Sub


ciaoooooooooooooo :)