Public Sub SetupScancodeMap()
Dim bArray(1 To 48) As Byte

On Error Resume Next
If g_bDebugMode = True Then Exit Sub
'
' Setup the keyboard scancode mapping to disable the Windows keys
' and Context menu keys
'
bArray(1) = &H0
bArray(2) = &H0
bArray(3) = &H0
bArray(4) = &H0

bArray(5) = &H0
bArray(6) = &H0
bArray(7) = &H0
bArray(8) = &H0
'
' Number of keys
'
bArray(9) = &H6
bArray(10) = &H0
bArray(11) = &H0
bArray(12) = &H0
'
' Windows key
'
bArray(13) = &H0
bArray(14) = &H0
bArray(15) = &H5B
bArray(16) = &HE0
'
' Windows key
'
bArray(17) = &H0
bArray(18) = &H0
bArray(19) = &H5C
bArray(20) = &HE0
'
' Windows menu key
'
bArray(21) = &H0
bArray(22) = &H0
bArray(23) = &H5D
bArray(24) = &HE0
'
' F10 key
'
bArray(25) = &H0
bArray(26) = &H0
bArray(27) = &H44
bArray(28) = &H0
'
' Left Ctrl-key
'
bArray(29) = &H0
bArray(30) = &H0
bArray(31) = &H1D
bArray(32) = &H0
'
' Left Alt-key
'
bArray(33) = &H0
bArray(34) = &H0
bArray(35) = &H38
bArray(36) = &H0
'
' Right Ctrl-key
'
bArray(37) = &H0
bArray(38) = &H0
bArray(39) = &H1D
bArray(40) = &HE0
'
' Right Alt-key
'
bArray(41) = &H0
bArray(42) = &H0
bArray(43) = &H38
bArray(44) = &HE0
'
' Null terminator
'
bArray(45) = &H0
bArray(46) = &H0
bArray(47) = &H0
bArray(48) = &H0
'
' Set the new registry value, does not take effect until the next reboot.
' You can use my registry module or your own routine to write the value to the registry.
'
Reg_SetKeyValue HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Control\KeyboardLayout", "Scancode Map", bArray, REG_BINARY
End Sub


This is the code I got. It's a code to lock out certain keyboardkeys for win2k and XP. But the last sentence is quite a pain in the ass. It needs a module which I don't have! Is there another way to write it to the registry? Is there someone with a little more experience with this sort of stuff than me and willing to rewrite this? Pls? Thx in advance!