win32-api
Version:
FFI definitions of windows win32 api for node-ffi
51 lines (50 loc) • 3.33 kB
TypeScript
import { DModel as M, FModel as FM } from 'win32-def';
export interface Win32Fns extends FM.DllFuncsModel {
BringWindowToTop(hWnd: M.HWND): M.BOOL;
ClientToScreen(hWnd: M.HWND, lpPoint: M.LPPOINT): M.BOOL;
/** https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-closewindow */
CloseWindow(hWnd: M.HWND): M.BOOL;
CreateWindowExW(dwExStyle: M.DWORD, lpClassName: M.LPCTSTR | null, lpWindowName: M.LPCTSTR | null, dwStyle: M.DWORD, x: M.INT, y: M.INT, nWidth: M.INT, nHeight: M.INT, hWndParent: M.HWND | null, HMENU: M.HMENU | null, HINSTANCE: M.HINSTANCE | null, LPVOID: M.LPVOID | null): M.HWND;
DefWindowProcW(hWnd: M.HWND, Msg: M.UINT, wParam: M.WPARAM, lParam: M.LPARAM): M.LRESULT;
/** https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-destroywindow */
DestroyWindow(hWnd: M.HWND): M.BOOL;
DispatchMessageW(lpMsg: M.LPMSG): M.LRESULT;
EnumThreadWindows(dwThreadId: M.DWORD, lpfn: M.WNDENUMPROC, lParam: M.LPARAM): M.BOOL;
EnumWindows: EnumWindows;
FindWindowExW(hwndParent: M.HWND | null, hwndChildAfter: M.HWND | null, lpszClass: M.LPCTSTR | null, lpszWindow: M.LPCTSTR | null): M.HWND;
GetAncestor(hwnd: M.HWND, gaFlags: M.UINT): M.HWND;
GetClassInfoExW(hinst: M.HINSTANCE | null, lpszClass: M.LPCTSTR, LPWNDCLASSEX: M.LPWNDCLASSEX): M.BOOL;
GetForegroundWindow(): M.HWND;
GetMessageW(lpMsg: M.LPMSG, HWND: M.HWND | null, wMsgFilterMin: M.UINT, wMsgFilterMax: M.UINT): M.BOOL;
GetParent(hWnd: M.HWND): M.HWND;
GetTopWindow(hWnd: M.HWND): M.HWND;
GetWindow(hWnd: M.HWND, uCmd: M.UINT): M.HWND;
GetWindowInfo(hwnd: M.HWND, pwi: M.PWINDOWINFO): M.BOOL;
GetWindowLongW(hWnd: M.HWND, nIndex: M.INT): M.LONG;
GetWindowLongPtrW(hWnd: M.HWND, nIndex: M.INT): M.LONG_PTR;
GetWindowTextW(hWnd: M.HWND, lpString: M.LPCTSTR, nMaxCount: M.INT): M.INT;
GetWindowThreadProcessId(hWnd: M.HWND, lpdwProcessId: M.LPDWORD | null): M.DWORD;
IsWindowVisible(hWnd: M.HWND): M.BOOL;
PeekMessageW(lpMsg: M.LPMSG, HWND: M.HWND | null, wMsgFilterMin: M.UINT, wMsgFilterMax: M.UINT, wRemoveMsg: M.UINT): M.BOOL;
/**
* ref: https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-postmessagew
*/
PostMessageW(hWnd: M.HWND, Msg: M.UINT, wPARAM: M.WPARAM, lPARAM: M.LPARAM): M.BOOL;
RegisterClassExW(lpwcx: M.WNDCLASSEX): M.ATOM;
/**
* ref: https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-sendmessagew
*/
SendMessageW(hWnd: M.HWND, Msg: M.UINT, wPARAM: M.WPARAM, lPARAM: M.LPARAM): M.LRESULT;
SetWindowTextW(hWnd: M.HWND, lpString: M.LPCTSTR | null): M.BOOL;
SetWinEventHook(eventMin: M.UINT, eventMax: M.UINT, hmodWinEventProc: M.HMODULE, lpfnWinEventProc: M.WINEVENTPROC, idProcess: M.DWORD, idThread: M.DWORD, dwflags: M.UINT): M.HWINEVENTHOOK;
ShowWindow(hWnd: M.HWND, nCmdShow: M.INT): M.BOOL;
TranslateMessage(lpMsg: M.LPMSG): M.BOOL;
TranslateMessageEx(lpMsg: M.LPMSG): M.BOOL;
UnhookWinEvent(hWinEventHook: M.HWINEVENTHOOK): M.BOOL;
UpdateWindow(hWnd: M.HWND): M.BOOL;
}
export declare const apiDef: FM.DllFuncs;
export interface EnumWindows {
(lpEnumFunc: M.WNDENUMPROC, lParam: M.LPARAM): M.BOOL;
async(lpEnumFunc: M.WNDENUMPROC, lParam: M.LPARAM, cb: (err: Error) => void): M.BOOL;
}