win32-def
Definitions of Windows Date Types for node-ffi
What can I do with this?
Write node-ffi calling win32 native functions code by Typescript with Types support.
Installing
npm install --save win32-def
Usage
import * as Struct from 'ref-struct'
import {DStruct as DS} from 'win32-def';
const point = new Struct(DS.POINT)();
point.x = 100;
point.y = 200;
console.log(point);
import * as ref from 'ref';
import {K} from 'win32-api';
import {DModel as DM, DTypes as DT} from 'win32-def';
const knl32 = K.load();
const buf = <DM.FFIBuffer> Buffer.alloc(4);
buf.writeInt32LE(12345, 0);
const hInstance = <DM.FFIBuffer> ref.alloc(DT.HINSTANCE);
knl32.GetModuleHandleExW(0, null, hInstance);
Relevant
License
MIT
Languages