locked
how to get the wi-fi connection state? RRS feed

  • Question

  • hello, 

      In my application, I wanna the wi-fi connection's state which is connected or not. but I don't know how? I worked at vs2008 for wm6.

     Any idea regarding the above issue is appreciated.

     Thanks

    Tuesday, June 1, 2010 11:17 AM

Answers

  • Hello,

     

    Check out snapi.h file there u will find:-

     

    #define SN_WIFISTATEHARDWAREPRESENT_BITMASK 1

    #define SN_WIFISTATEPOWERON_BITMASK 2

     

    etc. so you can use Registry Notification mechanism to get wifi status.

     

    Thanks

    Arpit Pradhan


    WinCE CODER (If you think my solution help you in some sense do mark my Reply as Answer)
    • Marked as answer by warrentang Monday, June 7, 2010 4:15 AM
    Tuesday, June 1, 2010 11:55 AM
  • If you are using managed code you can also get this information from the SystemState class

    http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate_members(v=MSDN.10).aspx

    The class is essentially a managed wrapper for what NEO131 just mentioned. 


    Joel Ivory Johnson | http://www.j2i.net | Device Application Development MVP
    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.
    • Marked as answer by warrentang Monday, June 7, 2010 4:15 AM
    Tuesday, June 1, 2010 1:42 PM

All replies

  • Hello,

     

    Check out snapi.h file there u will find:-

     

    #define SN_WIFISTATEHARDWAREPRESENT_BITMASK 1

    #define SN_WIFISTATEPOWERON_BITMASK 2

     

    etc. so you can use Registry Notification mechanism to get wifi status.

     

    Thanks

    Arpit Pradhan


    WinCE CODER (If you think my solution help you in some sense do mark my Reply as Answer)
    • Marked as answer by warrentang Monday, June 7, 2010 4:15 AM
    Tuesday, June 1, 2010 11:55 AM
  • If you are using managed code you can also get this information from the SystemState class

    http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate_members(v=MSDN.10).aspx

    The class is essentially a managed wrapper for what NEO131 just mentioned. 


    Joel Ivory Johnson | http://www.j2i.net | Device Application Development MVP
    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.
    • Marked as answer by warrentang Monday, June 7, 2010 4:15 AM
    Tuesday, June 1, 2010 1:42 PM