网站首页  词典首页

请输入您要查询的函数:

 

术语 lowlevelkeyboardproc
释义 LowLevelKeyboardProc
语法:
LRESULT CALLBACK LowLevelKeyboardProc( int nCode,
WPARAM wParam,
LPARAM lParam
);
LowLevelKeyboardProc功能
该LowLevelKeyboardProc挂钩过程是一个应用程序定义或库定义的回调函数中调用SetWindowsHookEx函数使用。该系统调用该函数每一次新的键盘输入事件即将进入一个线程输入队列张贴。该键盘输入可以来自本地键盘驱动程序或调用keybd_event函数。如果输入的调用keybd_event来,输入是“注入”。然而,WH_KEYBOARD_LL钩子没有注入到另一个进程。相反,上下文切换回安装该钩子过程,是在其原来的上下文中调用。然后,上下文切换回应用程序产生的事件。
在HOOKPROC类型定义一个指向这个回调函数。 LowLevelKeyboardProc是一个应用程序的占位符定义或库定义的函数的名称。
参数
nCode
[in]指定的代码程序,使用挂钩,以决定如何处理该消息。如果nCode小于零,钩子程序必须通过信息,CallNextHookEx函数没有进一步的处理,并应归还CallNextHookEx返回的值。此参数可以是下列值之一。
HC_ACTION
的WPARAM和LPARAM参数包含有关键盘消息的信息。
wParam
[in]指定键盘的消息标识符。此参数可以是以下消息:WM_KEYDOWN,WM_KEYUP,WM_SYSKEYDOWN或WM_SYSKEYUP。
lparam的
[in]指向1 KBDLLHOOKSTRUCT结构。
返回值
如果nCode小于零,钩子程序必须归还CallNextHookEx返回的值。
如果nCode大于或等于零,而挂钩程序并不处理消息,强烈建议您调用CallNextHookEx并返回返回值,否则,已经安装WH_KEYBOARD_LL其他应用程序挂钩将不会收到通知和钩可能行为不正确结果。如果挂钩过程处理的消息,则可能会返回一个非零值,以防止信息传递给钩子链或其他目标窗口程序的系统。
备注
安装的应用程序通过指定WH_KEYBOARD_LL钩子类型和在调用指针挂钩过程的SetWindowsHookEx函数钩子程序。
这被称为钩在安装它的线程上下文。上述呼吁是由发送一个信息,即安装了钩线。因此,安装该挂钩必须有一个消息循环线程。
钩子程序过程中应小于在下面的注册表项LowLevelHooksTimeout值指定的数据录入的时间消息:
HKEY_CURRENT_USER \\控制面板\\桌面
该值以毫秒为单位。如果挂钩过程不会返回在此期间,该系统将信息传递到下一个钩子。
请注意,调试挂钩不能跟踪这种挂钩类型。
功能信息
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryNone
最低经营systemsWindows NT 4.0的SP3的
参见
钩概述,CallNextHookEx,KBDLLHOOKSTRUCT,keybd_event,钩子,WH_KEYBOARD_LL,WM_KEYDOWN,WM_KEYUP,WM_SYSKEYDOWN,WM_SYSKEYUP
==英文原文==LowLevelKeyboardProc Function
The LowLevelKeyboardProc hook procedure is an application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function every time a new keyboard input event is about to be posted into a thread input queue. The keyboard input can come from the local keyboard driver or from calls to the keybd_event function. If the input comes from a call to keybd_event, the input was "injected". However, the WH_KEYBOARD_LL hook is not injected into another process. Instead, the context switches back to the process that installed the hook and it is called in its original context. Then the context switches back to the application that generated the event.
The HOOKPROC type defines a pointer to this callback function. LowLevelKeyboardProc is a placeholder for the application-defined or library-defined function name.
Syntax
LRESULT CALLBACK LowLevelKeyboardProc( int nCode,
WPARAM wParam,
LPARAM lParam
);
Parameters
nCode
[in] Specifies a code the hook procedure uses to determine how to process the message. If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx. This parameter can be one of the following values.
HC_ACTION
The wParam and lParam parameters contain information about a keyboard message.
wParam
[in] Specifies the identifier of the keyboard message. This parameter can be one of the following messages: WM_KEYDOWN , WM_KEYUP , WM_SYSKEYDOWN , or WM_SYSKEYUP .
lParam
[in] Pointer to a KBDLLHOOKSTRUCT structure.
Return Value
If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx.
If nCode is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_KEYBOARD_LL hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the rest of the hook chain or the target window procedure.
Remarks
An application installs the hook procedure by specifying the WH_KEYBOARD_LL hook type and a pointer to the hook procedure in a call to the SetWindowsHookEx function.
This hook is called in the context of the thread that installed it. The call is made by sending a message to the thread that installed the hook. Therefore, the thread that installed the hook must have a message loop.
The hook procedure should process a message in less time than the data entry specified in the LowLevelHooksTimeout value in the following registry key:
HKEY_CURRENT_USER\\Control Panel\\Desktop
The value is in milliseconds. If the hook procedure does not return during this interval, the system will pass the message to the next hook.
Note that debug hooks cannot track this type of hook.
Function Information
HeaderDeclared in Winuser.h, include Windows.h
Import libraryNone
Minimum operating systemsWindows NT 4.0 SP3
See Also
Hooks Overview , CallNextHookEx , KBDLLHOOKSTRUCT , keybd_event , SetWindowsHookEx , WH_KEYBOARD_LL , WM_KEYDOWN , WM_KEYUP , WM_SYSKEYDOWN , WM_SYSKEYUP
==原始网址==http://msdn.microsoft.com/en-us/library/ms644985(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 9:25:15