Most of Win32 functions are user friendly. Not as user friendly as .NET framework, but once you see specification, everything is clear. There is no problem translating it to P/Interop call.
But there is one issue that may be problematic - unions. They are used in C++ programs in order to force multiple variables to use same memory space. We will use INPUT structure as example here:
typedef structtagINPUT{DWORD type;
union {MOUSEINPUT mi;KEYBDINPUT ki;HARDWAREINPUT hi;};} INPUT,*PINPUT;
If you are interested in this topic, you may wish to check this blog at later times also. I will be adding more detailed explanations of VHD API and updates to this C# implementation.
P.S. If you get “Privilege not held” exception message, run Visual Studio 2008 as administrator. VHD API requires elevated rights.
[2009-04-27: Windows 7 RC will have some changes regarding Virtual Disk API. Major ones include changing names of some functions (E.g. what was SurfaceVirtualDisk is now AttachVirtualDisk, what was UnsurfaceVirtualDisk is now DetachVirtualDisk) and structures. Once RC is out and I install it, I will release update of code.]
This is small registry editor which supports supports creating and editing of string, binary, DWord (32-bit), QWord (64-bit), multi-string and expandable-string data types. Additionally to that, there is support for both Smartphone (Windows Mobile Classic) and Pocket PC (Windows Mobile Professional) platform in single executable.
One of features that may help you to decide whether to use it or not is support for both import and export of registry in standard .reg file.
On our desktop systems answer to flickering in Paint event was to use double buffering. .NET Framework supports it out of box and if you do not like built-in solution, there is quite a few solutions out there. Most of them use SetStyle method in order to inform Form that custom draw will be performed.
If you try that in Windows Mobile, you have a problem. Not only that there is no SetStyle, but you must remember that your application needs to work when rotated (all mobiles with keyboard need rotation too).
Solution is to create your own double-buffered class. Whole idea is rather simple, create bitmap with size of control (client area only) and draw everything to it. Once you have drawn everything you need, paint this bitmap over your control. Since this will be done in single operation, no blinking will occur. Be sure to override PaintBackground method also. If you forget that, you will still have flicker since painting will be done in two passes. First pass will be erasing background - usually in white, and second pass is drawing your buffer. Such sudden changes between white and non white tend to be noticeable.
I often have need to compare two files. Usually, I just use PSPad compare, but that tool can be quirky at best.
I tried lot of stand-alone freeware programs for that purpose, but SourceGear’s DiffMerge was one I selected. It just works (and it works fast). Along standard features for such programs, there are two features that made it special to me.
First one that I liked a lot is capability to show changes within line. It will show you exactly which characters were changed. You can quickly see what was really changed and what was just small correction. Another one is integration inside Windows Explorer. While most programs do this, this one does it properly even on 64-bit systems. That was problem for all others I tried.
If you are looking for file compare program, try this one. There are lot of features inside that I didn’t mention and program is really easy to use.