Search code examples
c#windows-mobilecompact-frameworkpinvoke

Compact Framework call Input Method Options with p/invoke


I have implemented a p/invoke command in my compact framework based application which invokes the windows calibrate screen.

[DllImport("coredll.dll")]
    private extern static bool TouchCalibrate();

btnAlignScreen.Click += delegate
        {
            TouchCalibrate();
        };

Does anyone know the p/invoke command to invoke the input settings screen located in Settings -> Input. Windows Mobile 6.1.


Solution

  • You can open up settings applets in the control panel by using the \Windows\ctlpnl.exe executable along with the proper command line arguments.

    This link provides a list of the command line arguments used in the shortcuts in the control panel.

    This example opens up the input method tab in the input settings control panel applet:

    Process myProcess = new Process();
    myProcess.StartInfo.FileName = @"\Windows\ctlpnl.exe";
    myProcess.StartInfo.Arguements = "cplmain.cpl,8";
    myProcess.Start();