diff --git a/stepmania/src/archutils/Win32/RegistryAccess.h b/stepmania/src/archutils/Win32/RegistryAccess.h index 27b37ed0a9..7672ceb67b 100644 --- a/stepmania/src/archutils/Win32/RegistryAccess.h +++ b/stepmania/src/archutils/Win32/RegistryAccess.h @@ -7,7 +7,13 @@ namespace RegistryAccess { bool GetRegValue( const CString &key, const CString &sName, CString &val ); - bool GetRegValue( const CString &key, CString sName, int &val ); + bool GetRegValue( const CString &key, const CString &sName, int &val ); + bool GetRegValue( const CString &key, const CString &sName, bool &val ); + + bool SetRegValue( const CString &key, const CString &sName, const CString &val ); + bool SetRegValue( const CString &key, const CString &sName, int val ); + bool SetRegValue( const CString &key, const CString &sName, bool val ); + bool GetRegSubKeys( const CString &key, vector &lst, const CString ®ex = ".*", bool bReturnPathToo = true ); } diff --git a/stepmania/src/archutils/Win32/SpecialDirs.cpp b/stepmania/src/archutils/Win32/SpecialDirs.cpp new file mode 100644 index 0000000000..1e8cebdc9d --- /dev/null +++ b/stepmania/src/archutils/Win32/SpecialDirs.cpp @@ -0,0 +1,50 @@ +#include "global.h" +#include "SpecialDirs.h" +#include "RegistryAccess.h" +#include + +CString GetMyDocumentsDir() +{ + CString sMyDocumentsDir; + bool bSuccess = RegistryAccess::GetRegValue( "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", sMyDocumentsDir ); + ASSERT( bSuccess ); + sMyDocumentsDir.Replace( '\\', '/' ); + sMyDocumentsDir += "/"; + return sMyDocumentsDir; +} + +CString GetApplicationDataDir() +{ + CString sApplicationDataDir; + TCHAR szDir[MAX_PATH] = ""; + BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_APPDATA, FALSE ); + ASSERT( bResult ); + sApplicationDataDir = szDir; + sApplicationDataDir += "/"; + return sApplicationDataDir; +} + +/* + * (c) 2002-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/archutils/Win32/SpecialDirs.h b/stepmania/src/archutils/Win32/SpecialDirs.h new file mode 100644 index 0000000000..acebc451e6 --- /dev/null +++ b/stepmania/src/archutils/Win32/SpecialDirs.h @@ -0,0 +1,32 @@ +#ifndef SpecialDirs_H +#define SpecialDirs_H + +CString GetMyDocumentsDir(); +CString GetApplicationDataDir(); + +#endif + +/* + * (c) 2002-2004 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */