node-win32-api
node-win32-api copied to clipboard
How to make an application invisible in the background?
I am using the following code to call a windows application
var { spawn } = require('child_process'); const local_path = "C:\\Users\\PC\\\Documents\\"; const query = exec("start /B game.exe", { cwd: `${local_path}`,windowsHide: true }); const pid = query.pid;
how can i use win32-api?
try: https://github.com/waitingsong/node-windows-window-controller/blob/master/src/lib/index.ts#L11
try:https://www.npmjs.com/package/hmc-win32 The module is a deeply wrapped win32-api
const hmc = require('hmc-win32');
hmc.openApp("game.exe","",`${local_path}`,true,false);
Hide the current console:
// Please save it to a variable if you need to continue to control it, because after hiding the handle will be blocked so that it cannot be retrieved.
let Handle = hmc.getProcessHandle(process.pid);
Handle?.hide();
// show
Handle?.show();```