DISABLE - ENABLE DEL KEY

 
Author Page created on Page updated on
Baris Engin 17.03.03
 
DLL calls used by this example

RegisterHotKey()

UnRegisterHotKey()

 
Download available as:
 
MapBasic . Copy/Paste to a new MB page if needed, or download if available.

declare function UnregisterHotKey Lib "user32.dll" 

    (byval hwnd as integer, byval ind as integer) 

    as logical

declare function RegisterHotKey Lib "user32.dll"

    (byval hwnd as integer, byval ind as integer, byval fsModifiers as integer, byval vk as integer)

    as logical

 

declare sub EnableDELKey

declare sub DisableDELKey

declare sub main

 

sub DisableDELKey

dim ret as logical

' 1 is the hot key identifier, &h2e the hex value of the DEL key.

' by registering it that way, the messages from the DEL key are ignored.

    ret=RegisterHotKey(0, 1, 0, &h2e)

end sub

 

sub EnableDELKey

dim ret as logical

' 1 is the hot key identifier as defined in the call to RegisterHotKey

    ret=UnRegisterHotKey(0, 1)

    end program

end sub

 

sub main

call disableDELkey

create menu "HKeyTest" as

    "Enable DEL Key and EXIT" Calling EnableDELKey

alter menu bar add "HKeyTest"

end sub


 
Comments: