1
0

PathsINI.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author: Ben Allison [email protected]
  6. ** Created:
  7. **/
  8. #include "main.h"
  9. #include "../nu/AutoWide.h"
  10. #include "../nu/AutoChar.h"
  11. #include "../nu/ns_wc.h"
  12. void LoadPathsIni()
  13. {
  14. wchar_t pathsini[MAX_PATH] = {0};
  15. wchar_t dir[1024] = {0};
  16. PathCombineW(pathsini, PROGDIR, L"paths.ini");
  17. GetPrivateProfileStringW(L"Winamp", L"inidir", L"", dir, 1024, pathsini);
  18. if (dir[0])
  19. {
  20. ResolveEnvironmentVariables(dir, 1024);
  21. config_setinidir(dir);
  22. }
  23. GetPrivateProfileStringW(L"Winamp", L"m3udir", L"", dir, 1024, pathsini);
  24. if (dir[0])
  25. {
  26. ResolveEnvironmentVariables(dir, 1024);
  27. config_setm3udir(dir);
  28. }
  29. GetPrivateProfileStringW(L"Winamp", L"m3ubase", L"", dir, 1024, pathsini);
  30. if (dir[0])
  31. {
  32. ResolveEnvironmentVariables(dir, 1024);
  33. config_setm3ubase(dir);
  34. }
  35. GetPrivateProfileStringW(L"Winamp", L"inifile", L"", dir, 1024, pathsini);
  36. if (dir[0])
  37. {
  38. ResolveEnvironmentVariables(dir, 1024);
  39. config_setinifile(dir);
  40. }
  41. GetPrivateProfileStringW(L"Winamp", L"class", L"", dir, 1024, pathsini);
  42. if (dir[0])
  43. {
  44. ResolveEnvironmentVariables(dir, 1024);
  45. StringCchCopyW(szAppName, 64, dir);
  46. }
  47. GetPrivateProfileStringW(L"Winamp", L"cwd", L"", dir, 1024, pathsini);
  48. if (dir[0])
  49. {
  50. ResolveEnvironmentVariables(dir, 1024);
  51. StringCchCopyW(config_cwd, MAX_PATH, dir);
  52. //MultiByteToWideCharSZ(CP_ACP, 0, dir, -1, config_cwd, MAX_PATH);
  53. }
  54. }