Answer the question
In order to leave comments, you need to log in
Event that you clicked on the application icon in the taskbar?
How do I know that I clicked on the window icon in the taskbar?
I can't find it in the studio...
activated doesn't fit(
Answer the question
In order to leave comments, you need to log in
To solve my problem, I still managed activated and bool)
Clicking on the icon in the taskbar launches the application. If your application is already running, another copy will start.
If you want your application to run only once (in one instance), then there are several approaches - either create a mutex in the system and hold it until exit (when restarting, if the mutex is busy, terminate the application), a similar solution is described here . (The activation code for the window of an already running application is also given there, if it is minimized).
Alternatively, you can list running processes, search for your own process, and exit if found.
Or, any lockable system resource (for example, a file) can be used as a mutex, but this is not correct.
You can also use a named pipe ( named pipe ), but this is more cumbersome and should only be used if you need to communicate between multiple copies of your application.
Here, most likely, you will have to write a library on WinAPI.
There are quite a few libraries for working with the taskbar, and they are all very crooked.
Well, as an option, you can combine the minimize & maximize events.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question