网站首页  词典首页

请输入您要查询的函数:

 

术语 sendmessagetimeout
释义 SendMessageTimeout
语法:
LRESULT SendMessageTimeout( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam,
UINT fuFlags,
UINT uTimeout,
PDWORD_PTR lpdwResult
);
SendMessageTimeout函数
指定的消息发送给更多的窗口之一。
参数
hWnd
[in]句柄窗口的窗口过程将收到消息。
如果此参数为HWND_BROADCAST,该消息被发送到所有顶级的系统级窗口,包括残疾或无形无主窗口。在功能不会返回,直到每个窗口已超时。因此,总的等待时间,可直至由顶级窗口数乘以uTimeout价值。
消息
[in]指定要发送的信息。
wParam
[in]指定附加消息的特定信息。
lparam的
[in]指定附加消息的特定信息。
fuFlags
[in]指定如何发送邮件。此参数可以是一个或多个下列值。
SMTO_ABORTIFHUNG
没有等待的时间返回超时期限流逝如果接收线程似乎不响应或“挂起”。
SMTO_BLOCK
防止加工,直到函数返回的任何其他要求调用线程。
SMTO_NORMAL
调用线程不会阻止其他请求处理的功能,同时等待返回。
SMTO_NOTIMEOUTIFNOTHUNG
微软Windows 2000/Windows XP中:不强制实行了只要接收线程长期的时间是处理消息。
SMTO_ERRORONEXIT
uTimeout
[in]指定的时间,以毫秒为单位的超时期限。如果该消息是一个广播消息,每个窗口可以使用全时超时期限。例如,如果您指定一个五秒超时期间,有三个顶层窗口无法处理的信息,您可以有高达15秒的延迟。
lpdwResult
[内]接收邮件的处理结果。此值取决于对信息发送。
返回值
如果函数成功,返回值为非零。 SendMessageTimeout不提供有关超时个人信息,如果HWND_BROADCAST窗户使用。
如果函数失败或超时,返回值是零。为了获得更多错误信息,调用GetLastError。如果GetLastError返回ERROR_TIMEOUT,则函数超时。
微软Windows 2000:如果GetLastError函数返回零,则超时功能。
备注
函数调用指定窗口的窗口过程,如果指定的窗口属于一个不同的线程,不会返回,直到窗口程序处理的信息或指定超时期限已过。如果窗口接收的消息属于作为当前线程相同的队列,窗口过程被称为直接的超时值被忽略。
这个函数认为一个线程不响应,如果它没有所谓的GetMessage或类似的功能在五秒钟内。
该系统不仅为系统消息编组(范围为0至(WM_USER -1))的。其他消息发送(即“= WM_USER)到另一个进程,则必须自定义编组。
在Windows 95/98/Me:SendMessageTimeoutW是支持的Unicode(MSLU)微软层。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
消息和消息队列概述,GetMessage,InSendMessage,PostMessage,SendDlgItemMessage,SendMessage消息,SendMessageCallback,SendNotifyMessage
==英文原文==SendMessageTimeout Function
Sends the specified message to one of more windows.
Syntax
LRESULT SendMessageTimeout( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam,
UINT fuFlags,
UINT uTimeout,
PDWORD_PTR lpdwResult
);
Parameters
hWnd
[in] Handle to the window whose window procedure will receive the message.
If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows. The function does not return until each window has timed out. Therefore, the total wait time can be up to the value of uTimeout multiplied by the number of top-level windows.
Msg
[in] Specifies the message to be sent.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.
fuFlags
[in] Specifies how to send the message. This parameter can be one or more of the following values.
SMTO_ABORTIFHUNG
Returns without waiting for the time-out period to elapse if the receiving thread appears to not respond or "hangs."
SMTO_BLOCK
Prevents the calling thread from processing any other requests until the function returns.
SMTO_NORMAL
The calling thread is not prevented from processing other requests while waiting for the function to return.
SMTO_NOTIMEOUTIFNOTHUNG
Microsoft Windows 2000/Windows XP: Do not enforce the time-out period as long as the receiving thread is processing messages.
SMTO_ERRORONEXIT
uTimeout
[in] Specifies the duration, in milliseconds, of the time-out period. If the message is a broadcast message, each window can use the full time-out period. For example, if you specify a five second time-out period and there are three top-level windows that fail to process the message, you could have up to a 15 second delay.
lpdwResult
[out] Receives the result of the message processing. This value depends on the message sent.
Return Value
If the function succeeds, the return value is nonzero. SendMessageTimeout does not provide information about individual windows timing out if HWND_BROADCAST is used.
If the function fails or times out, the return value is zero. To get extended error information, call GetLastError . If GetLastError returns ERROR_TIMEOUT, then the function timed out.
Microsoft Windows 2000: If GetLastError returns zero, then the function timed out.
Remarks
The function calls the window procedure for the specified window and, if the specified window belongs to a different thread, does not return until the window procedure has processed the message or the specified time-out period has elapsed. If the window receiving the message belongs to the same queue as the current thread, the window procedure is called directly—the time-out value is ignored.
This function considers a thread is not responding if it has not called GetMessage or a similar function within five seconds.
The system only does marshalling for system messages (those in the range 0 to ( WM_USER -1)). To send other messages (those >= WM_USER) to another process, you must do custom marshalling.
Windows 95/98/Me: SendMessageTimeoutW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Messages and Message Queues Overview , GetMessage , InSendMessage , PostMessage , SendDlgItemMessage , SendMessage , SendMessageCallback , SendNotifyMessage
==原始网址==http://msdn.microsoft.com/en-us/library/ms644952(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:30:52