Skip to content

waitingsong/node-win32-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Node.js v18
  • Node.js v20
  • Node.js v22

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