• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[APP]LockDevice [2009-08-26]. Ultralight app to lock after wakeup

Search This thread

danielherrero

Senior Member
Oct 3, 2006
3,280
247
Madrid
www.softwaredhr.es
change's log
V1.6 2009-09-11
Phone doesnt lock if there is a call in progress
V1.5 2009-08-26
1) Added an option to lock the device when a player (HTC player, WM Player, HTC FM Radio, etc) turns the screen off...
V1.4 2009-08-14
1) Added command argument. "lock". this will lock the device.
2) Added a link called "Lock Now" to lock now....
3) All the links are located in a folder called "Lock Device". (because there are 4 links and I dont want to fill the directory \windows\start menu (in your language) with many links
V1.3 2009-08-04
1) Commands support. The program LockDeviceGUI.exe supports 4 commands.
  1. enabled -> Enable LockDevice
  2. disabled -> Disable LockDevice
  3. wakeup -> Run Mode: Lock on wakeup
  4. screenoff -> Run Mode: Lock on screen off
Your can set one or two parameters. For example:
  • 61#"\Archivos de programa\LockDevice\LockDeviceGUI.exe" disabled -> Disable LockDevice
  • 61#"\Archivos de programa\LockDevice\LockDeviceGUI.exe" enabled screenoff -> Enable LockDevie and run mode set to "lock on screen off"
The installer creates out of the box two links in the system programs folder: EnableLock.lnk and DisableLock.lnk (The first with "enabled" parameter and the second one with "disabled" parameter).

V1.2 2009-08-03
1) The installer includes a little GUI program.
icon.jpg

With this program you can configure how LockDevice must behave.
View attachment 211920
1) Enabled / Disabled
2) Work Mode:
2.1) Lock on wakeup. This is how works previous version. Pros: The program doesnt stay resident. Cons: The device must be "off" some seconds before windows really suspend the device. This time is longer with wifi active. So if you press power off and then power on quickly probably the device wont lock (because windows never suspended the device)
2.2) Lock on Screen off. Pros: The device is locked when the screen goes off so always works correctly. Cons: The program stays resident. Anyway the program is "paused" all the time so no CPU is used. the program stays sleeping until windows notifies it the screen is off. Then LockDevice lock the device and goes to sleep again :)

Please report any bug, suggestion, etc...
Dani
V1.1 2009-07-31
1) The device is locked directly using keybd_event. No sendkey.exe call . So smaller, quicker and no dependence of sendkey.exe configuration.

Initial post
Hi
Today I ve been searching for a very little program, not resident in memory to lock my device on wakeup. There are other ones but I didnt find one that isnt resident in memory.
So I ve done quickly a very small program that is notified by windows when the device is woken up, so no resident, and executes \windows\endkey.exe. So if you ve configured your end key long press to lock the device then your device will be locked.

I ve tested it in my Touch Pro 2 and works.

I really needed it and maybe other people are in the same situation.

Dani
 

Attachments

  • lock.jpg
    lock.jpg
    54.3 KB · Views: 15,168
  • LockDevice_V1.6.CAB
    45.3 KB · Views: 20,252
Last edited:
  • Like
Reactions: mr_grisha

DaVince

Senior Member
Aug 26, 2006
799
34
39
Manila
It doesn't seem to do anything on my Touch HD. I tried turning off and on, nothing. Tried soft resetting, tried again. Nothing. I even tried running it from File Explorer on the LockDevice folder (Maybe it needs to instantiated or something), then tried turning off and on again. Nothing. :(

EDIT: Oh ok... It doesn't work if you just turn it off then on immediately (which is a good thing). It had to be off for at least 3 seconds. Although there is a second delay before it locks after turning it on, which is ok I guess. Nonetheless, this is good stuff! Since it's the first one I've seen that is not memory resident (which makes me wonder.. how does it work??).
 
Last edited:

danielherrero

