Suppressing cannot connect messages

In the space of 1 day I’ve had two different customers approach me about a problem they have with Windows Mobile in use in a Line of Business environment.  Essentially they want to stop the ‘Cannot Connect’ notification/bubble.  The problem is that it is not suppressible through a registry modification and can only be achieved through some custom coding to effectively hide the window.

This isn’t very elegant and isn’t supported by Microsoft however it does work.   🙂

To suppress the notification you need to use the following code:

HWND hwnd = ::FindWindow(L”Dialog”,L”Cannot Connect”);

if ( hwnd != NULL )


This basically hides the Cannot Connect Window.

Comments (2)
  1. Michael says:

    Just curious: wouldn’t you have to contain this in a polling loop of some sort? Or is there a more efficient way to do this?

    This looks like something that would only be usable once the window has been created. So, unless there’s a way to know when the window will be created (which could help avoid the need to poll FindWindow() every few seconds), the responsiveness of the app may drop if the app isn’t threaded properly.

    If the only way to do this is with a poll, depending on the timing, the "Cannot Connect" notification/bubble would still show up, wouldn’t it? It would only be closed at the next closest interval (e.g. after 0.5 seconds).

    Any thoughts?

    Note: I could be completely off-base here as I haven’t dealt with connectivity much yet, so I’m just relying on assumptions of how I think the surrounding code may look.

    …Just thought it was an interesting post and thought I’d put in my two cents.

  2. MSDNArchive says:

    Michael – You could either setup it up as a Poll or when you create a new connection

Comments are closed.