Wifi USB LM816 access under WinCE

Hello,
we have your SOM iMX7 4GB with your Image WinCE 7.
We are improve our old hardware with your Toradex and we are using our previous
application that was running under WinCE 6 without any kind of problem.

We have buy from you the USB Wifi LM816.
We have installed your drivers under WinCE 7 and work properly used directly from OS.
Now we need re-call the interface settings Wifi that appear on WinCE system when you double click on its system tray icon from our application.
We have try different approch without results.

Do you have any suggestion about this?
Can you help us which some kind of example?

NOTE: in our previous release of the hardware (Engicam i.Core M51 - cortex A8) that was
using WinCE 6, we was able access to its system tray icon settings using PostMessage
in c++.

Regards

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

For integrating Wi-Fi USB LM816 access under Windows Embedded Compact 7 (WinCE 7) with your iMX7 4GB module and accessing the Wi-Fi interface settings programmatically, similar to how you did with WinCE 6, you can consider the following approach:

  1. Ensure Driver Compatibility: First, verify that the LM816 Wi-Fi driver is correctly installed and fully functional through the OS interface, as you’ve mentioned it works properly when used directly from the OS.

  2. Accessing Wi-Fi Settings Programmatically: Since you were able to access the system tray icon settings using PostMessage in C++ in your previous setup, the same approach should theoretically be possible in WinCE 7. However, the specific implementation might differ due to changes between WinCE 6 and WinCE 7.

  3. Using PostMessage or SendMessage: To simulate the action of double-clicking the system tray icon of the Wi-Fi interface, you would need to identify the window handle (HWND) of the system tray and the specific message that the Wi-Fi settings window responds to. This can be a challenge, as these details can vary and may not be documented.

  4. Alternative Methods: If directly invoking the Wi-Fi settings through PostMessage proves to be difficult, consider exploring the Windows CE Networking API for programmatically managing network interfaces. This may include functions to enumerate network adapters, connect to wireless networks, and modify adapter settings. The Wireless Zero Configuration (WZC) API, if available on your version of WinCE, could be particularly useful for managing Wi-Fi connections.

  5. Consult Microsoft Documentation: For detailed information on the available networking APIs in Windows Embedded Compact 7 and examples of how to use them, consulting the official Microsoft documentation is advisable. While specific examples for invoking the Wi-Fi settings UI programmatically might be scarce, the documentation on networking APIs could offer alternative approaches to achieve your goal.

  6. Community and Forums: Although direct support from Toradex for software development on WinCE is limited to hardware-related inquiries, the broader community of WinCE developers and forums dedicated to Windows Embedded development might offer insights or examples relevant to your scenario.

Given the specific nature of your request, focusing on software development practices for Windows Embedded Compact 7, the approach will largely depend on the available APIs and system behaviors specific to WinCE 7. Adapting your previous solution might require some experimentation with the system messages and APIs provided by the OS

Please, also check if these links can help you solve your problem:

Wi-Fi on Toradex Computer on Modules | Toradex Developer Center.

Could you please explain the reason why you need to invoke the WiFi dialog from your program? If you need to modify some WiFi parameters or do a connect/disconnect, you can accomplish this through the Native Wi-Fi functions.

Could you please specify the exact message you posted to achieve it?

Hello Mr.Alex,
an explain for understand our problem.
Before all, we are doing a new release of our hardware using your SOM iMX7 4GB with WinCE7 image furbished from you.
In addiction we have buy from you the USB Wifi LM816, we have installed the drivers without problems, work good and when
you double click on the icon in system tray notification, the wifi interface gui will be show.

Our previous harwdare was using a different SOM (Engicam i.Core M51 - cortex A8) with WinCE6 Image and was mounting
an USB Wifi VIA (similar like your LM816) and when you double click on the icon in system tray notification, the wifi interface gui will be show.

We are adapting/rewriting our previous software to work properly to the new WinCE7 and at the moment a big part of the sofwtare work properly.

Now, when our software run start in fullscren in both the hardwares, but with a difference about the wifi setting.
Below 2 links for understand better, the first video is the old hardware with WinCE6, the second video is the new hardware with iMX7 4G on WinCE 7.
PS: From the 2 software there is a graphical difference, but the funcionts are identical.

In attachment you find our current code about the button Wifi Settings in the video.

[https://www.accinni.com/0-Video/1 - Old Hardware WinCE6.mp4](https://www.accinni.com/0-Video/1 - Old Hardware WinCE6.mp4)

[https://www.accinni.com/0-Video/2 - New Hardware WinCE7.mp4](https://www.accinni.com/0-Video/2 - New Hardware WinCE7.mp4)

IMPORTANT NOTE:
Before contact your support we had using try using the native wifi functions, with a separate application, trying intergrate them on our software,
but always the results was the same “access denied” in some operations.
We have already loose about 3-4 weeks for a simple function that was previously working on WinCE6.
Normally try solve our problems by ourselve.

Now our situation is that we can’t sell our new hadware without an important function like Wifi for the updates, for the remote support of our customer, etc…

Best Regards

Our_Wifi_Code.cpp (4.68 KB)

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.

Hello Mr.Alex,
sorry for the delay, but I haven’t received your reply notification.
I will try your solution and I will inform you.

Best Regards

Hello,
I have try your code, but when I compile give me the error
“error C2065: ‘WM_WZCSYSTRAYICON’: identifier not declared”.

There is something that I must include on my code?

Best Regards

Hello Mr.Alex,
I have find the solution about the code and now I can open directly the LM816 window.
Below I post the code that can help someone else.

	HWND handle = ::FindWindow(NULL, L"NETRTWLANU1");
	if (handle != NULL)
	{
		::PostMessage(handle, WM_APP + 100, 1, WM_LBUTTONDBLCLK);
	}

Please can you help me with the other post named “Problem with our application using Autorun WinCE”?
Link:

Best Regards

The WM_WZCSYSTRAYICON id defined at c:\WINCE700\public\common\oak\drivers\netsamp\ethman\ethman.h

As for mentioned problem - please respond on all my and Germano questions in the related thread.

Ok thank you.