Skip to content

SJEllipses/libwin_airplanemode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libwin_airplanemode

Airplane Mode (Flight Mode) library and sample for Windows

Note

The major code is derived from an answer in a Stack Overflow question

Provided by user3296587

Remember to use the [STAThread] attribute on your C# entry point, because the library relies on COM

Return value

GetAirplaneMode()

1: Airplane Mode is ON
0: Airplane Mode is OFF
1003(ERR_GETSYSTEMRADIOSTATE): Failed to call GetSystemRadioState()

SetAirplaneMode()

0: Airplane Mode has been set successfully
1004(ERR_SETSYSTEMRADIOSTATE): Failed to call SetSystemRadioState()

Both

1001(ERR_COINITIALIZE):Failed to call CoInitialize()
1002(ERR_COCREATEINSTANCE):Failed to call CoCreateInstance()

Build

MSVC:

  1. Go to Developer Command Prompt for VS or Developer PowerShell for VS
  2. run build_MSVC.bat

MinGW:

  1. run build_MinGW.bat

Screenshot

demo

About

Airplane Mode (Flight Mode) library and sample for Windows

Topics

Resources

License

Stars

Watchers

Forks

Contributors