cerapiinit (rapi)
Last changed: Le Sage-194.51.181.168

.
Summary
This function attempts to initialize the Windows CE remote application programming interface (RAPI) and initially returns an event handle

C# Signature:

[DllImport("rapi.dll")]
public static extern void CeRapiInitEx(ref RAPIINIT pRapiInit);

User-Defined Types:

[StructLayout(LayoutKind.Sequential)]
public struct RAPIINIT
{
    public int cbsize;
    public IntPtr heRapiInit;
    public UInt32 hrRapiInit;
};

Notes:

HRESULT translates to void (NOT int or anything else some idiot has written down) for c# function prototypes. Any HRESULT other than "OK" will cause the runtime to throw an exception.

function info on msdn at http://msdn.microsoft.com/en-us/library/aa458381.aspx

Tips & Tricks:

Please add some!

Sample Code:

RAPIINIT r = new RAPIINIT();
r.cbsize = Marshal.SizeOf(r);
CeRapiInitEx(ref r);
//r.hrRapiInit==0 indicates success

Alternative Managed API:

Documentation