网站首页  词典首页

请输入您要查询的函数:

 

术语 setwindowtext
释义 SetWindowText
语法:
BOOL SetWindowText( HWND hWnd,
LPCTSTR lpString
);
SetWindowText函数
SetWindowText函数改变指定窗口的标题栏(如果有的话)的文本。如果指定的窗口是一个控制,控件的文本更改。然而,SetWindowText函数不能改变在另一个应用程序的控制文本。
参数
hWnd
[in]的窗口句柄或控制的文本改变。
lpString
[in]指向一个空结束的字符串将被用作新的所有权或支配权的文本。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
如果目标窗口是由当前进程拥有,SetWindowText函数导致WM_SETTEXT消息发送到指定的窗口或控制。如果控件列表框控件与WS_CAPTION风格创建的,但是,SetWindowText函数设置了控件的文本列表框项,不是。
要设置在另一个过程控制文本,发送WM_SETTEXT消息,而不是直接调用函数SetWindowText。
SetWindowText函数不扩展制表符(ASCII代码0x09)。制表符显示为竖线(|)字符。
在Windows 95/98/Me:SetWindowTextW是支持的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为Unicode版本。
参见
视窗概述,GetWindowText,WM_SETTEXT
==英文原文==SetWindowText Function
The SetWindowText function changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. However, SetWindowText cannot change the text of a control in another application.
Syntax
BOOL SetWindowText( HWND hWnd,
LPCTSTR lpString
);
Parameters
hWnd
[in] Handle to the window or control whose text is to be changed.
lpString
[in] Pointer to a null-terminated string to be used as the new title or control text.
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
If the target window is owned by the current process, SetWindowText causes a WM_SETTEXT message to be sent to the specified window or control. If the control is a list box control created with the WS_CAPTION style, however, SetWindowText sets the text for the control, not for the list box entries.
To set the text of a control in another process, send the WM_SETTEXT message directly instead of calling SetWindowText.
The SetWindowText function does not expand tab characters (ASCII code 0x09). Tab characters are displayed as vertical bar (|) characters.
Windows 95/98/Me: SetWindowTextW 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 Sending a Message .
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 Unicode version.
See Also
Windows Overview , GetWindowText , WM_SETTEXT
==原始网址==http://msdn.microsoft.com/en-us/library/ms633546(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:25:18