Get List of Installed Applications Windows Mobile

2019-08-09 14:16发布

问题:

I need to get List of Installed Application on Windows Mobile using C#.

After that, I want to have capability to get notifications when installed application starts, ends etc.

回答1:

When an app is installed by wceload, which is the typical install route, then an entry gets added in the registry here:

[HKEY_LOCAL_MACHINE\Software\Apps]

So you can enumerate keys and values here to determine what is installed and where in the file system it resides.

Getting a notification when an app starts is much, much more difficult because the system simply isn't designed to tell you that. The route I'd likely go is to use the Toolhelp API to periodically enumerate the running processes to determine what is new or gone. Microsoft does not provide a Toolhelp implementation, but it's fairly easy to P/Invoke, or you can use something like the SDF, which already has it done.



回答2:

For your second question, instead of GetCurrentProcess(), use GetProcess(string) or GetProcessById(int)

http://msdn.microsoft.com/en-us/library/x8b2hzk8.aspx

To get the process ID, you can p/invoke the ToolHelpAPI. Here's an article explaining that process: http://alexmogurenko.com/blog/programming/windows-cemobile-get-process-list-c/

-PaulH



回答3:

I got the answer from http://social.msdn.microsoft.com/Forums/en-US/windowsmobiledev/thread/eb43dce3-8b90-4c15-88bf-3791b4a97a58.