4 de abril de 2016

LockScreen mejorado

Algunas veces es necesario utilizar APIs de Windows para asegurarnos que LockScreen funcione como debería... Marcia G. Akins nos ofrece una rutina para ello.

***********************************************************************
* Program....: REALLYLOCKSCREEN
* Purpose....: Use the Windows API to force a true screen lock. 
* ...........: Calling this lock function with a handle of 0 unlocks all locked windows
* Developer..: Marcia G. Akins
***********************************************************************
LPARAMETERS tlLock
LOCAL ARRAY laJunk[1]
LOCAL lnHWnd, lnRes
**********************************************************
*** Check that the library has been set up and open it if not already done.
**********************************************************
lnRes = ADLLS( laJunk )
IF lnRes = 0 OR  NOT ( ASCAN( laJunk, 'LockWindowUpdate', 1, -1, 1, 15 ) > 0)
  *** We don't have the function available
  DECLARE INTEGER LockWindowUpdate IN Win32API INTEGER nHandle 
ENDIF
*** Now set the Handle to lock according to the parameter
lnHWnd = IIF( tlLock, ThisForm.HWnd, 0 )
*** And call the function
LockWindowUpdate( lnHWnd )

RETURN

Regards,
Marcia G. Akins

Esparta Palma

No hay comentarios. :

Publicar un comentario