Activer automatiquement le majuscule à l'entrée d'un champs de saisie

Pour activer le majuscule automatiquement à l'entrée d'un champs de saisie (Sous Windev), procédez comme suit:

1- Créer une procédure (CapsLock par exemple)

// ***********************  Procédure CapsLock  **************************************

PROCEDURE CapsLock(LOCAL bStatus est un booléen = Faux)

VK_CAPITAL1 est entier = 0x14      // CapsLock
nVK_NUMLOCK est entier = 0x90  // NumLock
nVK_SCROLL est entier = 0x91       // ScrollLock
bEtatInitial est un booléen

nVK_Touche est entier = VK_CAPITAL1

bEtatInitial = API("USER32","GetKeyState",nVK_Touche)
SI bEtatInitial <> bStatus ALORS
API("USER32","keybd_event",nVK_Touche,0x45,0x1,0)
API("USER32","keybd_event",nVK_Touche,0x45,0x2,0)
FIN

RENVOYER bEtatInitial

// ********************************************************************************


2- Code :  Entrée dans << champs de saisie >>

// Appeler la procédure pour activer le majuscule
CapsLock(Vrai)



Bon dev. GhrSoft

Commentaires