Creating a background process using the system tray icon

I am trying to make a windows application that checks some things in the background and informs the user through the systray icon.

The application is executed using unmanaged C ++ and there is no way to switch to .net or Java.

If the user wants to stop the application, he will use the tray icon.

An application cannot be a Service because of the systray side and because it must be executed without installing any actions on the user's computer (this is one .exe)

Using the typical Win32 program structure (RegisterClass, WndProc, etc.), I don’t know how I can put some code to mark up the window message loop. Maybe I need to use CreateProcess () or CreateThread ()? Is this the right way to handle multithreaded media?

If I need to use CreateProcess () / CreateThread (), how can I communicate between two threads?

Thanks;)

+3
source share
3 answers

As for the system tray icon, you'll need Shell_NotifyIcon.

See http://msdn.microsoft.com/en-us/library/bb762159.aspx

+2
source

, , . API CreateThread. ++, , , C- .

, , , . - .

0

, , . , . , , , CreateThread, . . , . , .

0

Source: https://habr.com/ru/post/1713655/


All Articles