网站首页  词典首页

请输入您要查询的函数:

 

术语 findwindow
释义 FindWindow
语法:
HWND FindWindow( LPCTSTR lpClassName,
LPCTSTR lpWindowName
);
FindWindow函数
FindWindow函数检索的句柄顶层窗口的类名和窗口的名称匹配指定的字符串。此函数不查找子窗口。此函数不执行区分大小写的搜索。
要搜索子窗口,从一个指定的子窗口,使用FindWindowEx功能。
参数
lpClassName
[in]指向一个空结束的字符串,指定类名或一类原子因先前调用RegisterClass的或RegisterClassEx函数创建。原子必须在低lpClassName命令字;的高位字必须为零。
如果一个字符串lpClassName点,它指定窗口的类名。类名可以用注册窗口或RegisterClassEx,或事先确定的控制任何一类的名称注册的名称。
如果lpClassName是NULL,发现任何窗口的标题匹配lpWindowName参数。
lpWindowName
[in]指向一个空结束的字符串,指定窗口名(窗口标题)。如果该参数为NULL,所有窗口的名称匹配。
返回值
如果函数成功,返回值是一个窗口句柄具有指定类名和窗口名。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
如果lpWindowName参数不是NULL,FindWindow调用GetWindowText函数来检索比较窗口的名称。对于一个潜在的问题可能会出现说明,请参见是GetWindowText的言论。
假如要检查微软的IntelliType 1.x版本软件运行,调用FindWindow如下:
FindWindow(“MSITPro::EventQueue”,空);
若要检查的IntelliType 2.0版软件运行,调用FindWindow如下:
FindWindow(“Type32_Main_Window”,空);
如果IntelliType软件运行时,它发送WM_APPCOMMAND消息应用程序。否则,应用程序必须安装一个钩子接收WM_APPCOMMAND消息。
Microsoft Windows 95或更高版本:FindWindowW是支持的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版本。
参见
视窗概述,EnumWindows,FindWindowEx,GetClassName,GetWindowText,RegisterClass的,RegisterClassEx
==英文原文==FindWindow Function
The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search.
To search child windows, beginning with a specified child window, use the FindWindowEx function.
Syntax
HWND FindWindow( LPCTSTR lpClassName,
LPCTSTR lpWindowName
);
Parameters
lpClassName
[in] Pointer to a null-terminated string that specifies the class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.
If lpClassName points to a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names.
If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter.
lpWindowName
[in] Pointer to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match.
Return Value
If the function succeeds, the return value is a handle to the window that has the specified class name and window name.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
If the lpWindowName parameter is not NULL, FindWindow calls the GetWindowText function to retrieve the window name for comparison. For a description of a potential problem that can arise, see the Remarks for GetWindowText.
To check if the Microsoft IntelliType version 1.x software is running, call FindWindow as follows:
FindWindow("MSITPro::EventQueue",NULL);
To check if the IntelliType version 2.0 software is running, call FindWindow as follows:
FindWindow("Type32_Main_Window", NULL);
If the IntelliType software is running, it sends WM_APPCOMMAND messages to the application. Otherwise the application must install a hook to receive WM_APPCOMMAND messages.
Microsoft Windows 95 or later: FindWindowW 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 Retrieving the Number of Mouse Wheel Scroll Lines .
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
Windows Overview , EnumWindows , FindWindowEx , GetClassName , GetWindowText , RegisterClass , RegisterClassEx
==原始网址==http://msdn.microsoft.com/en-us/library/ms633499(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:34