На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

AttachThreadInput



The AttachThreadInput function attaches the input processing mechanism of one thread to that of another thread.

BOOL AttachThreadInput(

DWORD idAttach, // thread to attach
DWORD idAttachTo, // thread to attach to
BOOL fAttach // attach or detach
);


Parameters

idAttach

Specifies the identifier of the thread to be attached to another thread. The thread to be attached cannot be a system thread.

idAttachTo

Specifies the identifier of the thread to be attached to. This thread cannot be a system thread.
A thread cannot attach to itself. Therefore, idAttachTo cannot equal idAttach.

fAttach

Specifies whether to attach or detach the threads. If this parameter is TRUE, the two threads are attached. If the parameter is FALSE, the threads are detached.



Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. There is no extended error information available.

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 Win32 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.

Windows NT: You cannot attach a thread to a thread in another desktop.

See Also

GetCurrentThreadId, GetKeyState, GetKeyboardState, GetWindowThreadProcessId, SetFocus


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

AttachThreadInput



Функция AttachThreadInput подключает вклад, обрабатывающий механизм одной резьбы в ту же самую другую резьбу.

BOOL AttachThreadInput(

DWORD idAttach, // РЕЗЬБА, чтобы подключать DWORD idAttachTo, // резьбу, чтобы подключать к BOOL fAttach // подключать или отделяться
);


Параметры

idAttach

Определяет идентификатор резьбы, которая нужно прилагать к другой резьбе. Резьба, которая нужно прилагать, не мочь быть системной резьбой.

idAttachTo

Определяет идентификатор резьбы, которая нужно прилагать, чтобы. Эта резьба не может быть системной резьбой.
Резьба не может подключить к себе. Следовательно, idAttachTo не может поравняться idAttach.

fAttach

Определяет подключать или отделять резьбу. Если этот параметр является ИСТИНОЙ, две резьбы приложены. Если параметр является ЛОЖЬЮ, резьба отделена.



Обратные Величины

Если функция добивается успеха, обратная величина ненулевая.
Если функция терпит неудачу, обратная величина нулевая. Нет расширенной информации ошибки доступной.

Замечания

Windows создавался на вводе обычно процесса другой резьбы независимо друг друга. То есть, у них есть свои собственные входные состояния (фокус, активное, окно сбора, ключевого государственного, статуса очереди, и так далее), и они не синхронизированы входной обработкой другой резьбы. Используя функцию AttachThreadInput, резьба может подключить свой ввод, обрабатывающийся в другую резьбу. Это также позволяет, чтобы распространять их входные состояния, так что они могут назвать функцию SetFocus, чтобы устанавливать клавишный фокус в окно другой резьбы. Это также позволяет, чтобы получать ключевую-государственную информацию. Эти возможности не обычно возможные.

Функция AttachThreadInput терпит неудачу если любая из определенной резьбы нет имеет очередь сообщения. Система создает очередь сообщения резьбы когда резьба делает своим первым вызовом один из ПОЛЬЗОВАТЕЛЯ Win32 или функциями GDI. Функция AttachThreadInput также терпит неудачу если рекордный захват журнала установлен. Рекордный захват Журнала подключают все входные очереди вместе.
Отметьте, что ключевое состояние, которое может быть установлено вызовами на GetKeyState или функция GetKeyboardState, восстановлено после вызова на AttachThreadInput.

Windows NT: Вы не можете подключить резьбу к резьбе в другой настольной системе.

Смотри Также

GetCurrentThreadId, GetKeyState, GetKeyboardState, GetWindowThreadProcessId, SetFocus


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz