Window Form using Node.js | Sololearn: Learn to code for FREE!

+1

Window Form using Node.js

Hello all, is there any possibility that I can make window form using Node.js which will be draw on other applications of Windows?

8/1/2021 9:39:56 AM

Hamdan Farooq

12 Answers

New Answer

+5

Yes, you could build window desktop applications using electron.js Electron.js allows for the development of desktop GUI applications using web technologies: it combines the Chromium rendering engine and the Node.js runtime.

+4

Hamdan Farooq ipcMain is the interprocess communication method between election app and web pages, which is different from what interprocess that Martin Taylor has mentioned.

+3

Hamdan Farooq Follow the following steps to setup a basic desktop application using election.js. // Quickstart of simple electron app // commands to run to setup electron package in node.js npm init -y npm i -D electron // modified package.json "main": "main.js" "script": { "start": "electron ." } // create index.htmk and add content in // run electron app from main.js import {app, BrowserWindow} = require(electron); app.whenReady.then(() => { const win = new BrowserWindow({ width: 800, height: 600 }); win.loadFile('index.html'); }); // to compile the desktop application, run command npm start https://code.sololearn.com/ca9a6a20A5A1/?ref=app

+2

What you are asking to do us not possible using node.js. The solution proposed by Calvin will create an application but it will not draw on other applications or windows. It will exist only within its own window. Each application exists within its own process. Without using interprocess communications one application cannot effect the device context of another application. Or am I taking the meaning of your expression "draw on other applications of Windows" too literally?

+1

I can't imagine why you would want to use Node over C# for winforms...

+1

I never said I will use node over c# I am working with react.js node.js and react native also. And currently I am doing demo project for more practicing that is why I am asking. Aleksei Radchenkov

+1

Oh ok, you surely can make .net app that connects to socket.io: https://www.google.com/amp/s/bitstobrowser.wordpress.com/2015/12/18/connecting-a-node-app-using-socket-io-to-a-windows-forms-net-client-application/amp/

+1

Aleksei Radchenkov Thank you.

+1

Martin Taylor you are saying right I have found ipcMain (for the communication)

0

Calviղ Thank you

0

Calviղ thanks I was searching for interprocess communication and I misunderstood ipcMain.

0

Thanks Calviղ. My application has been completed the only thing that I am struggling on now is to activate mouse event true when pressing any key (in my case is 'z') and disabling mouse Event on pressing key(in my case is 'x').