Suppress the "Cannot connect" notification bubble

Last post 06-30-2011 12:38 by Sashi. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-05-2008 13:39

    Suppress the "Cannot connect" notification bubble

    Hi,

    Every time my device attempts to connect to a VPN server, the notification 
    window comes up saying it is connecting (allowing the user to click 
    Hide/Cancel) and saying if the connection failed (after which the user 
    must hit dismiss, or my software will not try to connect again 
    because the event never gets called that the connection completed).  SO.  
    I found that the SDK for windows-based smartphones references a 
    CONNMGR_FLAG_NO_ERROR_MSGS flag that is set up in the 
    CONNMGR_CONNECTIONINFO struct in order to solve this problem.  
    But I can't see a managed code counterpart in the OpenNETCF.Net 
    documentation.  Is there any hope?!!!
     
     Thank you,
    Brandon 

     

  • 11-07-2008 13:44 In reply to

    Re: Suppress the "Cannot connect" notification bubble

    I had to go ahead and fix it.  It involves basically what I referred to in the first post:

    1.) Buy the OpenNETCF source code (I got it for $50).  This solution assumes version 2.2.

    2.) In ConnMgr.cs of OpenNETCF.Net, add the following line to the declarations section at the top:

            private const int CONNMGR_FLAG_NO_ERROR_MSGS = 0x40;

    3.) Also in ConnMgr.cs, add that flag to the Connect(Guid, bool, ConnectionMode) function where it sets dwFlags, like so:

            connInfo.dwFlags = CONNMGR_FLAG_NO_ERROR_MSGS;

    (this assumes dwFlags is currently set to 0; if there is another flag already there, then append "| CONNMGR_FLAG_NO_ERROR_MSGS;" to it.

     

    Compile it and reference this new OpenNETCF lib, it will not fire error notifications anymore.  This doesn't stop the "Connect to" notifications, though, which have a "Cancel" option.  That's bothersome, for me, because the users I'm developing this app for would be just the ones to hit that cancel button and wonder why it wasn't connecting.  ;)  To suppress this notification bubble, go into the device's HKEY_CURRENT_USER\ControlPanel\Notifications key and find the Guid that has (Default) set to "Connection established."

    In that key, change the Options from 8 to 0.

    -Brandon
  • 11-08-2008 6:37 In reply to

    • Neil
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-30-2007
    • North Wales
    • Posts 1,349

    Re: Suppress the "Cannot connect" notification bubble

    I'll roll this fix into the current branch. I can't guarantee it will be available in the next release as we're already code complete (I'll see if we can slip this in, though).

    As for the connecting notification, we can roll a method so you can programmatically enable/disable the notification.

    Neil Cowburn
    OpenNETCF Consulting

      
  • 11-08-2008 9:22 In reply to

    Re: Suppress the "Cannot connect" notification bubble

    Thanks, Neil, glad I could help.

     -Brandon

  • 12-08-2008 9:23 In reply to

    Re: Suppress the "Cannot connect" notification bubble

    Any word on if this made it into the 2.3 Release?
  • 12-08-2008 9:27 In reply to

    • Neil
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-30-2007
    • North Wales
    • Posts 1,349

    Re: Suppress the "Cannot connect" notification bubble

    No, it didn't. 

    Neil Cowburn
    OpenNETCF Consulting

      
  • 06-30-2011 12:38 In reply to

    • Sashi
    • Not Ranked
    • Joined on 06-29-2011
    • Posts 1

    Re: Suppress the "Cannot connect" notification bubble

    Any idea on when this fix will be available in a public release?
Page 1 of 1 (7 items)