存储卡的问题,在Windows Mobile存储卡、问题、Mobile、Windows

2023-09-06 08:27:13 作者:命运的残酷╰☆

我米制作的Windows Mobile应用程序,它是指一些DLL的,但我有一些问题在这里。 想象一下,我的应用程序安装在存储卡相关DLL的present在存储卡而已, 如果我启动应用程序是指某些DLL的,现在我将删除存储卡,仍然是我的应用程序将被运行,也不会它会导致重新启动我的移动设备的退出,最终只有.. 我得到的divice卡移除通知,但其在DLL和它的C ++ code ..如果取出卡没有DLL将是present在存储卡上,我不甚至得到通知也是用C#我不就没怎么获得在C#中的卡中删除的通知。如何处理这些情况,请让我知道。

I m making windows mobile application, it refers some DLL's but i have some problem here. Imagine my application is installed in storage card related DLL's present in Storage card only, if i launch application it refers some of DLL, now i will remove the storage card, still my application will be running,it will not quit only ultimately it leads to restart of my mobile device.. i do get the divice card remove notification but its in DLL and its c++ code.. if card is removed no DLL will be present in storage card, i dont even get the notification also in c# i dont no how to get the card removed notification in c#. how to handle these scenarios please let me know.

感谢

推荐答案

您可以使用该功能的 SHChangeNotifyRegister 以 WM_FILECHANGEINFO 的消息。

You can use the function SHChangeNotifyRegister to WM_FILECHANGEINFO message.

您订阅,您将收到与IDS事件,如 SHCNE_DRIVEREMOVED SHCNE_MEDIAREMOVED 之后,这样你就可以触发当删除了一些动作的存储卡。

After you subscribe, you will be receiving events with ids such as SHCNE_DRIVEREMOVED or SHCNE_MEDIAREMOVED, so you can trigger some actions when storage card is removed.

要使用本机的功能,从紧凑的框架,使用的P / Invoke。

To use native functions from the compact framework, use P/Invoke.