Socket
Book a DemoInstallSign in
Socket

win-geometry

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

win-geometry

Get window geometry for a window title

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

WinGeometry

WinGeometry is a lightweight Node.js module that retrieves the screen position and size of a window based on its title (INI path or window name), using a native Windows executable.

⚠️ Works only on Windows systems.

📦 Installation

npm install win-geometry

🛠️ Usage

const { getWindowGeometry } = require('win-geometry');

getWindowGeometry('window-title')
  .then(({ x, y, width, height }) => {
    console.log('Window Geometry:', { x, y, width, height });
  })
  .catch(err => {
    console.error('Error:', err.message);
  });

📋 Output Format

If the window is found, the function returns a Promise that resolves to an object:

{
  x: Number,
  y: Number,
  width: Number,
  height: Number
}

If the window is not found or an error occurs, the Promise is rejected with an appropriate error message.

🧱 Native Dependency

This module depends on a native executable called WinGeometry.exe, located in the bin/ folder. This executable performs the actual window geometry retrieval using Windows API calls.

Make sure WinGeometry.exe is included when packaging or publishing.

🧪 Example Output

Geometry: { x: 123, y: 456, width: 800, height: 600 }

🚫 Limitations

  • Windows-only (due to native .exe dependency)
  • Requires the exact window title.

📃 License

MIT © nstechbytes

Keywords

windows

FAQs

Package last updated on 16 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts