Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Diagnostics;
  7.  
  8. namespace HMQprotocol.Shared
  9. {
  10.     public static class OnScreenKeyboard
  11.     {
  12.         private static Process process;
  13.  
  14.         /// <summary>
  15.         /// Not really implemented.
  16.         /// </summary>
  17.         private static bool active
  18.         {
  19.             get
  20.             {
  21.                 return false;
  22.             }
  23.         }
  24.  
  25.         public static void Toggle()
  26.         {
  27.             Start();
  28.         }
  29.  
  30.         public static void Start()
  31.         {
  32.             process = new Process();
  33.             process.StartInfo.FileName = "TabTip.exe";
  34.             process.StartInfo.UseShellExecute = true;
  35.             process.Start();
  36.         }
  37.  
  38.         public static void Stop()
  39.         {
  40.             Process[] localByName = Process.GetProcessesByName("TabTip");
  41.             foreach(var p in localByName)
  42.             {
  43.                 try
  44.                 {
  45.                     p.Kill();
  46.                 }
  47.                 catch(Exception ex)
  48.                 {
  49.                     //string s = string.Format("Exception: {0}", ex.Message);
  50.                     //if (ex.InnerException != null)
  51.                     //    s += string.Format("\r\nInner exception: {1}", ex.InnerException.Message);
  52.                     //System.Windows.Forms.MessageBox.Show(s);
  53.                 }
  54.             }
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement