Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disable Keyboard buttons with Win API
Message
De
13/01/2001 16:22:10
 
 
À
05/01/2001 11:35:00
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00459449
Message ID:
00463417
Vues:
75
>Thanks for the advice, but reading MSDN I found somethig
>to disable some buttons for VB and was trying to do the
>same with VFP.
>
>I just want to have more control over the application,
>because some user's just dont read what's in front of
>their nose, and some user's press CTRL + ALT + DEL (twice)
>and we all know what happens !
>
>I found This:
>Declare Integer SystemParametersInfo ;
>In user32 As SystemParametersInfo ;
>Integer uAction , ;
>Integer uParam ,;
>String lpvParam ,;
>Integer fuWinIni
>
>* Disable Buttons Ctrl + Esc & Alt + Tab & Ctrl + Alt + Del
>=SystemParametersInfo( 97, 1, 0, 0)

This affects the screen saver mode, and should not be called at all in Win9x; it's called internally. The literal 97 is SPI_SCREENSAVERRUNNING.

VFP does not have the mechanism needed to hook a system keystroke by itself - it requires a callback.

I'd investigate two API calls - BlockInput(), which can block respose to key and mouse events, and MapVirtualKey(), which can assign a different virtual key to a scan code on a temporary basis.

>
>wait windows "Buttons 'Ctrl+Esc' & 'Crtl+Tab' & 'Ctrl+Alt+Del' Disable" timeout 3
>
>* Enable
>=SystemParametersInfo( 97, 0, 0, 0)
>wait windows "Buttons Enable" timeout 3
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform