[General Questions and Answers] Miasnikov:
Hail to community,

Just a useful note from my personal experience:

What:

Getting contacts, sms, mails, and all etc from WM phone with broken touchscreen.

How:

There are two options possible.

1) You have your phone set to connect to PC with ActiveSync.

Well, man, you got lucky... can't even imagine how lucky you are...

Look for MyMobiler123. Install it. Get your screen of you broken phone to your desktop and do whatever you need... PIMBackup, Sync with Outlook - up to you...
​

2) (Mine :)) You got your phone broken when it was set to Connect as Drive

Well, man, you got NO luck :p

But chances are.

Although it mostly depends on what phone you got. For some it might be simply enough to remove (physically) storage card from its nest and phone starts connect as ActiveSync. If you got it - be happy and go to case 1) above.

If not... brace yourself... Tho, the only thing you need to do is to bring your phone to a state 1) described above, its not so easy as it sounds...

If your luck didn't run out completely you can simply connect your phone to PC. Create "autorun.inf" in a root of you storage card with a content like this:

[autorun]
open=autorun.exe

Next, you have to do some coding to create autorun.exe and make it do what you need to. Good if you had .Net installed on you phone. Then its easy...

(Might be worthy to run not .exe but some kind of script, tho I didn't test it)

Now, copy that autorun.exe to the storage card, just like you did with autorun.inf and ...

detach the cord!!! (restart phone if needed, or in-out your storage card).

What happens now is that autorun.exe is executed every time your storage card becomes visible to WM.

(To ensure it works, make log action to log.txt on your storage card, so you could see what goes on up there).

Ok, we are at the point where we able to run our autorun.exe.

Congrats. We got control. :cool:

Now... the last and the most question WHAT this autorun.exe needs to do.

And the answer is simple - to switch USBtoPC from Drive to ActiveSync.

Welcome to Registry :D

What you need is HKLM\Software\OEM\USBtoPC and all the Key within.

Yeah.. and need to shut down HTC popup service if you had one! (this is important).

​

My code was looking like this:

using (StreamWriter stream = File.CreateText(@"test.txt"))
{
stream.WriteLine("OK");

stream.Flush();
stream.Close();
}

RegistryKey key = Registry.LocalMachine;

key = key.OpenSubKey( "Software" );
key = key.OpenSubKey( "OEM" );
key = key.OpenSubKey( "USBtoPC", true );

key.SetValue("SyncMode", 0);
key.SetValue("Device_Type", 2);

And the way to shut down HTC popup service:

REGEDIT4

[HKEY_CURRENT_USER\Software\HTC\BootLauncher\Services\HTCUSBToPCPopUp]
"Module"="\\Windows\\HTCUSBToPCSrv222.dll"
"Prefix"="UTP"
"Index"=dword:00000000
"Info"=dword:00000000
"Order"=dword:0000000a
"Flags"=dword:00000000
"Keep"=dword:00000001
"Context"=dword:00000000
"DisplayName"="HTCUSBToPC Service"
"Description"="USB To PC PopUp Service"

[HKEY_LOCAL_MACHINE\Services\HTCUSBToPCPopUp]
"Order"=dword:0000000a
"Keep"=dword:00000001
"Index"=dword:00000000
"Prefix"="UTP"
"Description"="USB To PC PopUp Service"
"Context"=dword:00000000
"DLL"="HTCUSBToPCSrv222.dll"
"DisplayName"="HTCUSBToPC Service"

May the Force be with you :)