本文整理汇总了C#中LowLevelKeyboardProc类的典型用法代码示例。如果您正苦于以下问题:C# LowLevelKeyboardProc类的具体用法?C# LowLevelKeyboardProc怎么用?C# LowLevelKeyboardProc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LowLevelKeyboardProc类属于命名空间,在下文中一共展示了LowLevelKeyboardProc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Freezeform
public Freezeform()
{
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
objKeyboardProcess = new LowLevelKeyboardProc(captureKey);
ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);
InitializeComponent();
}
开发者ID:Jguer,项目名称:Timed-Commands,代码行数:8,代码来源:Freezeform.cs
示例2: SetHook
private static IntPtr SetHook(LowLevelKeyboardProc proc)
{
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
}
}
开发者ID:nvelozsavino,项目名称:ardrone,代码行数:8,代码来源:InterceptKeys.cs
示例3: AutoTyper
/// <summary>
/// Default constructor
/// </summary>
/// <param name="autoTypedText">List of autotyped text</param>
public AutoTyper(string[] autoTypedText)
{
for (int i = 0; i < Math.Min(autoTypedText.Length, this.AutoTypedText.Length); i++)
{
this.AutoTypedText[i] = autoTypedText[i];
}
_proc = new LowLevelKeyboardProc(HookCallback);
_hookId = SetHook(_proc);
}
开发者ID:nmariot,项目名称:AutoTyper,代码行数:13,代码来源:AutoTyper.cs
示例4: Hook
public Hook(LowLevelKeyboardProc callback)
{
this._Callback = GCHandle.Alloc(callback);
if ((this._Handle = NativeMethods.SetWindowsHookExW(NativeMethods.WH_KEYBOARD_LL, Marshal.GetFunctionPointerForDelegate(callback), NativeMethods.GetModuleHandle(), 0)) == IntPtr.Zero)
{
throw new Win32Exception();
}
}
开发者ID:Goletas,项目名称:screencapture,代码行数:9,代码来源:Hook.cs
示例5: MainWindow
//*****************************************************************************************/
/**
* Constructor
* */
public MainWindow()
{
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule; //Get Current Module
objKeyboardProcess = new LowLevelKeyboardProc(captureKey); //Assign callback function each time keyboard process
ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0); //Setting Hook of Keyboard Process for current module
InitializeComponent();
Init();
}
开发者ID:anthonyhiga,项目名称:toddlertyper,代码行数:13,代码来源:window.cs
示例6: SetHook
private static IntPtr SetHook(LowLevelKeyboardProc lowLevelKeyboardProc)
{
using (var currentProcess = Process.GetCurrentProcess())
{
using (var mainModule = currentProcess.MainModule)
{
return SetWindowsHookEx(WhKeyboardLl, lowLevelKeyboardProc, GetModuleHandle(mainModule.ModuleName), 0);
}
}
}
开发者ID:jasemagee,项目名称:KeyLogger,代码行数:10,代码来源:Program.cs
示例7: SetHook
public IntPtr SetHook(LowLevelKeyboardProc proc)
{
_addKey = AddKeyPress;
using (var currentProcess = Process.GetCurrentProcess())
using (var currentModule = currentProcess.MainModule)
{
return SetWindowsHookEx(WhKeyboardLl, proc,
GetModuleHandle(currentModule.ModuleName), 0);
}
}
开发者ID:MattBroyles,项目名称:CustomKeyboardLightingController,代码行数:11,代码来源:KeyboardHook.cs
示例8: SetHook
public void SetHook(Action<int> hook)
{
if (Set)
{
return;
}
Hook = hook;
Set = true;
_proc = new LowLevelKeyboardProc(HookCallback);
_hookID = SetHook(_proc);
}
开发者ID:pJqEM5Kj,项目名称:stuff,代码行数:12,代码来源:KeyInterceptor.cs
示例9: ClioGUI
public ClioGUI()
{
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
objKeyboardProcess = new LowLevelKeyboardProc(captureKey);
ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
//this.TopMost = true;
}
开发者ID:rxgranda,项目名称:ClientClio,代码行数:12,代码来源:ClioGUI.cs
示例10: BeginCapture
public static void BeginCapture()
{
s_proc = new LowLevelKeyboardProc(HookProc);
s_hook = SetWindowsHookEx(WH_KEYBOARD_LL,
s_proc,
GetModuleHandle(Process.GetCurrentProcess().MainModule.ModuleName),
0);
AppDomain.CurrentDomain.DomainUnload += delegate
{
if (s_hook != IntPtr.Zero)
UnhookWindowsHookEx(s_hook);
};
}
开发者ID:kokeiro001,项目名称:AutoMinesweeperSolver,代码行数:13,代码来源:GlobalKeyboardCapture.cs
示例11: frmRemote
public frmRemote()
{
InitializeComponent();
Text = "FreeRDC - " + HostID;
bgMonitor = new BackgroundWorker() { WorkerSupportsCancellation = true };
//Get Current Module
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
//Assign callback function each time keyboard process
objKeyboardProcess = new LowLevelKeyboardProc(CaptureKey);
//Setting Hook of Keyboard Process for current module
ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);
}
开发者ID:darkguy2008,项目名称:FreeRDC,代码行数:13,代码来源:frmRemote.cs
示例12: KeyboardHook
private KeyboardHook(KeyboardShortcut shortcut, Action callback)
{
_shortcut = shortcut;
_callback = callback;
// ReSharper disable once RedundantDelegateCreation
_proc = new LowLevelKeyboardProc(HookCallback);
using (var curProcess = Process.GetCurrentProcess())
{
using (var curModule = curProcess.MainModule)
{
_hookID = SetWindowsHookEx(WH_KEYBOARD_LL, _proc, GetModuleHandle(curModule.ModuleName), 0);
}
}
}
开发者ID:olivierdagenais,项目名称:GoToWindow,代码行数:16,代码来源:KeyboardHook.cs
示例13: GiveExam
public GiveExam(string str)
{
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule; //Get Current Module
objKeyboardProcess = new LowLevelKeyboardProc(captureKey); //Assign callback function each time keyboard process
ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0); //Setting Hook of Keyboard Process for current module
y_student = str; // data from student
InitializeComponent();
radButton3.Visible = false;
label3.Text = y_student;
radScrollablePanel_takeexam1.Visible = true;
radScrollablePanel_takeexam.Visible = false;
radScrollablePanel_takeexam.Dock = DockStyle.Fill;
radScrollablePanel_takeexam1.Dock = DockStyle.Fill;
}
开发者ID:prakulgupta,项目名称:Miniproject-AdaptiveExam_Toolkit,代码行数:19,代码来源:GiveExam.cs
示例14: InstallHook
/// <summary>
/// Hook install method.
/// </summary>
public static void InstallHook()
{
if (IsHookInstalled) return;
hModule = Marshal.GetHINSTANCE(AppDomain.CurrentDomain.GetAssemblies()[0].GetModules()[0]);
hookDel = new LowLevelKeyboardProc(HookProc);
if (localHook)
hHook = SetWindowsHookEx(HookType.WH_KEYBOARD,
hookDel, IntPtr.Zero, AppDomain.GetCurrentThreadId()); // Если подчеркивает необращай внимание, так надо.
else
hHook = SetWindowsHookEx(HookType.WH_KEYBOARD_LL,
hookDel, hModule, 0);
if (hHook != IntPtr.Zero)
hookInstall = true;
else
throw new Win32Exception("Can't install low level keyboard hook!");
}
开发者ID:DenprogIS,项目名称:Charles,代码行数:22,代码来源:Hook.cs
示例15: SetHook
public IntPtr SetHook(LowLevelKeyboardProc proc)
{
timerKeySaver.Tick += timerKeySaver_Tick;
timerKeySaver.Enabled = true;
if (Application.OpenForms.Count > 0)
{
timerKeySaver.Interval = Form1.KeySaverTime;
if (Form1.UseKeysaver)
{
timerKeySaver.Enabled = true;
timerKeySaver.Start();
}
}
addkey = AddKeyPress;
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(WH_KEYBOARD_LL, proc,
GetModuleHandle(curModule.ModuleName), 0);
}
}
开发者ID:DC999,项目名称:LogitechVentMonitor,代码行数:23,代码来源:KeyboardHook.cs
示例16: SetWindowsHookEx
private static extern IntPtr SetWindowsHookEx(int id, LowLevelKeyboardProc callback, IntPtr hMod, uint dwThreadId);
开发者ID:prakulgupta,项目名称:Miniproject-AdaptiveExam_Toolkit,代码行数:1,代码来源:GiveExam.cs
示例17: SetWindowsHookEx
public static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
开发者ID:bihai,项目名称:carnac,代码行数:1,代码来源:Win32Methods.cs
示例18: SetWindowsHookEx
static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc callback, IntPtr hInstance, uint threadId);
开发者ID:quibsorg,项目名称:CSGO-Open-Source-Base-External,代码行数:1,代码来源:Form1.cs
示例19: CatchSpecialKeyCombos
private void CatchSpecialKeyCombos()
{
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
objKeyboardProcess = new LowLevelKeyboardProc(captureKey);
ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);
}
开发者ID:LatteShare,项目名称:LatteGrab-for-Windows,代码行数:6,代码来源:ScreenshotWindow.xaml.cs
示例20: Form1
public Form1()
{
trackLastTypedTime();
InitializeComponent();
_proc = HookCallback; //Moved this from the fields to inside the constructor...
//so I could change all the methods trying to change the non-static
//secondsSinceLastTyped label to non-static methods.
applicationEnabled = true;
makeEmptyDataGridView();
//InitializeMyScrollBar();
//notifyIcon = new NotifyIcon();
//notifyIcon.Visible = true;
//notifyIcon.Icon = SystemIcons.Application;
//-------Keylogging stuff------------
//var handle = GetConsoleWindow();
//// Hide
//ShowWindow(handle, SW_HIDE);
//These lines are neccesary for the printing of keys pressed to the console
_hookID = SetHook(_proc);
Application.Run(this);
UnhookWindowsHookEx(_hookID);
//-------End Keylogging stuff------------
//typedChars = ""; //initialize typedChars to empty string
}
开发者ID:badjr,项目名称:Macro-Project,代码行数:32,代码来源:Form1.cs
注:本文中的LowLevelKeyboardProc类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论