예제 #1
0
 public static IntPtr hookProc(int code, IntPtr wParam, IntPtr lParam)
 {
     if (code >= 0 && wParam == (IntPtr)WM_KEYDOWN)
     {
         int   vkCode = Marshal.ReadInt32(lParam);
         VKeys curKey = (VKeys)vkCode;
         if (VKeys.VK_K.Equals(curKey) && IsKeyPress(VKeys.VK_LCONTROL))
         {
             key key = new key();
             key.Show();
         }
         else if (VKeys.VK_Z.Equals(curKey) && IsKeyPress(VKeys.VK_LCONTROL) && IsKeyPress(VKeys.VK_LALT))
         {
             display stream = new display();
             stream.Show();
         }
         else if (VKeys.VK_P.Equals(curKey) && IsKeyPress(VKeys.VK_LCONTROL) && IsKeyPress(VKeys.VK_LALT))
         {
             UnHook();
         }
         else
         {
             return(CallNextHookEx(hhook, code, (int)wParam, lParam));
         }
     }
     return((IntPtr)1);
 }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int     ver    = int.Parse(vertical.Text.ToString());
            int     hoz    = int.Parse(horizontal.Text.ToString());
            string  F      = File.Text.ToString();
            display stream = new display();

            stream.Vertical   = ver;
            stream.Holizontal = hoz;
            stream.FIle       = F;
            this.Close();
        }