Questions tagged [windows-system-events]

3 questions
0
votes
1 answer

.NET Console App - can it detect its own imminent termination due to system shutdown?

I have a small console app that runs continuously on an Azure Windows 10 VM, doing some calculations. But I would like it if the job could detect when the VM is about to reboot, or when it itself is about to terminate, and write something to…
Ann L.
  • 13,760
  • 5
  • 35
  • 66
0
votes
1 answer

How to run official SetWinEventHook example code on Windows platform?

I want to try and run the official SetWinEventHook() example given at https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwineventhook: // Global variable. HWINEVENTHOOK g_hook; // Initializes COM and sets up the event…
Alok
  • 7,734
  • 8
  • 55
  • 100
0
votes
0 answers

How to create a service for monitoring of opening and switching of active application on Windows using Win32 api?

I want to create the simplest service for monitoring which new application I am opening or which application I am switching to make it active window/application on Windows 10+ using the Win32 api. Purpose of this exercise is to track my activity of…
Alok
  • 7,734
  • 8
  • 55
  • 100