D
D
Dmitry Korolev2017-11-16 03:24:55
C++ / C#
Dmitry Korolev, 2017-11-16 03:24:55

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

4 answer(s)
D
Dmitry Korolev, 2017-11-17
@adressmoeistranici

To solve my problem, I still managed activated and bool)

C
cicatrix, 2017-11-16
@cicatrix

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.

Y
Yuuki Wesp, 2017-11-16
@AnotherAltr

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.

A
Alexander Ananiev, 2017-11-16
@SaNNy32

Handle the WM_WINDOWPOSCHANGED event

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question