|
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 |
|
| |
(Pour noter la ressource, cliquez sur Ecrire un avis) |
| |
pour pouvoir poster un avis |
| | |
| | |
Aucun avis ou commentaire ? Soyez le premier ! |
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 StopTimer()
EndTimer(1)
IF LockInput(False) THEN Trace("lock is disabled") 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 |
| 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 |
| 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) |
| //Esconde API("USER32","ShowCursor",False)
//Reapresenta API("USER32","ShowCursor",True) |
| | |
|