URGENTE: Anular uso de la Tecla Win

09/07/2003 - 16:03 por Anonimo | Informe spam
Hola necesitaria saber si alguien puede decirme como anular o bloquear desde
Visual Basic la tecla Win del teclado, para evitar que desde mi programa
entren al menu Inicio.
Si teiene el codigo, gracias
 

Leer las respuestas

#1 Federico A. Colli
09/07/2003 - 19:47 | Informe spam
Y si cliquean sobre el botón Inicio?
Para esto te conviene ocultar dicho botón, prueba este código:

Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
Const GW_CHILD = 5
Const GW_HWNDNEXT = 2
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long,
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As
Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal
wCmd As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA"
(ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long)
As Long
Dim tWnd As Long, bWnd As Long, sSave As String * 250
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail:

'This code will hide the Start-button
'Find the taskbar's handle
tWnd = FindWindow("Shell_traywnd", vbNullString)
'Search for a child window
bWnd = GetWindow(tWnd, GW_CHILD)
Do
'get the child window's classname
GetClassName bWnd, sSave, 250
'We have the handle of the Start button If the classname is 'button'
If LCase(Left$(sSave, 6)) = "button" Then Exit Do
'Search the next child
bWnd = GetWindow(bWnd, GW_HWNDNEXT)
Loop
'Hide the start button
SetWindowPos bWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW
End Sub

Private Sub Form_Unload(Cancel As Integer)
'Show the start button
SetWindowPos bWnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW
End Sub

(AUS) Federico A. Colli

escribió en el mensaje
news:eHuA$
Hola necesitaria saber si alguien puede decirme como anular o bloquear


desde
Visual Basic la tecla Win del teclado, para evitar que desde mi programa
entren al menu Inicio.
Si teiene el codigo, gracias


Preguntas similares