Close window by taskbar but the window will not show again while clicking the tray icon


#1

Currently I am using Electron to develop a desktop app.Here there is a taskbar icon and a tray icon for my app.If I right click the taskbar icon and chose to close the window(seems like a native feature of the Window system),it is some kind of my app’s main window is closed(or destroy).But still there is the tray icon that doesn’t show the main window when I click it.Please help!


#2

Currently there is no answer


#3

Please post your tray icon code.


#4

Actually it is not about the tray icon.I just want to know how to minimize the main window when I close the taskbar icon.And why electron doesn’t have an api for taskbar?


#5

It would help if you specified which OS you’re referring to. Different operating systems have different ways they operate and it may be that you’re misunderstanding the operating system’s standard way of doing things.

Additionally, please include a space after each period, comma, exclamation point or question mark. It will make your text easier for others to read.


#6

Window 10. Just like this:


#7

If I’m understanding your description correctly, you should probably take a look at the boilerplate in the Quick Start section of the documentation on the Electron website:

http://electron.atom.io/docs/tutorial/quick-start/#write-your-first-electron-app

It has a number of comments about how to handle window management that follow standard operating system conventions.