Setting file associations in Windows mobile 5+

蓝咒 提交于 2020-01-04 13:43:38

问题


Its basically the same as in windows, but when your trying to set file associations to a program that lives inside a folder that has spaces in it you need to get the "short" name of that folder. In regular windows i use this:

[System.Runtime.InteropServices.DllImport("Kernel32.dll")] private static extern uint GetShortPathName(string lpszLongPath, [Out] StringBuilder lpszShortPath, uint cchBuffer);

So my question becomes, does anyone know of a built in function i can use to replace the above function, or know of a exacly what this function does so i could recreate it in C#.


回答1:


Windows CE, which is the base of WinMo, doesn't use 8.3 file naming for anything, so I'm certain that you don't need to use them for defining file associations.




回答2:


Who said you need the short path to set the file association in regular Windows? I just tried it myself real quick, and had no problems adding the keys to the registry with spaces. I then double checked the registry and sure enough, there are spaces there. The file type I associated with the program launches just fine, and the program lives in a directory with multiple spaces all over the place.



来源:https://stackoverflow.com/questions/517289/setting-file-associations-in-windows-mobile-5

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