Archive for August, 2007

Moto Q Flashlight 0.1

Wednesday, August 29th, 2007

Moto Q Flashlight allows the user to control the state of the camera flash. It has three modes of operation: Normal, Strobe, and Morse Code. The application consists of a Win32 DLL written in Visual C++ that exposes the native API to control the camera flash and a GUI written in Visual C#. Click here for more info.

Controlling the camera flash on the Moto Q (and other Windows Mobile devices?)

Tuesday, August 28th, 2007

There is an application out there for the Moto Q that allows you to enable / disable the camera flash and use it like a flashlight. I think it’s a great idea and could be a very useful application. Being cheap and a programmer I set out to code my own solution rather than fork over the $4.95 or make a keygen (seriously, why wrap the flash control functions in a C++ DLL but expose your key verification function in an unobfuscated IL binary ;). Ok you caught me I wrote a keygen and then moved on heh )

Thanks to the awesome support team at MOTODEV for pointing me towards the DeviceIoControl API:

The camera flash light can be controlled as a COM-port using “CAM1:” as a device.

Use the CreateFile() call to get a handle the camera driver, with the filename “CAM1:”.

Then use this file handle to make a call to DeviceIoControl() using the IOCTL (see the code below) and set the ‘Value’ value with a DWORD variable. 0=flash off and any other value=flash on.

The code shown below will change the state of the flash on a Moto Q. I’ve started work on a Win32 DLL to expose the native functions to a VB.NET or C# project. I’d like to start using C# more so I’ll probably write a frontend to control the flash.

HANDLE hCam = NULL;  

CSPROPERTY_CAMERACONTROL_S InputBuffer;
CSPROPERTY_CAMERACONTROL_S OutputBuffer;
ULONG DataLength = sizeof(CSPROPERTY_CAMERACONTROL_S);
ULONG ReturnedLength; // Number of bytes returned in output buffer  

hCam = CreateFile(TEXT("CAM1:"), GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);  

InputBuffer.Property.Set = PROPSETID_VIDCAP_CAMERACONTROL;
InputBuffer.Property.Id = CSPROPERTY_CAMERACONTROL_FLASH;
InputBuffer.Property.Flags = CSPROPERTY_TYPE_SET;
InputBuffer.Flags = CSPROPERTY_CAMERACONTROL_FLAGS_MANUAL;
InputBuffer.Value = 1;  //1==flash on, 0==flash off  

if (!DeviceIoControl(hCam, IOCTL_CS_PROPERTY, &InputBuffer, DataLength, &OutputBuffer, DataLength, &ReturnedLength, NULL))
{
    DWORD errCode = GetLastError();
}

WMReboot 0.2

Friday, August 24th, 2007

WMReboot is a simple Visual Basic .NET 2.0 application to reboot your Windows Mobile 5 device. The application calls SetCleanRebootFlag and KernelIoControl API from coredll.dll to perform the reboot operation. All testing was done on my Moto Q. Click here for more info.

WMStopWatch 0.3

Thursday, August 23rd, 2007

Just a quick update to release the CAB installer for WMStopWatch. I’ll go back and build a CAB for Moto Q Tweaker as well. Find the release here.

WMStopWatch 0.2

Wednesday, August 22nd, 2007

Grrr… I couldn’t stand the fact that such a simple application didn’t work well on different screen resolutions. This update should render better on most (all?) screen resolutions. Click here for more info.

WMStopWatch 0.1

Wednesday, August 22nd, 2007

So the other day I needed a stop watch and couldn’t find one. Figured I’d write a quick application for my Moto Q and WMStopWatch was born. WMStopWatch is a very simple stopwatch-like application for Windows Mobile devices written in VB.NET 2.0.  Source code and release can be found here.

Moto Q Tweaker 0.2

Friday, August 10th, 2007

Moto QJust a small update to the Moto Q Tweaker program to remove some leftover debug code and improve the Tweak.IsEnabled() function. Find the updated release here.

Moto Q Tweaker 0.1

Monday, August 6th, 2007

Moto QThe first application I’ve released for Windows Mobile is now on-line. Moto Q Tweaker is written in VB.NET 2005. The purpose of this application is to allow users to quickly enable/disable certain registry tweaks on the Motorola Q. Click here for more info.

Back to the default theme

Monday, August 6th, 2007

computer_nerd.jpgWas running into some issues with the Nightfall theme. Pretty swamped right now so I figured I’d switch back to the default theme rather than fixing the broken one. Gallery and the random picture are not accessible from the main page until I figure out what to do with the broken theme.

Motorola Q

Friday, August 3rd, 2007

moto_q_sprint.jpgOn Tuesday I picked up a new Motorola Q from Sprint. So far I’m impressed with how easy it has been to use and the ammount of features it has. I’m a code junkie at heart and have been loving the fact that I can write VS.NET apps and debug them on the phone. Just found Broadcom has released their Bluetooth SDK so I’m working on a simple app to toggle the Bluetooth state without having to navigate several different menus.