WinUI3 : How to detect when user toggles aeroplane mode

Harshithraj1871 1,496 Reputation points
2022-12-28T12:55:38.893+00:00

Hi,

I'm working of WinUI3 desktop application. Is there any way where we can detect when user toggles aeroplane mode. Is there any event which gets triggered when aeroplane mode is toggled I tried searching online but was not able to find any solutions.

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

Thank you.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
725 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,527 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,721 Reputation points
    2022-12-28T13:47:21.71+00:00

    A way can be to check Registry at
    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\RadioManagement\SystemRadioState
    (for example with RegNotifyChangeKeyValue)

    1 person found this answer helpful.

  2. Junjie Zhu - MSFT 14,751 Reputation points Microsoft Vendor
    2023-01-31T06:48:23.1933333+00:00

    Hi there,

    Maybe you can try this, MobileBroadbandRadioStateChangeTrigger.

    Represents a trigger that indicates when mobile broadband radio state has changed. For example, this trigger activates when a mobile device transitions to or from airplane mode. This functionality is available only to mobile operator apps and UWP app given privileged access by mobile network operators.

    This is a winRT API, because of my equipment, I can't help you test.

    0 comments No comments