Last active
April 22, 2022 11:41
-
-
Save fronterior/7c7e5d9b041bf0b76f876767242de249 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ffi = require('ffi-napi'); | |
const user32 = new ffi.Library('user32', { | |
FindWindowA: ['ulong', ['string', 'string']], | |
FindWindowExA: ['ulong', ['ulong', 'ulong', 'string', 'ulong']], | |
GetDesktopWindow: ['ulong', []], | |
SetWindowLongPtrA: ['ulong', ['int', 'int', 'int']], | |
SetWindowPos: [ | |
'bool', | |
['ulong', 'ulong', 'int', 'int', 'int', 'int', 'uint'], | |
], | |
SetParent: ['ulong', ['ulong', 'ulong']], | |
MoveWindow: ['bool', ['ulong', 'int', 'int', 'int', 'int', 'bool']], | |
GetWindowTextA: ['ulong', ['ulong', 'string', 'int']], | |
}); | |
const hwnd = user32.FindWindowA(null, 'Electron Fiddle - 16.0.2 Unsaved'); | |
user32.SetWindowPos(hwnd, null, 0, 0, 300, 300, 0x0001); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment