PC SOFT
ONLINE REPOSITORY
FOR WINDEVWEBDEV AND WINDEV MOBILE

Home |  | Sign in | English US
Teclado e Mouse Bloqueado por um periodo de tempo - Keyboard and Mouse Locked for a period of time - Clavier verrouillé pendant
Published by Boller
in the category Tools
New features



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, screen shots
none
none
User reviews
(To evaluate this resource, click 'Write a review')
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)
ABOUT
RATING:
00No rating
DOWNLOADS:
16
UPDATED:
September 14, 2022
VERSION:
27
CONCERNS:
WINDEV
Minimum version: 27
SIZE:
118.7 KB