Senior Member
Oct 3, 2006
3,280
247
Madrid
www.softwaredhr.es
It doesn't seem to do anything on my Touch HD. I tried turning off and on, nothing. Tried soft resetting, tried again. Nothing. I even tried running it from File Explorer on the LockDevice folder (Maybe it needs to instantiated or something), then tried turning off and on again. Nothing. :(
I ve reuploaded it to avoid to hang a call :D
Do you ve \windows\endkey.exe ?
Is it configured to lock the device?
If you suspend the device and quickly press the power button then the device really isnt suspended so It doesnt work. The device must be screen off several seconds (5-10) to consider itself suspended.....
 

Attachments

  • LockDevice.CAB
    17.6 KB · Views: 825

danielherrero

Senior Member
Oct 3, 2006
3,280
247
Madrid
www.softwaredhr.es
It doesn't seem to do anything on my Touch HD. I tried turning off and on, nothing. Tried soft resetting, tried again. Nothing. I even tried running it from File Explorer on the LockDevice folder (Maybe it needs to instantiated or something), then tried turning off and on again. Nothing. :(

EDIT: Oh ok... It doesn't work if you just turn it off then on immediately (which is a good thing). It had to be off for at least 3 seconds. Although there is a second delay before it locks after turning it on, which is ok I guess. Nonetheless, this is good stuff! Since it's the first one I've seen that is not memory resident (which makes me wonder.. how does it work??).
Remember to install the new one or the program will hang a incomming call if the device is suspended :)
When the program starts the first time it register itself to windows to be notified when the device wakes up.
So when the device wakes up Windows execute the LockDevice.exe with an argument "AppRunAfterWakeup". Then the program check if there isnt a call in progress and then execute \windows\endkey.exe. Simple :)
 

DaVince

Senior Member
Aug 26, 2006
799
34
39
Manila
Tried the new cab on my Touch HD (Running WM6.1). Everything works ok so far.
Thanks a lot for this! I prefer this solution since this the simplest most efficient one that makes use of the built in Lock.
 

chronodrago

Member
Dec 11, 2008
15
0
awesome app dude. well done. i was wondering though, since its possible to run an app on device wake up...is there a way to call upon an app when the device is set into suspend? cause even though the device's screen isnt on, stuff is still running, so what if a reg entry like the "on device wake up" is used as a "device suspend". that would get rid of the 1 sec wait on wake up and also still not be resident. i actually dont know if there is a way to do that, i dont fully comprehend it but it was an idea. cause it would be sick to be able to get rid of the 1 sec wait.
 

danielherrero

Senior Member
Oct 3, 2006
3,280
247
Madrid
www.softwaredhr.es
awesome app dude. well done. i was wondering though, since its possible to run an app on device wake up...is there a way to call upon an app when the device is set into suspend? cause even though the device's screen isnt on, stuff is still running, so what if a reg entry like the "on device wake up" is used as a "device suspend". that would get rid of the 1 sec wait on wake up and also still not be resident. i actually dont know if there is a way to do that, i dont fully comprehend it but it was an idea. cause it would be sick to be able to get rid of the 1 sec wait.
Hi¡
You can, but using a resident process. The feature I used in the "wake up" process isnt avaible in that way for "before going to sleep". A process can register itself to get notifications about changes in power state (From On state to suspended state)(RequestPowerNotifications api). So you could do some stuff when the device goes to idle state (screen off) but It requires the process to stay running in memory. Really It would be "paused" waiting for a queue event but spending one of the 32 available process in WinMo. Later I will upload a little process doing that. Just for try and play ;)
Dani
 

danielherrero

Senior Member
Oct 3, 2006
3,280
247
Madrid
www.softwaredhr.es
Hi
I ve uploaded in first post a more optimized version. Now the program can lock the device by itself instead of rely on call sendkey.exe. So smaller and more efficient. To avoid the 2-3 seconds needed to be suspended to make it work correctly I ve done other version that monitors the power state. It locks the device when the screen goes off (instead of when the device wakes up) but it spend one process (WinMo only can run 32 process at same time). Question of tastes...
The reason about 3-4 seconds needed to wait between power off / power on is this:
When you press power off, the screen goes off (power idle state) but the system needs some seconds to really be suspended. Its in this way because windows notifies drivers about the power event and they must adjust their power levels....So if you press power off and quickly power on then the device really didt was suspended so It isnt really being woken up and the program isnt called by windows :D
Dani
 

