quote:
Originally posted by deAd
quote:
Originally posted by CookieRevised
1) It is not always the same (as in a subdir under the application directory) for everybody when they first install Plus!.
2) _every_ directory under Documents and settings (including documents & settings itself) can be renamed and moved by the Windows user.
And even if nothing changed, you must never ever hard code a path.
I have changed the code to get the path using SHGetFolderPath. It will be changed in the next update . I have not accounted for (1) yet, and imo (2) is pretty unlikely -- wouldn't that screw up Plus! as well?
this still isn't correct....
The proper and only correct way to get to the custom sound dir is using the exact same method as Plus! uses, which is:
1) get the APPDATA path by using the SHGetSpecialFolderLocation (with CSIDL_COMMON_APPDATA) and SHGetPathFromIDList APIs
2) If no path is returned or those functions fail, get Plus!'s installation directory from the registry, and append the subdirectory "Data" to it.
3) Only after doing all that, you can append the directory "Messenger Plus!\Custom Sounds" to the path you get from 1 or 2.
^^ trade secret here?
quote:
Originally posted by deAd
wouldn't that screw up Plus! as well?
no as Plus! uses proper methods to get paths like "documents and settings", "program files", etc, etc... it uses the SHGetSpecialFolderPath , SHGetSpecialFolderLocation, SHGetPathFromIDList, etc APIs like every program should (and does).