waitingsong / node-win32-api

win32 api
MIT License
430 stars 55 forks source link

Is hMonitor supported? #41

Closed rortan134 closed 2 years ago

rortan134 commented 2 years ago

More specifically, i'm interested in using this, is it possible?

rortan134 commented 2 years ago

I managed to do it extending the user32 using ffi with this code and some structs, an implementation using this lib would be nicer though

const winuser32 = ffi.Library('user32.dll', {
  MonitorFromWindow: [HWND, [HANDLE, DWORD]],
  GetMonitorInfoA: ['bool', [HANDLE, ref.refType(MONITORINFO)]],
});
waitingsong commented 2 years ago

will add it later

waitingsong commented 2 years ago

MonitorFromWindow() added