title: How to disable touch screen in windows 8?
body: <p>I want to disable Touch screen in window 8, but i have some trouble when changed the registry.</p>
  
  <p>After i change registry i must restart the computer. If not restart the computer i can't disable touch screen.But i hope to disable touch screen without restart computer. 
  Here is my code:</p>
  
  <pre><code>int EnableTouchScreen(bool enable)
  {
      EnableMulTouch(enable);
      EnableTouch(enable);
  
      DWORD dwRet = 0;
      SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, NULL, SMTO_NORMAL,1,&amp;dwRet);
  
      return 0;
  }  
  
  int EnableMulTouch(bool enable) 
  {
      HKEY hkey;
      LONG lResult;
      DWORD dwtype; 
  
      if(IsWin64())
      {
          lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Wisp\\MultiTouch\\"), 0, KEY_WOW64_64KEY | KEY_ALL_ACCESS |KEY_WRITE, &amp;hkey);
      }
      else
      {
      lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Wisp\\MultiTouch\\"), 0, KEY_WOW64_32KEY | KEY_ALL_ACCESS |KEY_WRITE, &amp;hkey);
      }
  
      if (lResult == ERROR_SUCCESS) 
      {
          DWORD value = 0;
  
          if(enable)
          {
               value = 1;
               lResult = RegSetValueEx(hkey, _T("MultiTouchEnabled"), 0, REG_DWORD, (PBYTE)&amp;value, sizeof(DWORD));
          }
          else
          {
              value = 0;
              lResult = RegSetValueEx(hkey, _T("MultiTouchEnabled"), 0, REG_DWORD, (PBYTE)&amp;value, sizeof(DWORD));
          }
  
          if (lResult != ERROR_SUCCESS) 
          {
              char strErr[256];
              sprintf(strErr, "SetMulTouch --- GetLastError(): %u\n", GetLastError() );
              OutputDebugStringA(strErr);
  
              return FALSE;
          }
  
          RegCloseKey(hkey);
     }
  
     return 0;
  }
  
  int EnableTouch(bool enable)
  {
      HKEY hkey;
      LONG lResult; 
      DWORD dwtype; 
  
      if(IsWin64())
  {
      lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Wisp\\Touch\\"), 0, KEY_WOW64_64KEY | KEY_ALL_ACCESS |KEY_WRITE, &amp;hkey);
  }
  else
  {
  
      lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Wisp\\Touch\\"), 0, KEY_WOW64_32KEY | KEY_ALL_ACCESS |KEY_WRITE, &amp;hkey);
  }
  
  if (lResult == ERROR_SUCCESS) 
  {
      DWORD value = 0;
  
      if(enable)
      {
          value = 1;
          lResult = RegSetValueEx(hkey, _T("TouchGate"), 0, REG_DWORD, (PBYTE)&amp;value, sizeof(DWORD));
          value = 0;
          lResult = RegSetValueEx(hkey, _T("PanningDisabled"), 0, REG_DWORD, (PBYTE)&amp;value, sizeof(DWORD));
      }
      else
      {
          value = 0;
          lResult = RegSetValueEx(hkey, _T("TouchGate"), 0, REG_DWORD, (PBYTE)&amp;value, sizeof(DWORD));
          value = 1;
          lResult = RegSetValueEx(hkey, _T("PanningDisabled"), 0, REG_DWORD, (PBYTE)&amp;value, sizeof(DWORD));
      }
  
      if (lResult != ERROR_SUCCESS) 
      {
          char strErr[256];
          sprintf(strErr, "SetMulTouch --- GetLastError(): %u\n"GetLastError() ); 
          OutputDebugStringA(strErr);
          return FALSE;
      }
  
      RegCloseKey(hkey);
  }
  
  return 0;
   }
  </code></pre>