WinUI3 : How to detect when user toggles aeroplane mode

Harshithraj1871 1,731 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 development | Windows App SDK
Developer technologies | C++
Developer technologies | 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.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 91,281 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 21,731 Reputation points
    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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.