GithubHelp home page GithubHelp logo

node-windows-window-controller's Introduction

windows-window-controller

Wrap user32.ShowWindow() by node via node-ffi

Version License Available platform Build status Coverage Status

What can I do with this?

Hide, show, maximize, minimize a window where you know either the app process PID, or window's hWnd, or keyword title of the window(s).

Installing

# as global cmd-line
npm install --g windows-window-controller

# as module
npm install --save windows-window-controller

Usage

# ------ as global cmd-line ------

# by pid. 0x7632===30258
hide-window --pid=0x7632
hide-window --pid=30258
# by keyword of title case sensitive
hide-window --title=vim

# 3: Activates the window and displays it as a maximized window.
show-window --pid=0x7632 --status=3
show-window --pid=30258 --status=3
show-window --title=vim --status=3

# 1: Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
nwwc --hwnd=0x702C6 --status=1


# ------ as module ------
const nwwc = require("windows-window-controller");

nwwc.hide(0x7632).then((execRet) => console.log(execRet));
nwwc.hide(30258).then((execRet) => console.log(execRet));
nwwc.hide('vim').then((execRet) => console.log(execRet));

# 2: Activates the window and displays it as a minimized window.
nwwc.show(0x7632, 2).then((execRet) => console.log(execRet));
nwwc.show(30258, 2).then((execRet) => console.log(execRet));
nwwc.show('vim', 2).then((execRet) => console.log(execRet));

# hide all windows relative to the main process, such as the window of child process
nwwc.hide(0x7632, false).then((execRet) => console.log(execRet));

Dependencies Troubleshooting

Relevant

Known bugs:

  • The result of find hWnds by pid is empty when build by VS2017. It works when VS2013 and VS2015.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.