As I can see you are using
PostMessage(HWND_BROADCAST, WM_APP+100, 1, WM_LBUTTONDBLCLK);
to invoke WiFi dialog.
The behavior of the PostMessage function was changed in WinCE 7 and now now:
" Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter-application communication.
The system only does marshalling for system messages (those in the range 0 to (WM_USER-1)). To send other messages (those >= WM_USER) to another process, you must do custom marshalling.
If you send a message in the range below WM_USER to the asynchronous message functions (PostMessage, SendNotifyMessage, and SendMessageCallback), its message parameters cannot include pointers. Otherwise, the operation will fail. The functions will return before the receiving thread has had a chance to process the message and the sender will free the memory before it is used.
So basically, you need to send a WM_LBUTTONDBLCLK
message directly, not by broadcast. For the LM816 window, the name is NETRTWLANU1
. You can use the following code:
HWND handle = FindWindow(NULL, L"NETRTWLANU1”);
if (hwnd != NULL) {
PostMessage(handle, WM_WZCSYSTRAYICON, 1, WM_LBUTTONDBCLK);
}
As about native WiFi functions:
Some Native Wi-Fi APIs return “ERROR_ACCESS_DENIED” if the Connection Manager is included in the OS design. So, the Connection Manager should not be included in the WinCE 7 image. The connection manager can be disabled temporarily by using this registry. Import it using Regedit tool and save registry and then reboot.