Remove All Ads from XDA

VJCandela - torch/flashlight on HTC Phones

5,790 posts
Thanks Meter: 66
By vijay555, Retired Moderator on 19th February 2006, 04:32 AM
Post Reply Email Thread
Guys, this app will permit control of the flashlight on your Universal as a torch.

It may work on the Wizard and Apache. Please test and report.

This software is semi-commercial.
This means, if you like it and use it, please make a donation on my webpage. I recommend a few pounds.

Donations will go towards future developments. I really need to buy a copy of IDA Pro, which will cost several hundred Euro, and for a hobby, that's too much for me And as you may know, I hope that I won't be the only one to benefit if I can get hold of this program.

The app is currently around 100k. Most of that is the graphics. I will release a lighter version shortly without the graphics if required.

The technique for controlling the torch is very simple - there is a flashlight export in the htccamera*.dll used by the camera.
I don't use this method myself, but it should make it easy to integrate this feature into your own applications.

This kind of programming is made possible with a program like IDA Pro, so please, remember to donate to facilitate future developments :wink:

On my website

19th February 2006, 06:42 AM |#2  
Senior Member
QLD Australia
Thanks Meter: 1
I sent some money anyway, not sure how much, or whether its right or not, i havent even tested it or used it, but thought you deserved some money for the hard work and effort you put into the site and the users.
19th February 2006, 10:08 AM |#3  
Senior Member
Thanks Meter: 3
HTC Wizard
Qtek 9100
ROM: (yep, haven't taken the splash yet)

- Does not turn on camera flashlight - d'oh

- Window opens 'off-center' making its right-most border be out of view

- Window has some painting issues (e.g. blinks colored graphics before being painted over by the grey graphics with many actions)
19th February 2006, 10:29 AM |#4  
Senior Member
QLD Australia
Thanks Meter: 1
works fine on mine.

I didn't need nor use all the bells n whistles, just pres button torch on, press again, torch off.

me, simple needs. need satisfied.
19th February 2006, 11:08 AM |#5  
Senior Member
Thanks Meter: 1
VJ you are truly great, excellent app (will be making a donation for this tomorrow payday lol)

I have installed on universal with hardware key app and program does work wonders long press on then release off but when I give a short press the torch does come on but if I give a short press again am I correct in thinking the torch should go off again well on my universal it doesen't it just flashes and then the torch still stays on I have to then hold the button down for the torch to turn on and then release and it will then go off

hope this makes sense

keep up the good work
19th February 2006, 11:53 AM |#6  
Senior Member
Thanks Meter: 39
This is great - I love your $1000 torch reference - non PDA enthusiasts just don' get it !!
It works on my SPV M5000 but only if the clam is open. It would be great if you could get it to work closed.
Some observations;
1 Assign VJC On either to button or screen and torch is on with clam open, off with clam closed. Back on with clam open.
2 Assign VJC HW to Backlight button, clam open, press button and hold light on until button released. Press button and let go, light stays on. Press button for off and light blinks off but comes straight back on. Press and hold turns it off. However, on first use after device is turned on, the press again for off (without holding)works. Similarly if you close the clam (which turns the light off) open it again (which turns it on) and then press off (without holding) it turns off.
Hope this is of some use (if it makes any sense).
19th February 2006, 12:32 PM |#7  
nolovelust's Avatar
Senior Member
Thanks Meter: 14
only screen off option works

19th February 2006, 12:37 PM |#8  
ei99070's Avatar
Thanks Meter: 15
Donate to Me
Vijay, excellent work!!!!!!

I miself have tried to find such export on htccamera, but with no success! If possible, please post the export here for the comunity!
In other hand, I think that the hardwarekeys cab file you made has an error (at least it shows up on my exec): there's a missing " on the start of the paths (check the registry keys on the cab file and on the machine registry).

Hope you don't mind, I'll post links for your program on a portuguese forum ( so that more and more people can use this magnificent program! And yes, i'll make a donation tomorrow, I promiss
19th February 2006, 12:46 PM |#9  
Senior Member
Thanks Meter: 57
Re: VJCandela - torch/flashlight on HTC Phones
Originally Posted by vijay555

The app is currently around 100k. Most of that is the graphics. I will release a lighter version shortly without the graphics if required.


can you post the source code for "non-gui" part ?
I'm a strong believer in the "such technical information
wants to be free", as you can see from the Universal
19th February 2006, 12:47 PM |#10  
Thanks Meter: 0
£5 - good for a few pints - is on its way!

19th February 2006, 02:52 PM |#11  
vijay555's Avatar
OP Retired Moderator
Witch Space
Thanks Meter: 66
ZeBoxx - I got bored of doing the GUI work, I'm really not going to bother in future. I think I have an unnecessary paint call when moving, have to check. But Mrs Vijay555 wanted to watch Chicken Little, so I just got it out as is...
I only use VGA, but will try to get it to center automatically. I have to also get it to center on screen rotation. It's on my list.

nolovelust: I'll make a correction a little later to fix it for the wizard...

Rick GM: clam control is possible to a degree. I have an interim solution, but wanted to get "no bells and whistles" out first, so to speak. Clam control is universal specific so will try to implement that by device ID shortly.

scotjen1: press and hold the flame to enable the torch. Press the lock to permit torch toggling. It will stay on until you switch it off. Or use the command line.

ei99070: post links anywhere you wish.
The reg key cab is exported from my Universal. Might be a problem, anyone else tried it? This is what I imported:

"Default"=""\Windows\Start Menu\Programs\vijay555\VJCandela\VJCandela HW.lnk""
"Icon"="\windows\Camera.exe, 0"
"Name"="Button Light"

Anyone who wants to know the active code:
void fn_FlashMode(int Mode_int)
	HANDLE CamHandle;

	//DWORD FlashMode=1;

	//open camera
	CamHandle = CreateFile(TEXT("CIF1:"), GENERIC_READ, 0, NULL, 3, 0, NULL); 

	//device io (device specific)
	DWORD a=0x90002024;

	ret=DeviceIoControl(CamHandle, a, LPVOID(&Mode_int), sizeof(Mode_int), 0, NULL, NULL, NULL); 

Very easy to implement, but the device IO is important and is derived from a htccamera*.dll variety of files. This takes some tracking down, without a full ROM dump

If possible, I'll try to work on other models of phones when I get a bit of time.

Many thanks to all who tried it.

Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes