Get List of Installed Applications Windows Mobile (C# Managed)

不打扰是莪最后的温柔 提交于 2019-12-11 07:07: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.



来源:https://stackoverflow.com/questions/3869921/get-list-of-installed-applications-windows-mobile-c-managed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!