View Full Version : Titan Flashlight Application
nilisco
20th July 2007, 12:34 AM
Here's a release of a simple flashlight application I created for the mogul based on code Vijay was kind enough to release a while back. Launch the exe once to turn on the camera light, launch it again to disable.
That's the only feature! I've messaged vijay with the value he needs to update his application with mogul support, so I hope he'll do that in the future if he has time. But until then, I whipped up this.
It might be buggy and it isn't quite the fastest application out there (I wish I knew how to query the camera for the current status of the LED) but it's a neat little tech demo that someone might find useful. I'll post the source code later after I have a chance to clean it up.
Report back with any problems as I've only tested this on my device! (Sprint Mogul)
Also, here's the obligatory "this program could possible harm your device and I take no responsibility for such an event." Use with caution and I wouldn't recommend leaving this on for long periods of time.
I'm using it with AEBPlus and have it bound to my camera key.
wowthatisrandom
20th July 2007, 02:34 AM
GREAT WORK! ya i know.... the reason i made the script is 1 for a safety catch and 2 for ikandy...
the script will turn the light on for 30 sec and hten off... 60 sec the off.. or let u do it manually... i personally know i hit buttons sometimes so i set my side button to the 30 sec script...
heres the beta script the icons dont work perfect yet but hell for those of u who cant wait let me introduce... Flashlight by Nilisco WoW and Stroths
**THIS NO LONGER NEEDS MORTSCRIPT!**
daclothe
20th July 2007, 04:14 AM
ahhhh we have been waiting for this one...good work guys, can't wait to get this tested!
wowthatisrandom
20th July 2007, 04:46 AM
ahhhh we have been waiting for this one...good work guys, can't wait to get this tested!
thanks but dont give me the credit ... this one is ALL Nilisco :-)
ViPaDawG
20th July 2007, 03:35 PM
anyone know how to add a icon to it, so when it shows up on my quicklaunch for the HTC home tab, it has a pretty little icon?
wowthatisrandom
21st July 2007, 05:14 AM
cab updated .... mortscript no longer needed
nilisco
21st July 2007, 07:22 PM
Vijay's code was the key:
void fn_FlashMode(int Mode_int)
{
HANDLE CamHandle;
//1=on
//2=off
//DWORD FlashMode=1;
//open camera
CamHandle = CreateFile(TEXT("CIF1:"), GENERIC_READ, 0, NULL, 3, 0, NULL);
//Mogul specific device io
DWORD a=0x90002014;
DeviceIoControl(CamHandle, a, LPVOID(&Mode_int), sizeof(Mode_int), 0, NULL, NULL, NULL);
CloseHandle(CamHandle);
}
The only challenge in getting the flashlight working was to find the mogul io, which was right in the htc camera dll. The only way developers can communicate with it (I believe) is the DeviceIoControl win32 function, which is abstracted into functions in the camera dll. So, you just disassemble the driver dll, look for a DeviceIoControl command that looks to have something to do with flash, and bam, you've found the IO as it's a parameter in the function.
http://img525.imageshack.us/img525/2737/iosd5.png
I didn't bother with the rest of my code (mainly just win32 registry changes to keep track if the light was on or off) as I believe my program will become a bit outdated as soon as someone posts the VJCandela hack they did without his permission. :(
nickutz
22nd July 2007, 06:33 PM
I like this a lot. Also I'm impressed with the brightness of the moguls flash.
sivart321
25th July 2007, 02:03 AM
This works great. Any chance of making a version that stays on only if I am holding the specified button?
Vijay had one of his apps that I could assign to my left side 'press and hold' voice dial key. It would only stay on if I held it down and would also turn off after 15 secs of being held.
The current one works, but I am afraid of it staying on, and would also prefer it to turn off sooner when I am done with it.
So far so good though!
Dishe
25th July 2007, 11:56 PM
This is awesome!
I like the icons too!
Speaking of device-specific code, has anyone considered writing some code to re-route the audio to the internal handset speaker versus the external amplified one?
There are times that I think it would be useful to have audio coming through the handset... like if I want to play back voice recordings for only me to hear (vs the whole world when I play it out loud), or for VOIP apps like Skype. Right now, most voip apps use the outer loud speaker because every device accesses the internal one differently (or so they say).
This is quite a bit more complicated than a flashlite app, but there aren't enough Titan-specific developers yet to ask this anywhere else!
Figured I'd get your thoughts on this idea... what do you think it would take to write a small app to toggle the direction of audio?
kmartburrito
27th July 2007, 05:21 PM
GREAT WORK! ya i know.... the reason i made the script is 1 for a safety catch and 2 for ikandy...
the script will turn the light on for 30 sec and hten off... 60 sec the off.. or let u do it manually... i personally know i hit buttons sometimes so i set my side button to the 30 sec script...
heres the beta script the icons dont work perfect yet but hell for those of u who cant wait let me introduce... Flashlight by Nilisco WoW and Stroths
**THIS NO LONGER NEEDS MORTSCRIPT!**
Just an FYI, my corporate antivirus picked this file up as a Trojan. Has anyone else noticed this?
town229
2nd August 2007, 03:41 AM
Just an FYI, my corporate antivirus picked this file up as a Trojan. Has anyone else noticed this?
ho-li-light we have to be careful then.
Dishe
2nd August 2007, 06:58 AM
Just an FYI, my corporate antivirus picked this file up as a Trojan. Has anyone else noticed this?
no, that's odd... everything looks clean and works fine for me! I wonder why that would happen?
kmartburrito
2nd August 2007, 04:31 PM
I put it on this am and it seems to work great. Nilisco might have me by the cajones, but at least I have a flashlight now :D
Dishe
30th August 2007, 01:09 AM
Does anyone else have this AND LED-killer 2 running?
LED killer appears to have removed my flashlight icons and replaced them with TREO?!
Weird...
stroths
30th August 2007, 03:15 PM
Does anyone else have this AND LED-killer 2 running?
LED killer appears to have removed my flashlight icons and replaced them with TREO?!
Weird...
LED Killer uses the scripticons.dll file for its icon. The flashlight app must have a customized version of this dll with its own icons added. Try uninstalling then reinstalling the flashlight app, soft reset and you will probably be fine. This will cause the flashlight's scripticons.dll to overwrite the LED Killer one.
EDIT: Don't worry about a virus from wowthatisrandom's post. I did a little work with him on this and its clean.
kaos420
3rd March 2008, 08:02 PM
any one know how to add a icon to this exe? its a nice program but sucks that it has no icon...
xxdbkxx
11th March 2008, 06:17 PM
Keep getting message saying......
Couldn't create directory '\Program Files\Nilisco\Flashlight'
Line:
MkDir( msPath )
Any ideas?
JimSmith94
11th March 2008, 07:03 PM
Keep getting message saying......
Couldn't create directory '\Program Files\Nilisco\Flashlight'
Line:
MkDir( msPath )
Any ideas?
You have to install it to main memory. I think I got that message when I tried to install it to the storage card.
simoncinis
12th March 2008, 05:49 PM
This works great. Any chance of making a version that stays on only if I am holding the specified button?
Vijay had one of his apps that I could assign to my left side 'press and hold' voice dial key. It would only stay on if I held it down and would also turn off after 15 secs of being held.
The current one works, but I am afraid of it staying on, and would also prefer it to turn off sooner when I am done with it.
So far so good though!
if you go to the settings screen and then to buttons, you can reprogram any of the buttons on your device to launch the program. I have my voice recognition speeddial button reset to launch the program. Press it once, it turns on, push it again, it turns off. No need to hold down any buttons.
crimekilla
26th March 2008, 04:21 PM
GREAT WORK! ya i know.... the reason i made the script is 1 for a safety catch and 2 for ikandy...
the script will turn the light on for 30 sec and hten off... 60 sec the off.. or let u do it manually... i personally know i hit buttons sometimes so i set my side button to the 30 sec script...
heres the beta script the icons dont work perfect yet but hell for those of u who cant wait let me introduce... Flashlight by Nilisco WoW and Stroths
**THIS NO LONGER NEEDS MORTSCRIPT!**
anybody know if this is still the latest and greatest flashlight app for the mogul.
and does it work without issues
GhettoBSD
30th March 2008, 12:12 PM
thanks!! this is awesome and just what i was looking for.
vince22sh
31st March 2008, 07:41 PM
works great!!! thanks so much
TheSilentman
5th May 2008, 08:09 PM
cool! works great! I put it on the button 5 instead of the Voice SpeedDial who used to dial whoever he wants lol.
Nilisco Flashlight.cab detected as a Virus, hope it isn't.
vijay555
5th June 2008, 12:00 PM
Did anyone ever modify VJCandela to support this device?
V
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.