win32-api
Version:
FFI definitions of windows win32 api for node-ffi
21 lines • 1.18 kB
JavaScript
import assert from 'node:assert';
import { load } from '../../lib/user32/index.js';
const fnName = 'FindWindowExW';
const fnAsyncName = 'FindWindowExW_Async';
/**
* Retrieves a handle to a window whose class name and window name match the specified strings.
* The function searches child windows, beginning with the one following the specified child window.
* This function does not perform a case-sensitive search.
* @link https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-findwindowexw
*
* 检索其类名和窗口名称与指定字符串匹配的窗口的句柄。 函数搜索子窗口,从指定子窗口后面的子窗口开始。 此函数不执行区分大小写的搜索。
* @link https://learn.microsoft.com/zh-cn/windows/win32/api/winuser/nf-winuser-findwindowexw
*/
export async function FindWindowEx(hwndParent, hwndChildAfter, lpszClass, lpszWindow) {
const lib = load([fnName]);
const fn = lib[fnAsyncName];
assert(typeof fn === 'function', `Function "${fnAsyncName}" not found`);
const hwnd = await fn(hwndParent, hwndChildAfter, lpszClass, lpszWindow);
return hwnd;
}
//# sourceMappingURL=FindWindowEx.js.map