Go Back   xda-developers > Windows Mobile Development and Hacking > Windows Mobile Apps and Games


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30th July 2009, 02:54 PM
danielherrero's Avatar
danielherrero danielherrero is offline
Senior Member
 
Join Date: Oct 2006
Location: Madrid
Posts: 2,592
Default [APP]LockDevice [2009-08-26]. Ultralight app to lock after wakeup

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.
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
Attached Images
File Type: jpg lock.jpg (54.3 KB, 5663 views)
Attached Files
File Type: cab LockDevice_V1.6.CAB (45.3 KB, 5625 views)
__________________
www.commmgrpro.com

Last edited by danielherrero; 11th September 2009 at 01:19 PM..
Reply With Quote
Sponsored Links

  #2  
Old 30th July 2009, 03:24 PM
DaVince's Avatar
DaVince DaVince is offline
Senior Member
 
Join Date: Aug 2006
Location: Manila
Posts: 724
Default

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??).
__________________
Everything is possible. Impossible just takes longer.


Current Device:
HTC Touch HD
ROM:
Radio:
Storage:

--
Previous Devices:
Samsung i780
HTC Touch Dual SOLD!
HTC TyTN SOLD!
O2 XDA Exec
Nokia 6630, 3660, 6510 and 3210 Trashed


Last edited by DaVince; 30th July 2009 at 03:34 PM..
Reply With Quote

  #3  
Old 30th July 2009, 03:34 PM
danielherrero's Avatar
danielherrero danielherrero is offline
Senior Member
 
Join Date: Oct 2006
Location: Madrid
Posts: 2,592
Default

Quote:
Originally Posted by DaVince View Post
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
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.....
Attached Files
File Type: cab LockDevice.CAB (17.6 KB, 332 views)
__________________
www.commmgrpro.com
Reply With Quote

  #4  
Old 30th July 2009, 03:40 PM
danielherrero's Avatar
danielherrero danielherrero is offline
Senior Member
 
Join Date: Oct 2006
Location: Madrid
Posts: 2,592
Default

Quote:
Originally Posted by DaVince View Post
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
__________________
www.commmgrpro.com
Reply With Quote

  #5  
Old 30th July 2009, 10:14 PM
danielherrero's Avatar
danielherrero danielherrero is offline
Senior Member
 
Join Date: Oct 2006
Location: Madrid
Posts: 2,592
Default

could some people with other device than mine (tp2) to try if it works ok?
By now all works perfectly without a process spending ram/cpu
__________________
www.commmgrpro.com
Reply With Quote

  #6  
Old 31st July 2009, 07:58 AM
DaVince's Avatar
DaVince DaVince is offline
Senior Member
 
Join Date: Aug 2006
Location: Manila
Posts: 724
Default

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.
__________________
Everything is possible. Impossible just takes longer.


Current Device:
HTC Touch HD
ROM:
Radio:
Storage:

--
Previous Devices:
Samsung i780
HTC Touch Dual SOLD!
HTC TyTN SOLD!
O2 XDA Exec
Nokia 6630, 3660, 6510 and 3210 Trashed

Reply With Quote

  #7  
Old 31st July 2009, 09:21 AM
danielherrero's Avatar
danielherrero danielherrero is offline
Senior Member
 
Join Date: Oct 2006
Location: Madrid
Posts: 2,592
Default

Nice. I thought about write an small resident process that monitors changes of power state to be more efficient but I prefer a process that only runs for a few ms when the device wakes up and then dies...
__________________
www.commmgrpro.com
Reply With Quote

  #8  
Old 31st July 2009, 09:36 AM
chronodrago chronodrago is offline
Junior Member
 
Join Date: Dec 2008
Posts: 11
Default

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.
Reply With Quote

  #9  
Old 31st July 2009, 09:44 AM
danielherrero's Avatar
danielherrero danielherrero is offline
Senior Member
 
Join Date: Oct 2006
Location: Madrid
Posts: 2,592
Default

Quote:
Originally Posted by chronodrago View Post
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
__________________
www.commmgrpro.com
Reply With Quote

  #10  
Old 31st July 2009, 04:51 PM
danielherrero's Avatar
danielherrero danielherrero is offline
Senior Member
 
Join Date: Oct 2006
Location: Madrid
Posts: 2,592
Default

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
Dani
__________________
www.commmgrpro.com
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:06 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.