import { type HINSTANCE, type HMENU, type HWND, type HDESK, type LRESULT, type WPARAM, type LPARAM } from '../ctypes.js'; import { type RECT, type WNDPROC, type WNDENUMPROC } from '../structs.js'; import type { WS_, WS_EX_, WM_, HWND_, AW_, GA_, SW_ } from '../consts.js'; /** * Calculates the required size of the window rectangle, based on the desired client-rectangle size. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-adjustwindowrect */ export declare function AdjustWindowRect(rect: RECT, style: WS_, menu: boolean): boolean; /** * Calculates the required size of the window rectangle, based on the desired client-rectangle size. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-adjustwindowrectex */ export declare function AdjustWindowRectEx(rect: RECT, style: WS_, menu: boolean, exStyle: WS_EX_): boolean; /** * Calculates the required size of the window rectangle, based on the desired client-rectangle size and the provided DPI. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-adjustwindowrectexfordpi */ export declare function AdjustWindowRectExForDpi(rect: RECT, style: WS_, menu: boolean, exStyle: WS_EX_, dpi: number): boolean; /** * Enables you to produce special effects when showing or hiding windows. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-animatewindow */ export declare function AnimateWindow(hWnd: HWND, time: number, flags: AW_): boolean; /** * Brings the specified window to the top of the Z order. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-bringwindowtotop */ export declare function BringWindowToTop(hWnd: HWND): boolean; /** * Passes message information to the specified window procedure. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-callwindowprocw */ export declare function CallWindowProc(lpPrevWndFunc: WNDPROC, hWnd: HWND, msg: WM_, wParam: WPARAM, lParam: LPARAM): LRESULT; /** * Creates an overlapped, pop-up, or child window. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindoww */ export declare function CreateWindow(className: string | null, windowName: string | null, style: WS_, x: number, y: number, width: number, height: number, hWndParent: HWND | HWND_ | null, hMenu: HMENU | null, hInstance: HINSTANCE | null, lParam: LPARAM): HWND | null; /** * Creates an overlapped, pop-up, or child window with an extended window style. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindowexw */ export declare function CreateWindowEx(exStyle: WS_EX_, className: string | null, windowName: string | null, style: WS_, x: number, y: number, width: number, height: number, hWndParent: HWND | HWND_ | null, hMenu: HMENU | null, hInstance: HINSTANCE | null, lParam: LPARAM | null): HWND | null; /** * Calls the default window procedure to provide default processing for any window messages that an application does not process. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-defwindowprocw */ export declare function DefWindowProc(hWnd: HWND, msg: number, wParam: WPARAM, lParam: LPARAM): LRESULT; /** * Enumerates all top-level windows on the screen. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows */ export declare function EnumWindows(lpEnumFunc: WNDENUMPROC, lParam: LPARAM): boolean; /** * Enumerates all top-level windows associated with the specified desktop. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumdesktopwindows */ export declare function EnumDesktopWindows(hDesktop: HDESK | null, lpEnumFunc: WNDENUMPROC, lParam: LPARAM): boolean; /** * Retrieves a handle to the top-level window whose class name and window name match the specified strings. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-findwindoww */ export declare function FindWindow(className: string | null, windowName: string | null): HWND | null; /** * Retrieves a handle to the top-level window whose class name and window name match the specified strings. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-findwindowexw */ export declare function FindWindowEx(hWndParent: HWND | HWND_ | null, hWndChildAfter: HWND | null, className: string | null, windowName: string | null): HWND | null; /** * Retrieves the handle to the ancestor of the specified window. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getancestor */ export declare function GetAncestor(hWnd: HWND, flags: GA_): HWND | null; /** * * Retrieves a handle to the foreground window (the window with which the user is currently working). * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getforegroundwindow * */ export declare function GetForegroundWindow(): HWND; /** * Returns the text of the specified window's title bar (if it has one). * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowtextw */ export declare function GetWindowText(hWnd: HWND): string; /** * * Retrieves the identifier of the thread that created the specified window and, optionally, * the identifier of the process that created the window. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid * */ export declare function GetWindowThreadProcessId(hWnd: HWND): GetWindowThreadProcessIdResult; export interface GetWindowThreadProcessIdResult { threadId: number; processId: number; } /** * Brings the thread that created the specified window into the foreground and activates the window. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setforegroundwindow */ export declare function SetForegroundWindow(hWnd: HWND): boolean; /** * Sets the specified window's show state. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow */ export declare function ShowWindow(hWnd: HWND, cmdShow: SW_): boolean; /** * Sets the show state of a window without waiting for the operation to complete. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindowasync */ export declare function ShowWindowAsync(hWnd: HWND, cmdShow: SW_): boolean; /** * Updates the client area of the specified window by sending a WM_PAINT message to the window * if the window's update region is not empty. * * https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-updatewindow */ export declare function UpdateWindow(hWnd: HWND): boolean;