windows-window-controller
Wrap user32.ShowWindow() by node via node-ffi
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-linenpm install --g windows-window-controller # as modulenpm install --save windows-window-controller
Usage
# ------ as global cmd-line ------ # by pid 0x7632===30258hide-window --pid=0x7632hide-window --pid=30258# by keyword of title case sensitivehide-window --title=vim # 3: Activates the window and displays it as a maximized windowshow-window --pid=0x7632 --status=3show-window --pid=30258 --status=3show-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 timenwwc --hwnd=0x702C6 --status=1 # ------ as module ------const nwwc = ; nwwc;nwwc;nwwc; # 2: Activates the window and displays it as a minimized windownwwc;nwwc;nwwc; # hide all windows relative to the main process such as the window of child processnwwc;
Dependencies Troubleshooting
- If installation of node-gyp fails: Check out node-gyp and windows-build-tools
Relevant
Known bugs:
- The result of find hWnds by pid is empty when build by VS2017. It works when VS2013 and VS2015.