C# 使用API屏蔽系统热键和任务管理器_C/C++语言_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

C# 使用API屏蔽系统热键和任务管理器

作者:黑客防线网安C/C++教程基地 来源:黑客防线网安C/C++教程基地 浏览次数:0

本篇关键词:任务管理系统屏蔽
黑客防线网安网讯:    using System;  using System.IO;  using System.Reflection;  using System.Runtime.InteropServices;  using System.Windows.Forms;  namespace WAT.PMS  {  /**//// <...
    using System;
  using System.IO;
  using System.Reflection;
  using System.Runtime.InteropServices;
  using System.Windows.Forms;
  namespace WAT.PMS
  {
  /**//// <summary>
  /// Description: Hook Helper类可以屏蔽一些热键并屏蔽任务管理器
  /// Author: ZhangRongHua
  /// Create DateTime: 2009-6-19 20:21
  /// UpdateHistory:
  /// </summary>
  public class HookHelper
  {
  Delegates#region Delegates
  public delegate int HookProc(int nCode, Int32 wParam, IntPtr lParam);
  #endregion
  变量声明#region 变量声明
  private HookProc KeyboardHookProcedure;
  private FileStream MyFs; // 用流来屏蔽ctrl alt delete
  private const byte LLKHF_ALTDOWN = 0x20;
  private const byte VK_CAPITAL = 0x14;
  private const byte VK_ESCAPE = 0x1B;
  private const byte VK_F4 = 0x73;
  private const byte VK_LCONTROL = 0xA2;
  private const byte VK_NUMLOCK = 0x90;
  private const byte VK_RCONTROL = 0xA3;
  private const byte VK_SHIFT = 0x10;
  private const byte VK_TAB = 0x09;
  public const int WH_KEYBOARD = 13;
  private const int WH_KEYBOARD_LL = 13;
  private const int WH_MOUSE = 7;
  private const int WH_MOUSE_LL = 14;
  private const int WM_KEYDOWN = 0x100;
  private const int WM_KEYUP = 0x101;
  private const int WM_LBUTTONDBLCLK = 0x203;
  private const int WM_LBUTTONDOWN = 0x201;
  private const int WM_LBUTTONUP = 0x202;
  private const int WM_MBUTTONDBLCLK = 0x209;
  private const int WM_MBUTTONDOWN = 0x207;
  private const int WM_MBUTTONUP = 0x208;
  private const int WM_MOUSEMOVE = 0x200;
  private const int WM_MOUSEWHEEL = 0x020A;
  private const int WM_RBUTTONDBLCLK = 0x206;
  private const int WM_RBUTTONDOWN = 0x204;
  private const int WM_RBUTTONUP = 0x205;
  private const int WM_SYSKEYDOWN = 0x104;
  private const int WM_SYSKEYUP = 0x105;
  private static int hKeyboardHook = 0;
  #endregion
  函数转换#region 函数转换
  [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
  
   //   卸载钩子
  [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  public static extern bool UnhookWindowsHookEx(int idHook);
  //   继续下一个钩子
  [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  public static extern int CallNextHookEx(int idHook, int nCode, Int32 wParam, IntPtr lParam);
  //   取得当前线程编号
  [DllImport("kernel32.dll")]
  private static extern int GetCurrentThreadId();
  [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-15253-1.html
网站维护教程更新时间:2012-04-04 22:52:12  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer