Running in the background

  • Thread starter Thread starter Jesper Dk
  • Start date Start date
J

Jesper Dk

Hi, I would like to create an idle running application
that runs in the background using very few resources for
the simple purpose to react on WM_QUERYENDSESSION and
then invoke some shutdown(or log of) code. Is it possible
to make such an app showing an icon next to the clock in
the task bar. It should not be a minimize console
application. Please read further below.







Hi,

I'm afraid there's no such folder. You could launch your
program on startup
instead, set a system hook reacting on WM_QUERYENDSESSION
notifications and
do your job there.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

in message
Hi,

I need to invoke a program when the commands the computer
to logs of or shut down. Is there an equivalent to the
startup folder for this purpose.

Best regards Jesper.

..
 
Jesper,

You can just create a windows application where the main form is not
visible, and it doesn't have a task bar entry (there are properties on the
Form class to control this). In addition, you can add a TrayIcon instance
to the form to get the tray icon.

Finally, you would have to override the WndProc method to handle the
WM_QUERYENDSESSION windows message.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jesper Dk said:
Hi, I would like to create an idle running application
that runs in the background using very few resources for
the simple purpose to react on WM_QUERYENDSESSION and
then invoke some shutdown(or log of) code. Is it possible
to make such an app showing an icon next to the clock in
the task bar. It should not be a minimize console
application. Please read further below.







Hi,

I'm afraid there's no such folder. You could launch your
program on startup
instead, set a system hook reacting on WM_QUERYENDSESSION
notifications and
do your job there.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

in message
Hi,

I need to invoke a program when the commands the computer
to logs of or shut down. Is there an equivalent to the
startup folder for this purpose.

Best regards Jesper.

.
 
Back
Top