Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksoid <aleksoid@users.sourceforge.net>2008-08-22 06:00:31 +0400
committerAleksoid <aleksoid@users.sourceforge.net>2008-08-22 06:00:31 +0400
commit7526cad91172306628a2030f9dbf3370064c7189 (patch)
tree188c695dc98390c9c7c30abb3913719442f52502 /src/apps/mplayerc/PPageFormats.cpp
parent8982c186a3d1624c68e9218477557fe45cda3634 (diff)
CHANGE : Open directory(shell context menu or MPC-HC menu) - load only enqueue audio/video files, those with file extensions from the Formats page in MPC options
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@740 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PPageFormats.cpp')
-rw-r--r--src/apps/mplayerc/PPageFormats.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp
index 3a74652f5..639d8d470 100644
--- a/src/apps/mplayerc/PPageFormats.cpp
+++ b/src/apps/mplayerc/PPageFormats.cpp
@@ -124,6 +124,16 @@ bool CPPageFormats::IsRegistered(CString ext, CString strProgID)
{
BOOL bIsDefault = FALSE;
+ if (m_pAAR == NULL)
+ {
+ // Default manager (requiered at least Vista)
+ HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
+ NULL,
+ CLSCTX_INPROC,
+ __uuidof(IApplicationAssociationRegistration),
+ (void**)&m_pAAR);
+ }
+
if (m_pAAR)
{
// The Vista way
@@ -161,6 +171,7 @@ bool CPPageFormats::IsRegistered(CString ext, CString strProgID)
if (ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len))
bIsDefault = (strCommand.CompareNoCase(CString(buff)) == 0);
}
+
}
return !!bIsDefault;
@@ -173,10 +184,9 @@ bool CPPageFormats::RegisterExt(CString ext, CString strProgID, CString strLabel
if(!fRegister)
{
-
- SetFileAssociation (ext, strProgID, fRegister);
+ if(fRegister != IsRegistered(ext, strProgID))
+ SetFileAssociation (ext, strProgID, fRegister);
key.Attach(HKEY_CLASSES_ROOT);
- //key.RecurseDeleteKey(strProgID+_T("\\shell"));
key.RecurseDeleteKey(strProgID);
return(true);
}
@@ -452,6 +462,16 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f
ULONG len = sizeof(buff);
memset(buff, 0, len);
+ if (m_pAAR == NULL)
+ {
+ // Default manager (requiered at least Vista)
+ HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
+ NULL,
+ CLSCTX_INPROC,
+ __uuidof(IApplicationAssociationRegistration),
+ (void**)&m_pAAR);
+ }
+
if (m_pAAR)
{
// The Vista way