In our application, we use the CpuLoad event for that, although you can use another timer event for that as well.
Periodically we want to update our UI with the current list of running processes and display their properties. an access violation or any other SEH exception will be caught with try statement to iterate over all running processes. To direct all SEH exceptions to standard C++ try catch, you need to specify the /EHa compiler option.
Note: If you examine the code carefully, you will notice that instead of _try _except, I use (prefer) the standard C++ try catch statement. Baah, you can't use this Win32 (C++) mechanism in C#. Eventually it turned out that the MSDN documentation warns you about possible flaws in the code as it states that all ToolHelp calls should be protected with a WIN32 _try _except block. Surrounding the P/Invoke call with a C# try catch block didn't help. If you query properties of a running process that was stopped/killed during the query, it turned out that the ToolHelp API crashed your. At first that seemed to work fine, but then I discovered a nasty problem. So I started writing code that called those functions through P/Invoke. NET Framework has no libraries that give direct access to the WIN32 ToolHelp API. In order to write programs that require a nice User Interface, I prefer to use the Compact. To write your own Task Manager (be it desktop Windows or Windows Embedded CE), you can use Microsoft’s ToolHelp API libraries (available for both Windows Embedded CE and desktop Windows) that help you with querying memory usage, system resources. So we decided to write our own one, moreover we can now add new features when we need them. At first we searched the Internet, but we couldn't find a convenient tool that included all our requirements. Unfortunately such a tool does not exist for Windows Embedded CE out-of-the-box.
One tool to judge the overall behavior of our current system (CPU load, memory allocation, thread count.) is a Task Manager, also known from desktop Windows. To monitor the real time behavior of our applications, we use a lot of monitor and trace tools, among them a few self-written tools. Since a few years, we use Windows Embedded CE (5.0 and 6.0) for that purpose. A minimum requirement for the job is that you have a Real Time Operating System (RTOS).
timing in which software executes code that should be deterministic and predictable. Backgroundįor work I write software for controlling machines in real time, i.e.
How you do that is out of the scope of this article. As there is no Windows Mobile version yet available based on this version of Windows Embedded CE, you need to develop your own OS image. However, the code was also tested for Windows Embedded CE 6.0, which uses a different memory model.
The SDK also ships with a full featured emulator, a powerful and indispensable tool to test your applications.Įxperienced developers will know that Windows Mobile 6.x is based on Windows Embedded CE 5.0. In order to develop applications for Windows Mobile 6.x from within Visual Studio 2005 or 2008, you need to download a separate SDK from Microsoft. The sample code runs on Windows Mobile 6.x or any other Windows Embedded CE based OS image.
This article describes how to write a Task Manager for the Windows Embedded CE OS.