网站首页  词典首页

请输入您要查询的函数:

 

术语 getguithreadinfo
释义 GetGUIThreadInfo
语法:
BOOL GetGUIThreadInfo( DWORD idThread,
LPGUITHREADINFO lpgui
);
GetGUIThreadInfo功能
获取信息的活动窗口或指定的图形用户界面(GUI)线程。
参数
idThread
[in]标识线程的信息可以检索。检索此值,使用GetWindowThreadProcessId功能。如果该参数为NULL,则函数返回的前台线程的信息。
lpgui
[out]指向1 GUITHREADINFO收到信息的结构描述线程。请注意,您必须设置为sizeof GUITHREADINFO.cbSize在调用这个函数(GUITHREADINFO)。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
这个函数成功,即使在活动窗口不被调用进程所拥有。如果指定的线程不存在,或有一个输入队列,该函数将失败。
此功能可用于检索的门诊中一个线程的信息。检索的资料是一样的,如果一个应用程序检索到的关于自身的信息。
微软Windows 2000:对于一个编辑控件,返回的rcCaret矩形包含插入符,再加上文字的方向和填充的信息。因此,它可能没有给光标的正确位置。 Sans Serif字体的使用光标四个大字:光标characterUnicode代码点
CURSOR_LTR0xf00c
CURSOR_RTL0xf00d
CURSOR_THAI0xf00e
CURSOR_USA0xfff(这是一个没有相关标志符号标记值)
为了在rcCaret矩形的实际插入点,请执行以下步骤。
呼叫GetKeyboardLayout检索当前输入语言。
确定基于当前输入语言字符光标使用。
呼叫CreateFont使用无衬线字体,由rcCaret给予高度和宽度为0。对于fnWeight,调用SystemParametersInfo(SPI_GETCARETWIDTH,0,pvParam,0)。如果pvParam大于1,设置fnWeight 700人,否则设置fnWeight 400。
选择到一个设备上下文(DC)字体,并使用GetCharABCWidths获得适当的光标字符乙宽度。
添加乙宽度rcCaret.left取得实际的插入点。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低经营systemsWindows 98时,Windows NT 4.0 SP3的
参见
视窗概述,GetCursorInfo,GetWindowThreadProcessId,GUITHREADINFO
==英文原文==GetGUIThreadInfo Function
Retrieves information about the active window or a specified graphical user interface (GUI) thread.
Syntax
BOOL GetGUIThreadInfo( DWORD idThread,
LPGUITHREADINFO lpgui
);
Parameters
idThread
[in] Identifies the thread for which information is to be retrieved. To retrieve this value, use the GetWindowThreadProcessId function. If this parameter is NULL, the function returns information for the foreground thread.
lpgui
[out] Pointer to a GUITHREADINFO structure that receives information describing the thread. Note that you must set GUITHREADINFO.cbSize to sizeof(GUITHREADINFO) before calling this function.
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 .
Remarks
This function succeeds even if the active window is not owned by the calling process. If the specified thread does not exist or have an input queue, the function will fail.
This function is useful for retrieving out-of-context information about a thread. The information retrieved is the same as if an application retrieved the information about itself.
Microsoft Windows 2000: For an edit control, the returned rcCaret rectangle contains the caret plus information on text direction and padding. Thus, it may not give the correct position of the cursor. The Sans Serif font uses four characters for the cursor: Cursor characterUnicode code point
CURSOR_LTR0xf00c
CURSOR_RTL0xf00d
CURSOR_THAI0xf00e
CURSOR_USA0xfff (this is a marker value with no associated glyph)
To get the actual insertion point in the rcCaret rectangle, perform the following steps.
Call GetKeyboardLayout to retrieve the current input language.
Determine the character used for the cursor, based on the current input language.
Call CreateFont using Sans Serif for the font, the height given by rcCaret, and a width of zero. For fnWeight, call SystemParametersInfo (SPI_GETCARETWIDTH, 0, pvParam, 0). If pvParam is greater than 1, set fnWeight to 700, otherwise set fnWeight to 400.
Select the font into a device context (DC) and use GetCharABCWidths to get the B width of the appropriate cursor character.
Add the B width to rcCaret.left to obtain the actual insertion point.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 98, Windows NT 4.0 SP3
See Also
Windows Overview , GetCursorInfo , GetWindowThreadProcessId , GUITHREADINFO
==原始网址==http://msdn.microsoft.com/en-us/library/ms633506(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:23:06