ABILITAR BARRA DE TAREFAS

LORDAUTUNM 09/05/2006 15:50:31
#145785
esse codigo desabilita a barra de tarefas e suas funcoes (SOME COM A BARRA):

'abilita\desabilita botao iniciar
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long


Public Sub Desabilita()
Dim hWnd As Long
hWnd = FindWindow("Shell_TrayWnd", "")
PostMessage hWnd, 2, 0, 0
End Sub

ALGUEM SABE COM ABILITAR, PORQUE SO CONCEGUI REINICIANDO O WINDOWNS
LORDAUTUNM 09/05/2006 18:07:08
#145824
Matioli esse codigo nao desabilita o menu iniciar, oque nao adianta para mim, e o sheel explorer nao deu certo, mas valeu, se alguem tiver outra ideia me ajude!
USUARIO.EXCLUIDOS 09/05/2006 18:20:02
#145827
Po realmente o menu iniciar fica funfando mesmo...bom, o shell foi chute mesmo..rs...

E se usar o meu código, mas só pra habilitar, num funfa?
ARAUJOLIN 09/05/2006 18:21:09
#145828
veja se isto ajuda:



'-----------------------------------Em um modulo
Public Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Public Declare Function EnumChildWindows Lib "user32" _
(ByVal hWndParent As Long, ByVal lpEnumFunc As Long, _
ByVal lParam As Long) As Long

Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
(ByVal hWnd As Long, ByVal lpClassName As String, _
ByVal nMaxCount As Long) As Long

Public Declare Function EnableWindow Lib "user32" _
(ByVal hWnd As Long, ByVal fEnable As Long) As Long

Public StartButtonhWnd As Long


Public Function EnumChildProc(ByVal lhWnd As Long, ByVal lParam As Long) _
As Long
Dim RetVal As Long
Dim WinClassBuf As String * 255
Dim WinClass As String

RetVal = GetClassName(lhWnd, WinClassBuf, 255)
WinClass = StripNulls(WinClassBuf) ' remove extra Nulls & spaces
If WinClass = "Button" Then
StartButtonhWnd = lhWnd
RetVal = EnableWindow(StartButtonhWnd, False)
EnumChildProc = False ' Stop looking
Else
EnumChildProc = True ' Keep looking
End If
End Function

Public Function StripNulls(OriginalStr As String) As String
If (InStr(OriginalStr, Chr(0)) > 0) Then
OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1)
End If
StripNulls = OriginalStr
End Function

'-----------------------------------No Botão Desabilitar
Dim WinClass As String
Dim TaskBarHwnd As Long, lRet As Long, lParam As Long
'
WinClass = "Shell_TrayWnd"
'
TaskBarHwnd = FindWindow(WinClass, vbNullString)
'
lRet = EnumChildWindows(TaskBarHwnd, AddressOf EnumChildProc, lParam)

'-----------------------------------No Botão Habilitar
Dim RetVal As Long
If StartButtonhWnd <> 0 Then
RetVal = EnableWindow(StartButtonhWnd, True)
End If
LORDAUTUNM 09/05/2006 18:46:14
#145830
MATIOLLI TENTEI ABILITAR COM SEU CODIGO MAS NAO FUNFOL, E ARAUJOLIN ESSE CODIGO APENAS RETIRA A FUNCAO CLICK DO BOTAO INICIAR, MAS SE APERTAR CRTL + ASC OU A TECLA INICIAR O MENU CONTINUA APARECENDO, DEM UMA OLHADINHA NO CODIGO QUE MENCIONEI NO TOPICO, ELE DESABILITA A BARRA E CONSEQUENTIMENTE O MENU, MAS NAO CONSIGO REABILITAR A BARRA SEM REINICIAR.
Tópico encerrado , respostas não são mais permitidas