网站首页  词典首页

请输入您要查询的函数:

 

术语 translatemessage
释义 TranslateMessage
语法:
BOOL TranslateMessage( const MSG *lpMsg
);
TranslateMessage函数
TranslateMessage函数的性质的信息转换成虚拟的关键信息。字符消息被发送到调用线程的消息队列,将在下一次读线程调用GetMessage或PeekMessage函数。
参数
lpMsg
[in]指向一个MSG结构,它包含的信息资料调用线程的消息队列使用GetMessage或PeekMessage函数。
返回值
如果消息被转换(即,字符消息发布到线程的消息队列),则返回值为非零。
如果消息是WM_KEYDOWN,WM_KEYUP,WM_SYSKEYDOWN或WM_SYSKEYUP,返回非零值,不管翻译。
如果消息是不翻译(即,字符消息不会发布到线程的消息队列),返回值是零。
备注
该TranslateMessage函数不修改的信息指出的lpMsg参数。
WM_KEYDOWN和WM_KEYUP组合产生一个WM_CHAR或WM_DEADCHAR消息。 WM_SYSKEYDOWN和WM_SYSKEYUP组合产生一个WM_SYSCHAR或WM_SYSDEADCHAR消息。
TranslateMessage生产只能用于映射键盘驱动程序,以ASCII字符键WM_CHAR消息。
如果申请过程的一些其他用途虚拟的关键信息,他们不应该调用TranslateMessage。例如,应用程序不应调用TranslateMessage如果TranslateAccelerator函数返回一个非零值。请注意,申请的检索和调度信息输入到对话框负责。大多数应用程序使用此主消息循环。然而,为了允许用户移动到并选择使用键盘控制,应用程序必须调用IsDialogMessage。有关更多信息,请参见对话框键盘接口。
在Windows 95/98/Me:TranslateMessage是支持的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
参见
消息和消息队列概述,GetMessage,IsDialogMessage,PeekMessage,TranslateAccelerator,产生WM_CHAR,WM_DEADCHAR,WM_KEYDOWN,WM_KEYUP,WM_SYSCHAR,WM_SYSDEADCHAR,WM_SYSKEYDOWN,WM_SYSKEYUP
==英文原文==TranslateMessage Function
The TranslateMessage function translates virtual-key messages into character messages. The character messages are posted to the calling thread's message queue, to be read the next time the thread calls the GetMessage or PeekMessage function.
Syntax
BOOL TranslateMessage( const MSG *lpMsg
);
Parameters
lpMsg
[in] Pointer to an MSG structure that contains message information retrieved from the calling thread's message queue by using the GetMessage or PeekMessage function.
Return Value
If the message is translated (that is, a character message is posted to the thread's message queue), the return value is nonzero.
If the message is WM_KEYDOWN , WM_KEYUP , WM_SYSKEYDOWN , or WM_SYSKEYUP , the return value is nonzero, regardless of the translation.
If the message is not translated (that is, a character message is not posted to the thread's message queue), the return value is zero.
Remarks
The TranslateMessage function does not modify the message pointed to by the lpMsg parameter.
WM_KEYDOWN and WM_KEYUP combinations produce a WM_CHAR or WM_DEADCHAR message. WM_SYSKEYDOWN and WM_SYSKEYUP combinations produce a WM_SYSCHAR or WM_SYSDEADCHAR message.
TranslateMessage produces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver.
If applications process virtual-key messages for some other purpose, they should not call TranslateMessage. For instance, an application should not call TranslateMessage if the TranslateAccelerator function returns a nonzero value. Note that the application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this. However, to permit the user to move to and to select controls by using the keyboard, the application must call IsDialogMessage . For more information, see Dialog Box Keyboard Interface .
Windows 95/98/Me: TranslateMessage 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 .
Example
For an example, see Creating a Message Loop .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
See Also
Messages and Message Queues Overview , GetMessage , IsDialogMessage , PeekMessage , TranslateAccelerator , WM_CHAR , WM_DEADCHAR , WM_KEYDOWN , WM_KEYUP , WM_SYSCHAR , WM_SYSDEADCHAR , WM_SYSKEYDOWN , WM_SYSKEYUP
==原始网址==http://msdn.microsoft.com/en-us/library/ms644955(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 13:18:30