Is it possible to create Control Panel Applet with c#? RRS feed

  • Question

  • Hi All,

    Now I need to create a Control Panel Applet.
    I found a couple of examples.
    All of them use c++.
    I prefer using c#.
    So I need to know is it possible to create that with c#?
    If yes, could you please give same example?

    Monday, May 11, 2009 9:09 PM


All replies

  • You'll need at least some C++/CLI.  The .cpl file must export a function named CPlApplet, the entry-point for the applet.  Much like WinMain().  Only C++/CLI can give you that export with the extern "C" and __declspec(dllexport) directives.  The compiler will automatically create a stub for this export that loads the CLR.  Once there, you can call your C# code.
    Hans Passant.
    Monday, May 11, 2009 10:00 PM
  • Hang-on, that was old-skool.  Reading some more, you can do it by hacking the registry.

    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Monday, May 18, 2009 2:00 PM
    Tuesday, May 12, 2009 3:40 AM
  • Thank you nobugz,

    That fully answered my question.
    Monday, May 18, 2009 3:53 PM