WinUI3 : How to get Aeroplane mode toggle event in WinUI3 desktop Application in C++

150 Views Asked by At

I'm working of WinUI3 desktop application in C++. I was searching for a way to receive an event when user toggles airplane mode in windows.

I came across a way where where we can check Registry at

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\RadioManagement\SystemRadioState

with the help of RegNotifyChangeKeyValue

But in this way, we will receive an event handle from RegNotifyChangeKeyValue and have a worker thread continuously waiting for this event handler to be set.

Is there any other way to get the airplane mode toggle event instead of a thread continuously waiting on a register key event to happen?

It would be of great help if you could help me achieve this.

Thank you

0

There are 0 best solutions below