vait / DroidBackuper

Simple program to execute commands on WPD is plugged in

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DroidBackuper

DroidBackuper is a simple application for copy some user data from your device with Android.

Main idea

The main idea of this project is automatically copy user data from my phone when I connect it to computer. First of all, I need to catch the device plug in event in Windows. Several search in Google requests led me to post on stackoverflow.com (How to identify what device was plugged into the USB slot?)[http://stackoverflow.com/questions/16620509/how-to-identify-what-device-was-plugged-into-the-usb-slot]. It would seem that a solution is found. But I think that solution give very small information about device. I want know more...

Research Windows device information

I found needed information on:

    do
    {
        Win32.SP_DEVINFO_DATA devDataInfo = new Win32.SP_DEVINFO_DATA();
        devDataInfo.cbSize = (uint)Marshal.SizeOf(devDataInfo);
        success = Win32.SetupDiEnumDeviceInfo(classHandle, devCount, ref devDataInfo);
        if (success)
        {
            devCount++;
            devDataInfo.devInst = devCount;
            yield return devDataInfo;
        }
    } while (success);

What I got in the end

This application listening Windows Win32_PnPEntity event, when device plugged in it compare manufacture device and model. If they are all equals application executes commands, and, if need, write full information of plugged device to log file.

Usage

Start application Find in tray icon with clock Open settings Enjoy

License

I don't understand anything in licenses. I'll be very happy if my code can help for you.

PS

Sorry for my English ;)

About

Simple program to execute commands on WPD is plugged in


Languages

Language:C# 100.0%