@@ -47,7 +47,9 @@ export const user32 = new ffi.Library("User32.dll", {
4747 // https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-bringwindowtotop
4848 SetForegroundWindow : [ "bool" , [ "int64" ] ] ,
4949 // https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setlayeredwindowattributes
50- SetLayeredWindowAttributes : [ "bool" , [ "int64" , "int" , "int" , "int64" ] ]
50+ SetLayeredWindowAttributes : [ "bool" , [ "int64" , "int" , "int" , "int64" ] ] ,
51+ // https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-monitorfromwindow
52+ MonitorFromWindow : [ "int64" , [ "int64" , "int64" ] ]
5153} ) ;
5254
5355export const kernel32 = new ffi . Library ( "kernel32" , {
@@ -62,6 +64,10 @@ export const kernel32 = new ffi.Library("kernel32", {
6264 ]
6365} ) ;
6466
67+ export const shellScaling = new ffi . Library ( "SHCore.dll" , {
68+ GetScaleFactorForMonitor : [ "int64" , [ "int64" , "int*" ] ]
69+ } ) ;
70+
6571export const getProcessId = ( handle : number ) => {
6672 const processIdBuffer = ref . alloc ( "uint32" ) ;
6773 user32 . GetWindowThreadProcessId ( handle , processIdBuffer ) ;
@@ -120,3 +126,5 @@ export const getWindowBounds = (handle: number) => {
120126 height : bounds . bottom - bounds . top
121127 } ;
122128} ;
129+
130+ export const getScaleFactor = ( handle : number ) => { } ;
0 commit comments