PC SOFT
DEPOT EN LIGNE
POUR WINDEVWEBDEV ET WINDEV MOBILE

Teclado e Mouse Bloqueado por um periodo de tempo - Keyboard and Mouse Locked for a period of time - Clavier verrouillé pendant
Publié par Boller
dans la catégorie Outils
Nouveautés



Description
Teclado e Mouse Bloqueado por um periodo de tempo - Keyboard and Mouse Locked for a period of time - Clavier verrouillé pendant un certain temps

IF Timer("StopTimer", 1000, 1) = 0 THEN
Error("Unable to create the timer")
ELSE
IF LockInput(True) THEN
Trace("Lock is enabled")
END
END

//------------------------------------------------------

PROCEDURE LockInput(LOCAL bFlag is boolean)

bRet is boolean = False

IF bFlag THEN // Disable child controls
IF EnableWindow(Handle(BTN_BlockInput), False) = False THEN
IF EnableWindow(Handle(Check_input), False) = False THEN
bRet = True
END
END
ELSE // Eanble child controls
IF EnableWindow(Handle(BTN_BlockInput), True) = True THEN
IF EnableWindow(Handle(Check_input), True) = True THEN
bRet = True
END
END
END

RETURN bRet

//---------------------------------------------------------------------------------

PROCEDURE StopTimer()

EndTimer(1)

IF LockInput(False) THEN
Trace("lock is disabled")
END


//------------------------------------------------------------------------------

FUNCTION EnableWindow(LOCAL hWnd is system int, LOCAL bEnable is boolean)

//keyboard
bRet is boolean = API("USER32", "EnableWindow", hWnd, bEnable)

//Esconde ou Exibe o mouse
API("USER32","ShowCursor",bEnable)

RETURN bRet

//-------------------------------------------------------------------------------------------------

by Patrice Terrier and Pedrosao
Illustrations, copies d'écran
none
none
Avis des utilisateurs
(Pour noter la ressource, cliquez sur Ecrire un avis)
Boller
IF Timer("StopTimer", 1000, 1) = 0 THEN
Error("Unable to create the timer")
ELSE
IF LockInput(True) THEN
Trace("Lock is enabled")
END
END
Boller
PROCEDURE StopTimer()

EndTimer(1)

IF LockInput(False) THEN
Trace("lock is disabled")
END
Boller
PROCEDURE LockInput(LOCAL bFlag is boolean)

bRet is boolean = False

IF bFlag THEN // Disable child controls
IF EnableWindow(Handle(BTN_BlockInput), False) = False THEN
IF EnableWindow(Handle(Check_input), False) = False THEN
bRet = True
END
END
ELSE // Eanble child controls
IF EnableWindow(Handle(BTN_BlockInput), True) = True THEN
IF EnableWindow(Handle(Check_input), True) = True THEN
bRet = True
END
END
END

RETURN bRet
Boller
FUNCTION EnableWindow(LOCAL hWnd is system int, LOCAL bEnable is boolean)

//keyboard
bRet is boolean = API("USER32", "EnableWindow", hWnd, bEnable)

//Esconde ou Exibe o mouse
API("USER32","ShowCursor",bEnable)

RETURN bRet
Boller
Uma gambiarra semalhante o Adriano compartilhou no forum há alguns séculos atrás:

Timer("pEffaceCurseur",300,1)

//Code de la procédure pEffaceCurseur()

Procedure pEffaceCurseur()

EXTERNE NomChampImageOuNomFenetre

NomChampImageOuNomFenetre..CurseurSouris = ComplèteRep(fRepExe()) + "Transparent.ico"

FinTimer(1)
Boller
//Esconde
API("USER32","ShowCursor",False)

//Reapresenta
API("USER32","ShowCursor",True)
A PROPOS
EVALUATION :
00Aucune évaluation
TELECHARGEMENTS :
16
MISE À JOUR :
14 septembre 2022
VERSION :
27
CONCERNE :
WINDEV
Version minimale : 27
TAILLE :
118,7 Ko