Nagrom Nniuq

Inactive Recognized Developer
Dec 12, 2007
784
24
Works well on the Vogue, though sometimes there seems to be a huge delay before the lock screen launches. It seems random though.
 

danielherrero

Senior Member
Oct 3, 2006
3,280
247
Madrid
www.softwaredhr.es
Once the screen is off you must wait 3 or 4 seconds before press power on to make it works. Only after that amount of time windows really suspend the device and triggers the wake up event when power on. This time is bigger if wifi is enabled. Tomorrow I will upload a version that locks the device when the screen goes off. It will be even smaller. But it has an inconvenient:will be resident....
Dani
 

danielherrero

Senior Member
Oct 3, 2006
3,280
247
Madrid
www.softwaredhr.es
hi.
Tomorrow I will post a new version with 3 options.
1)work mode: lock on wake up (no resident but you ve to wait some seconds between power off / on to lock or lock when screen goes off.(works always but resident)
2)Lock or unlock when suspended and the phone rings. If the device is locked you can pick up/hang the call but you cant activate speakers, for example
3)Enabled / Disabled
Dani
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    change's log
    V1.6 2009-09-11
    Phone doesnt lock if there is a call in progress
    V1.5 2009-08-26
    1) Added an option to lock the device when a player (HTC player, WM Player, HTC FM Radio, etc) turns the screen off...
    V1.4 2009-08-14
    1) Added command argument. "lock". this will lock the device.
    2) Added a link called "Lock Now" to lock now....
    3) All the links are located in a folder called "Lock Device". (because there are 4 links and I dont want to fill the directory \windows\start menu (in your language) with many links
    V1.3 2009-08-04
    1) Commands support. The program LockDeviceGUI.exe supports 4 commands.
    1. enabled -> Enable LockDevice
    2. disabled -> Disable LockDevice
    3. wakeup -> Run Mode: Lock on wakeup
    4. screenoff -> Run Mode: Lock on screen off
    Your can set one or two parameters. For example:
    • 61#"\Archivos de programa\LockDevice\LockDeviceGUI.exe" disabled -> Disable LockDevice
    • 61#"\Archivos de programa\LockDevice\LockDeviceGUI.exe" enabled screenoff -> Enable LockDevie and run mode set to "lock on screen off"
    The installer creates out of the box two links in the system programs folder: EnableLock.lnk and DisableLock.lnk (The first with "enabled" parameter and the second one with "disabled" parameter).

    V1.2 2009-08-03
    1) The installer includes a little GUI program.
    icon.jpg

    With this program you can configure how LockDevice must behave.
    View attachment 211920
    1) Enabled / Disabled
    2) Work Mode:
    2.1) Lock on wakeup. This is how works previous version. Pros: The program doesnt stay resident. Cons: The device must be "off" some seconds before windows really suspend the device. This time is longer with wifi active. So if you press power off and then power on quickly probably the device wont lock (because windows never suspended the device)
    2.2) Lock on Screen off. Pros: The device is locked when the screen goes off so always works correctly. Cons: The program stays resident. Anyway the program is "paused" all the time so no CPU is used. the program stays sleeping until windows notifies it the screen is off. Then LockDevice lock the device and goes to sleep again :)

    Please report any bug, suggestion, etc...
    Dani
    V1.1 2009-07-31
    1) The device is locked directly using keybd_event. No sendkey.exe call . So smaller, quicker and no dependence of sendkey.exe configuration.

    Initial post
    Hi
    Today I ve been searching for a very little program, not resident in memory to lock my device on wakeup. There are other ones but I didnt find one that isnt resident in memory.
    So I ve done quickly a very small program that is notified by windows when the device is woken up, so no resident, and executes \windows\endkey.exe. So if you ve configured your end key long press to lock the device then your device will be locked.

    I ve tested it in my Touch Pro 2 and works.

    I really needed it and maybe other people are in the same situation.

    Dani