electron-bottom-most

0.3.0 • Public • Published

This module allow you to set the window attached to the HWND handle to be placed at the lowest z-index available aka bottom-most

It's the inverse of top-most.

Electron indeed have a top-most property but do not have a bottom-most one.

This native module is a wrapper around SetWindowPosition Win32 API function.

I'm open to any contribution about other OS.

Installation

npm i -S electron-bottom-most   # install the module 
 
./node_modules/.bin/electron-rebuild -f -w electron-bottom-most   # rebuild the module to match your electron version 

Usage

Look at the index.html, index.js and package.json file to integrate it into your Electron application

Basically it consists of 2 steps

  • Include the module in your .js file:
import { SetBottomMost } from 'electron-bottom-most';
 - or -
const { SetBottomMost } = require('electron-bottom-most');
  • Create your Electron BrowserWindow
let mainWindow = new BrowserWindow({
    height: 800,
    width: 800,
    useContentSize: true,
    transparent: !isDev,
    frame: isDev,
    focusable: isDev,
    show: false
});
 
// load it
mainWindow.loadURL(__dirname + "/index.html");
 
//show it
mainWindow.show();
 
// get the native HWND handle
let handle = mainWindow.getNativeWindowHandle();
 
// set bottom most!
SetBottomMost(handle);
 

Todo

  • Make it safe please

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Readme

Keywords

none

Package Sidebar

Install

npm i electron-bottom-most

Weekly Downloads

1

Version

0.3.0

License

MIT

Last publish

Collaborators

  • armaldio