Visual Basic Forum

Visual Basic Forum
für VB6 und VB.NET Programmierer
 
RegistrierenRegistrieren  LoginLogin
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB.NET] Fragen - Antworten
Autor
Nachricht
Viruz_
Newbie
Newbie

Anmeldedatum: 19.09.2007
Beiträge: 8

Start Menu Hide (disable)
Verfasst am: 30.05.2009, 18:51

hi
bin neu hir sieht man an meinen Posts, aber bräuchte mal hilfe
und zwar suche ich nen snippet zu nem start menu hide. Fand bisher nur keyhooks und wollte wissen ob es per Registry oder einem Befehl möglich ist das Start Menü zu Hiden oder abzuschalten.

Grund: Schreibe an einem Sicherheitsprogramm wo bei mehrfacher Passwortfalscheingabe sich einige Funktionen abschalten.

Danke schonmal im vorraus.

<Krypzec.Viruz>

OK hab was gefunden also wen es interessiert :
--schaltet die Tastenkombinationen ab--




Code:

Imports System.Runtime.InteropServices

Imports System.Reflection

Module mKeyboard

#Region "Declarations"

Private Const HC_ACTION As Integer = 0

Private Const WH_KEYBOARD_LL As Integer = 13&



Private Structure KBDLLHookStruct

Public vkCode As Integer

Public scanCode As Integer

Public flags As Integer

Public time As Integer

Public dwExtraInfo As Integer

End Structure



<MarshalAs(UnmanagedType.FunctionPtr)> _

Private callback As KeyboardHookDelegate

Private mbBlockKeys As Boolean = True

Private miKeyboardHandle As Integer = 0



Private Delegate Function KeyboardHookDelegate(ByVal Code As Integer, _

ByVal wParam As Integer, ByRef lParam As KBDLLHookStruct) As Integer



Private Declare Function CallNextHookEx Lib "user32" ( _

ByVal hHook As Integer, ByVal nCode As Integer, _

ByVal wParam As Integer, ByVal lParam As KBDLLHookStruct) As Integer



Private Declare Function SetWindowsHookEx Lib "user32" _

Alias "SetWindowsHookExA" _

(ByVal idHook As Integer, ByVal lpfn As KeyboardHookDelegate, _

ByVal hmod As Integer, ByVal dwThreadId As Integer) As Integer



Private Declare Function UnhookWindowsHookEx Lib "user32" ( _

ByVal hHook As Integer) As Integer

#End Region



#Region "Properties"

Public Property BlockKeyCombinations() As Boolean

Get

Return mbBlockKeys

End Get

Set(ByVal value As Boolean)

mbBlockKeys = value

End Set

End Property



Public ReadOnly Property IsHooked() As Boolean

Get

Return miKeyboardHandle <> 0

End Get

End Property

#End Region



Public Function IsInIDE() As Boolean

Return System.Diagnostics.Debugger.IsAttached

End Function



Public Sub HookKeyboard()

' Release any existing keyboard hook.

UnhookKeyboard()



If Not IsInIDE() Then

callback = New KeyboardHookDelegate(AddressOf KeyboardCallback)

miKeyboardHandle = SetWindowsHookEx(WH_KEYBOARD_LL, callback, _

Marshal.GetHINSTANCE([Assembly].GetExecutingAssembly.GetModules()(0)).ToInt32, 0)

End If

End Sub



Public Sub UnhookKeyboard()

If (IsHooked()) Then Call UnhookWindowsHookEx(miKeyboardHandle)

End Sub



Private Function BlockKeyCombination( _

ByVal Hookstruct As KBDLLHookStruct) As Boolean



Dim bResult As Boolean = False



If mbBlockKeys Then

Select Case Hookstruct.vkCode

Case System.ConsoleKey.Escape

If My.Computer.Keyboard.CtrlKeyDown Then

Debug.Print("Blocking: Ctrl-Esc")

bResult = True

ElseIf My.Computer.Keyboard.AltKeyDown Then

Debug.Print("Blocking: Alt-Esc")

bResult = True

End If

Case System.ConsoleKey.Tab

If My.Computer.Keyboard.AltKeyDown Then

Debug.Print("Blocking: Alt-Tab")

bResult = True

End If

Case System.ConsoleKey.RightWindows, System.ConsoleKey.LeftWindows

Debug.Print("Blocking: Windows Key")

bResult = True

Case System.ConsoleKey.Applications

Debug.Print("Blocking: Application Key")

bResult = True

Case System.ConsoleKey.F4

If My.Computer.Keyboard.AltKeyDown Then

Debug.Print("Blocking: Alt-F4")

bResult = True

End If

Case Else

End Select

End If



Return bResult

End Function



Private Function KeyboardCallback(ByVal Code As Integer, _

ByVal wParam As Integer, ByRef lParam As KBDLLHookStruct) As Integer



Dim lResult As Integer = 0

If (Code = HC_ACTION) AndAlso (BlockKeyCombination(lParam)) Then

lResult = 1

Else

lResult = CallNextHookEx(miKeyboardHandle, Code, wParam, lParam)

End If



Return lResult

End Function

End Module
 
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB.NET] Fragen - Antworten

Tags: disable, hide, keyboard, start

 
 Verwandte Themen   Aufrufe   Letzter Beitrag 
Keine neuen Beiträge [suche] Tuturials winsock & daten senden 983 09.06.2011, 13:19
Keine neuen Beiträge [Video] *.dll & *.ocx Installer 2612 06.03.2008, 21:19
Keine neuen Beiträge ListView speichern & laden 1331 05.08.2008, 13:32
Keine neuen Beiträge Registry & Co Fragen 1204 03.05.2007, 10:57
Keine neuen Beiträge Listbox speichern & laden 2271 22.03.2007, 21:25
 


[ Time: 0.0758s ][ Queries: 80 (0.0348s) ][ GZIP on - Debug on ]