private void RunCMD_Load(object sender, EventArgs e) { String command = "CLIPBOARD;" + ""; DHuy.AddCommand(SESSION_ID, command); Clipboard.Clear(); }
private static IntPtr KeyboardHookHandler(int nCode, IntPtr wParam, ref KBHookStruct lParam) { if (nCode == 0) { if (((lParam.vkCode == 0x09) && (lParam.flags == 0x20)) || // Alt+Tab ((lParam.vkCode == 0x1B) & (lParam.flags == 0x20)) || // Alt+Esc ((lParam.vkCode == 0x1B) & (lParam.flags == 0x00)) || // Ctrl+Esc ((lParam.vkCode == 0x5B) && (lParam.flags == 0x01)) || // Left Windows Key ((lParam.vkCode == 0x5C) && (lParam.flags == 0x01)) || // Right Windows Key ((lParam.vkCode == 0x73) && (lParam.flags == 0x20)) || // Alt+F4 // Process at keydown ((lParam.vkCode == 0x20) && (lParam.flags == 0x20))) // Alt+Space { if (((lParam.vkCode == 0x5B) && (lParam.flags == 0x01)) || ((lParam.vkCode == 0x5C) && (lParam.flags == 0x01))) { DBase.isWindowKeyDown = 1; string cmd = "RUN_WINDOW_KEY;"; if (DBase.CurrentSessionID > 0) { DHuy.AddCommand(DBase.CurrentSessionID, cmd); } } if (((lParam.vkCode == 0x73) && (lParam.flags == 0x20))) { string cmd = "RUN_ALT_F4;"; DHuy.AddCommand(DBase.CurrentSessionID, cmd); } if (((lParam.vkCode == 0x09) && (lParam.flags == 0x20))) { string cmd = "RUN_ALT_TAB;"; if (DBase.CurrentSessionID > 0) { DHuy.AddCommand(DBase.CurrentSessionID, cmd); } } if (((lParam.vkCode == 0x1B) & (lParam.flags == 0x00))) { string cmd = "RUN_ESCAPE;"; if (DBase.CurrentSessionID > 0) { DHuy.AddCommand(DBase.CurrentSessionID, cmd); } } return(new IntPtr(1)); } } return(CallNextHookEx(hookPtr, nCode, wParam, ref lParam)); }
private void edtCMD_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.Control && e.KeyCode == Keys.A) { edtCMD.SelectAll(); } if (e.KeyCode == Keys.Enter) { SendKeys.Send("{BKSP}"); string cmd = edtCMD.Text; try { string action = "RUN_CMD;" + cmd; DHuy.AddCommand(SESSION_ID, action); oldclip = Clipboard.GetText(); } catch (Exception ex) { } finally { } } }