Страница 1 из 1

Клавиша WIN

Добавлено: 27 сен 2005, 07:18
OTELLO
Доброе время суток. Имеется ли способ отключения клавиши WIN? Т.е. меню пуск не должно выскакивать при нажатии на оную. Заранее спасибки...

Добавлено: 27 сен 2005, 17:58
Eugie
Хук можно поставить, см. SetWindowsHookEx(WH_KEYBOARD_LL,...)

Добавлено: 27 сен 2005, 22:42
OTELLO
Хук пробовал-всё равно сначала вылетает меню пуск-а потом происходит переопределённое действие...=(

Добавлено: 28 сен 2005, 01:00
AiK
Вариант через реестр:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\KeyBoard
Layout\Scancode Map

It's a binary value that lets you map keystrokes in the low-level keyboard
drivers in NT. As a result you don't have to worry about applications
bypassing mappings that you've done at a higher level (i.e. it just works).
Here's the format of the value:

Код: Выделить всё

        DWORD:  0x00000000      header
        DWORD:  0x00000000      header
        DWORD:  length (in DWORDs) of remaining data, including terminating DWORD
        DWORD:  mapping 1
        ...
        DWORD:  mapping n
        DWORD:  0x00000000      terminating null DWORD
Each mapping DWORD has two parts: the input scancode, and an output
scancode. To map scancode 0x1d (left control) to scancode 0x3a (caps
lock), you want a value of 0x003a001d. Note that this does not swap the
keys. Using just this mapping value, both the left control and the caps
lock key will behave as caps-lock. To swap, you also need to map 0x3a to
0x1d, using 0x001d003a. So, the complete registry value you'd use to swap
left-control and caps-lock is:

00 00 00 00 00 00 00 00 03 00 00 00 1d 00 3a 00 3a 00 1d 00 00 00 00 00


Сканкоды виндовых клавиш сам надеюсь наёдешь :)

Добавлено: 28 сен 2005, 12:44
Eugie
Надо же, не знал о такой возможности. Впрочем, MSDN знает все - ну или почти все :)
To disable the Windows key, do the following steps:
1. Click Start, click Run, type regedt32, and then click OK.
2. On the Windows menu, click HKEY_LOCAL_ MACHINE on Local Machine.
3. Click the System\CurrentControlSet\Control folder, and then double-click the Keyboard Layout folder.
4. On the Edit menu, click Add Value, type in Scancode Map, click REG_BINARY as the Data Type, and then click OK.
5. Type 00000000000000000300000000005BE000005CE000000000 in the Data field, and then click OK.
6. Close the Registry Editor and restart the computer.

Добавлено: 29 сен 2005, 00:17
OTELLO
2 Eugie:

Слушай,я что-то не понял-надо добавить параметр в разделе Keboard Layot типа Reg_Binary? И как его заполнить такими данными-вручную? И ещё- как его назвать? Возможно я ошибаюсь везде =) Подскажи плиз как именно это сделать... Спасибки заранее

Добавлено: 29 сен 2005, 16:26
Eugie
Да именно так и нужно сделать. Если оставишь свое мыло, вышлю соответствующий reg-файл, чтобы не набивать binary value вручную.

Добавлено: 30 сен 2005, 00:21
OTELLO
otello_mail@mail.ru

БУДУ ОЧЕНЬ БЛАГОДАРЕН!!!

Добавлено: 30 сен 2005, 13:08
Eugie
Отправил. Не забудь перезагрузиться после изменения реестра.

Добавлено: 02 окт 2005, 10:45
OTELLO
спасиби говорим! То что надо!