网站首页  词典首页

请输入您要查询的函数:

 

术语 attachthreadinput
释义 AttachThreadInput
语法:
C++
BOOL WINAPI AttachThreadInput(
__in DWORD idAttach,
__in DWORD idAttachTo,
__in BOOL fAttach
);
AttachThreadInput函数
重视或分离的一个线程输入处理机制,另一个线程。
参数
idAttach [in]
该线程的标识符附加到另一个线程。要附加的,不能一个系统线程。
idAttachTo [in]
对在何种idAttach将附在线程标识符。这个线程不能是一个系统线程。
一个线程不能将附加到本身。因此,idAttachTo不能平等idAttach。
fAttach [in]
如果此参数为TRUE,这两个线程连接。如果该参数为FALSE,线程被分离。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
Windows Server 2003和Windows XP/2000操作系统:没有扩展的错误信息,不要调用GetLastError函数。作为Windows Vista改变了这种行为。
备注
在不同的线程创建的Windows通常是彼此独立进程的投入。也就是说,它们有自己的输入状态(重点,积极,捕获窗口,国家重点,队列状态,等等),他们是不符合输入处理其他线程同步。通过使用AttachThreadInput函数,一个线程可以处理附加的投入到另一个线程。这也允许线程分享他们的输入状态,这样他们就可以调用SetFocus函数来设置键盘焦点到一个不同的线程窗口。这也允许线程获得关键的状态信息。这些功能一般不是可能的。
该AttachThreadInput函数失败并没有消息队列如果任何指定的线程。该系统创建一个线程的消息队列当线程在作出第一次调用的用户或GDI的职能之一。该AttachThreadInput函数也失败如果日志记录挂钩安装。期刊记录挂钩所有的输入队列连接在一起。
请注意,国家重点,确定可以通过向GetKeyState或GetKeyboardState函数调用,重置后,作AttachThreadInput电话。您不能附加线程在另一个桌面线程。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinuser.h(头文件:winuser.h)
LibraryUser32.lib
DLLUser32.dll
参见
GetCurrentThreadId
GetKeyState
GetKeyboardState
GetWindowThreadProcessId
进程和线程函数
设置焦点
主题
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==AttachThreadInput Function
Attaches or detaches the input processing mechanism of one thread to that of another thread.
Syntax
C++
BOOL WINAPI AttachThreadInput(
__in DWORD idAttach,
__in DWORD idAttachTo,
__in BOOL fAttach
);
Parameters
idAttach [in]
The identifier of the thread to be attached to another thread. The thread to be attached cannot be a system thread.
idAttachTo [in]
The identifier of the thread to which idAttach will be attached. This thread cannot be a system thread.
A thread cannot attach to itself. Therefore, idAttachTo cannot equal idAttach.
fAttach [in]
If this parameter is TRUE, the two threads are attached. If the parameter is FALSE, the threads are detached.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Windows Server 2003 and Windows XP/2000: There is no extended error information; do not call GetLastError. This behavior changed as of Windows Vista.
Remarks
Windows created in different threads typically process input independently of each other. That is, they have their own input states (focus, active, capture windows, key state, queue status, and so on), and they are not synchronized with the input processing of other threads. By using the AttachThreadInput function, a thread can attach its input processing to another thread. This also allows threads to share their input states, so they can call the SetFocus function to set the keyboard focus to a window of a different thread. This also allows threads to get key-state information. These capabilities are not generally possible.
The AttachThreadInput function fails if either of the specified threads does not have a message queue. The system creates a thread's message queue when the thread makes its first call to one of the USER or GDI functions. The AttachThreadInput function also fails if a journal record hook is installed. Journal record hooks attach all input queues together.
Note that key state, which can be ascertained by calls to the GetKeyState or GetKeyboardState function, is reset after a call to AttachThreadInput. You cannot attach a thread to a thread in another desktop .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll
See Also
GetCurrentThreadId
GetKeyState
GetKeyboardState
GetWindowThreadProcessId
Process and Thread Functions
SetFocus
Threads
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms681956(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 11:24:32