1

I want to force other app to quit before launching my application like prompting to close. It seems to me a dead end. I can block keys but not other app running in taskbar

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
SameerKhan1406
  • 289
  • 5
  • 18

1 Answers1

0

You can use shelljs and execute a shell command to get the process ID of the application that you want to close. e.g. see this answer of how to get pid using pgrep

Once you have the PID you can kill that process using process.kill(PID)

This is the first thing you can do inside your app.on('ready', eventHandler) ;

Community
  • 1
  • 1
shashi
  • 4,616
  • 9
  • 50
  • 77
  • You are not getting my problem, i want to stop user to close every window before my app launch since i don't know the current open application how would i close it in the first place. My Task- To stop user from capturing my app activity example- Online Examination prompt you to not close application else test will be closed. I am using nodejs javascipt in electron framework so i have tried kiosk mode but failed(only full window working) since user can swap windows and minimize then i used javascript to block some key combination but still there is minimize window button visible – SameerKhan1406 Oct 15 '16 at 08:00