return ListView_FindItem(hDlgCtrl, 0, &findInfo);
}
+static BOOL
+DeleteExt(HWND hwndDlg, LPCWSTR pszExt)
+{
+ if (*pszExt != L'.')
+ return FALSE;
+
+ HKEY hKey;
+ LONG nResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszExt, 0, KEY_READ, &hKey);
+ if (nResult != ERROR_SUCCESS)
+ return FALSE;
+
+ WCHAR szValue[64];
+ DWORD cbValue = sizeof(szValue);
+ nResult = RegQueryValueExW(hKey, NULL, NULL, NULL, LPBYTE(szValue), &cbValue);
+ RegCloseKey(hKey);
+ if (nResult != ERROR_SUCCESS)
+ return FALSE;
+
+ if (szValue[0])
+ SHDeleteKeyW(HKEY_CLASSES_ROOT, szValue);
+
+ return SHDeleteKeyW(HKEY_CLASSES_ROOT, pszExt) == ERROR_SUCCESS;
+}
+
static
VOID
InsertFileType(HWND hDlgCtrl, WCHAR * szName, PINT iItem, WCHAR * szFile)
return FALSE;
}
+ // Delete the extension
+ CStringW strExt(L".");
+ strExt += find.psz;
+ strExt.MakeLower();
+ DeleteExt(hwndDlg, strExt);
+
// Delete the item
ListView_DeleteItem(pNewExt->hwndLV, iItem);
}
return TRUE;
}
+static BOOL
+FileTypesDlg_RemoveExt(HWND hwndDlg)
+{
+ HWND hListView = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
+
+ INT iItem = ListView_GetNextItem(hListView, -1, LVNI_SELECTED);
+ if (iItem == -1)
+ return FALSE;
+
+ WCHAR szExt[20];
+ szExt[0] = L'.';
+ ListView_GetItemText(hListView, iItem, 0, &szExt[1], _countof(szExt) - 1);
+ CharLowerW(szExt);
+
+ if (DeleteExt(hwndDlg, szExt))
+ {
+ ListView_DeleteItem(hListView, iItem);
+ return TRUE;
+ }
+ return FALSE;
+}
+
// IDD_FOLDER_OPTIONS_FILETYPES dialog
INT_PTR
CALLBACK
FileTypesDlg_AddExt(hwndDlg, newext.szExt, newext.szFileType);
}
break;
+ case IDC_FILETYPES_DELETE:
+ {
+ CStringW strRemoveExt(MAKEINTRESOURCEW(IDS_REMOVE_EXT));
+ CStringW strTitle(MAKEINTRESOURCEW(IDS_FILE_TYPES));
+ if (MessageBoxW(hwndDlg, strRemoveExt, strTitle, MB_ICONQUESTION | MB_YESNO) == IDYES)
+ {
+ FileTypesDlg_RemoveExt(hwndDlg);
+ }
+ }
+ break;
case IDC_FILETYPES_CHANGE:
pItem = FindSelectedItem(GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW));
if (pItem)
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "Musisz podać rozszerzenie."
IDS_NEWEXT_ALREADY_ASSOC "Rozszerzenie %s jest już związane z typem plików %s. Czy chcesz usunąć powiązanie %s z %s i utworzyć dla niego nowy typ plików?"
IDS_NEWEXT_EXT_IN_USE "Rozszerzenie jest w użyciu"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
IDS_NEWEXT_SPECIFY_EXT "You must specify an extension."
IDS_NEWEXT_ALREADY_ASSOC "Extension %s is already associated with File Type %s. Do you want to un-associate %s with %s and create a new File Type for it?"
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
+
+ IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
END
#define IDS_NEWEXT_ALREADY_ASSOC 30520
#define IDS_NEWEXT_EXT_IN_USE 30521
+#define IDS_REMOVE_EXT 30522
+
/* Dialogs */
/* Run dialog */