waitingsong / node-win32-api

win32 api
MIT License
436 stars 56 forks source link
comctl32 electron esm ffi ffi-napi kernel32 koffi typescript user32 win32

win32-api

FFI Definitions of Windows win32 api for koffi

[GitHub tag]() License Available platform ci codecov Conventional Commits lerna

Significant Changes.V22

Compile successfully with

Migrate to v13

See migrate13

Packages

Package Version
win32-api main-svg
win32-def def-svg

What can I do with this?

Calling win32 native functions come from user32.dll, kernel32.dll, comctl32.dll by Node.js via node-ffi-napi

Installing

npm install win32-api

Usage

DLL Wrapper

import { 
  FindWindow, 
  GetDefaultPrinter,
} from 'win32-api/util'

// Retrieves the printer name of the default printer for the current user on the local computer
const printerName = await GetDefaultPrinter()

const child = spawn('notepad.exe')
const hWnd = await FindWindowEx(0, 0, 'Notepad', null)

Demo

Relevant

License

MIT

Languages