I installed the Synaptics driver, therefore I can disable/enable the touchpad by hand.
Here is the way I’m using to enable/disable touchpad by C#:
private void Switch_Mouse(int i = 0) // 1: Enable, 0: Disable
{
Process.Start("control.exe", "main.cpl");
Thread.Sleep(1000);
int iHandle = FindWindow(null, "Mouse Properties");
SetForegroundWindow(iHandle); // Line ABC
SendKeys.Send("^+{TAB}");
if (i == 1)
{
SendKeys.Send("%E");
}
else
{
SendKeys.Send("%D");
SendKeys.Send("{Enter}");
}
SendKeys.Send("%A");
SendKeys.Send("{Enter}");
}
It sends keystrokes to the Mouse Properties. But after line labeled // ABC (above), the Mouse Properties app loses focus and it doesn’t work.
Is there any other way to enable/disable the trackpad by C#?
(OS: Window 32 bits).
This forum has a topic in which apparently the issue has been figured out (it’s all VB but porting to C# is quite straight-forward fortunately) -> Controlling Synaptics Touchpad
Looks like all touchpad-related handling starts here:
It’s taken from the Synaptics SDK which, as they state, is available here Synaptics SDK along with Developer Manuals