[REGEDIT]

- Re-number some resource IDs.
- Add key exportation message-box error (thus removing some fwprintf calls).
- Use IDS_MY_COMPUTER localized string instead of hardcoded one.

svn path=/trunk/; revision=57490
This commit is contained in:
Hermès Bélusca-Maïto 2012-10-05 20:08:16 +00:00
parent 7989048604
commit 7114e59e63
32 changed files with 150 additions and 118 deletions

View file

@ -325,7 +325,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
WNDPROC oldproc; WNDPROC oldproc;
HFONT hFont; HFONT hFont;
WCHAR buffer[MAX_PATH]; WCHAR buffer[MAX_PATH];
/* load "My Computer" string */
/* Load "My Computer" string */
LoadStringW(hInst, IDS_MY_COMPUTER, buffer, COUNT_OF(buffer)); LoadStringW(hInst, IDS_MY_COMPUTER, buffer, COUNT_OF(buffer));
g_pChildWnd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ChildWnd)); g_pChildWnd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ChildWnd));

View file

@ -85,8 +85,7 @@ static void OnInitMenu(HWND hWnd)
} }
else else
{ {
while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION)) while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION)) ;
;
} }
lResult = RegOpenKeyW(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey); lResult = RegOpenKeyW(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey);
@ -436,7 +435,7 @@ static BOOL ImportRegistryFile(HWND hWnd)
{ {
BOOL bRet = FALSE; BOOL bRet = FALSE;
OPENFILENAME ofn; OPENFILENAME ofn;
WCHAR Caption[128], szTitle[256], szText[256]; WCHAR Caption[128], szTitle[512], szText[512];
HKEY hKeyRoot; HKEY hKeyRoot;
LPCWSTR pszKeyPath; LPCWSTR pszKeyPath;
@ -455,14 +454,15 @@ static BOOL ImportRegistryFile(HWND hWnd)
wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */ wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
{ {
/* Open the file */ /* Open the file */
FILE *fp = _wfopen(ofn.lpstrFile, L"r"); FILE* fp = _wfopen(ofn.lpstrFile, L"r");
/* Import it */ /* Import it */
if (fp == NULL || !import_registry_file(fp)) if (fp == NULL || !import_registry_file(fp))
{ {
LPSTR p = GetMultiByteString(ofn.lpstrFile); /* Error opening the file */
fwprintf(stderr, L"Can't open file \"%s\"\n", p); LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
HeapFree(GetProcessHeap(), 0, p); LoadStringW(hInst, IDS_IMPORT_ERROR, szText, COUNT_OF(szText));
InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile);
bRet = FALSE; bRet = FALSE;
} }
else else
@ -470,7 +470,7 @@ static BOOL ImportRegistryFile(HWND hWnd)
/* Show successful import */ /* Show successful import */
LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText)); LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
MessageBoxW(NULL, szText, szTitle, MB_OK); InfoMessageBox(hWnd, MB_OK | MB_ICONINFORMATION, szTitle, szText, ofn.lpstrFile);
bRet = TRUE; bRet = TRUE;
} }
@ -582,7 +582,7 @@ BOOL ExportRegistryFile(HWND hWnd)
BOOL bRet = FALSE; BOOL bRet = FALSE;
OPENFILENAME ofn; OPENFILENAME ofn;
WCHAR ExportKeyPath[_MAX_PATH]; WCHAR ExportKeyPath[_MAX_PATH];
WCHAR Caption[128]; WCHAR Caption[128], szTitle[512], szText[512];
HKEY hKeyRoot; HKEY hKeyRoot;
LPCWSTR pszKeyPath; LPCWSTR pszKeyPath;
@ -664,9 +664,10 @@ BOOL ExportRegistryFile(HWND hWnd)
(ofn.nFilterIndex == 3 ? REG_FORMAT_4 (ofn.nFilterIndex == 3 ? REG_FORMAT_4
: REG_FORMAT_5))) : REG_FORMAT_5)))
{ {
LPSTR p = GetMultiByteString(ofn.lpstrFile); /* Error creating the file */
fwprintf(stderr, L"Can't open file \"%s\"\n", p); LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
HeapFree(GetProcessHeap(), 0, p); LoadStringW(hInst, IDS_EXPORT_ERROR, szText, COUNT_OF(szText));
InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile);
bRet = FALSE; bRet = FALSE;
} }
else else

View file

@ -452,6 +452,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -440,6 +440,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -432,7 +432,8 @@ STRINGTABLE DISCARDABLE
BEGIN BEGIN
IDS_IMPORT_PROMPT "L'ajout d'informations peut involontairement modifier ou supprimer des valeurs et endommager le fonctionnement de composants. Si vous n'êtes pas sûr de la source de ces informations dans '%1', ne les ajoutez pas au Registre.\n\nÊtes-vous sûr de vouloir continuer ?" IDS_IMPORT_PROMPT "L'ajout d'informations peut involontairement modifier ou supprimer des valeurs et endommager le fonctionnement de composants. Si vous n'êtes pas sûr de la source de ces informations dans '%1', ne les ajoutez pas au Registre.\n\nÊtes-vous sûr de vouloir continuer ?"
IDS_IMPORT_OK "Les clés et valeurs contenues dans '%1' ont été correctement ajoutées au Registre." IDS_IMPORT_OK "Les clés et valeurs contenues dans '%1' ont été correctement ajoutées au Registre."
IDS_IMPORT_ERROR "Impossible dimporter '%1' à la suite dune erreur lors de la lecture de ce fichier. Il sagit dune erreur disque, ou le fichier est endommagé." IDS_IMPORT_ERROR "Impossible d'importer '%1' à la suite d'une erreur lors de la lecture de ce fichier. Il s'agit d'une erreur disque, ou le fichier est endommagé."
IDS_EXPORT_ERROR "Impossible d'exporter dans le fichier '%1' à la suite d'une erreur lors de sa création ou d'une tentative d'écriture, pouvant être due à une erreur de disque ou de système de fichiers."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -438,6 +438,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -436,6 +436,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -439,6 +439,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -422,6 +422,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -444,6 +444,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -438,6 +438,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -439,6 +439,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -435,6 +435,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -434,6 +434,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -422,6 +422,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -438,6 +438,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -437,6 +437,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -438,6 +438,7 @@ BEGIN
IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?"
IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry."
IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist."
IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE

View file

@ -146,9 +146,8 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
get_file_name(&s, filename); get_file_name(&s, filename);
if (!filename[0]) if (!filename[0])
{ {
fwprintf(stderr, L"%s: No file name is specified\n", getAppName()); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified.");
// fwprintf(stderr, usage); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage);
MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION);
exit(4); exit(4);
} }
@ -165,27 +164,12 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
goto cont; goto cont;
} }
/* Open the file */
fp = _wfopen(filename, L"r"); fp = _wfopen(filename, L"r");
if (fp != NULL)
/* Import it */
if (fp == NULL || !import_registry_file(fp))
{ {
import_registry_file(fp);
/* Show successful import */
if (!silent)
{
LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, szText, filename);
}
fclose(fp);
}
else
{
//LPSTR p = GetMultiByteString(filename);
//perror("");
fwprintf(stderr, L"%s: Can't open file \"%s\"\n", getAppName(), filename /*p*/);
//HeapFree(GetProcessHeap(), 0, p);
/* Error opening the file */ /* Error opening the file */
if (!silent) if (!silent)
{ {
@ -193,6 +177,18 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
InfoMessageBox(NULL, MB_OK | MB_ICONERROR, szTitle, szText, filename); InfoMessageBox(NULL, MB_OK | MB_ICONERROR, szTitle, szText, filename);
} }
} }
else
{
/* Show successful import */
if (!silent)
{
LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, szText, filename);
}
}
/* Close the file */
if (fp) fclose(fp);
cont: cont:
get_file_name(&s, filename); get_file_name(&s, filename);
@ -206,9 +202,8 @@ cont:
get_file_name(&s, reg_key_name); get_file_name(&s, reg_key_name);
if (!reg_key_name[0]) if (!reg_key_name[0])
{ {
fwprintf(stderr, L"%s: No registry key is specified for removal\n", getAppName()); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No registry key is specified for removal.");
// fwprintf(stderr, usage); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage);
MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION);
exit(6); exit(6);
} }
delete_registry_key(reg_key_name); delete_registry_key(reg_key_name);
@ -223,9 +218,8 @@ cont:
get_file_name(&s, filename); get_file_name(&s, filename);
if (!filename[0]) if (!filename[0])
{ {
fwprintf(stderr, L"%s: No file name is specified\n", getAppName()); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified.");
// fwprintf(stderr, usage); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage);
MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION);
exit(7); exit(7);
} }
@ -310,8 +304,7 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
action = ACTION_EXPORT; action = ACTION_EXPORT;
break; break;
case L'?': case L'?':
//fwprintf(stderr, usage); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage);
MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION);
exit(3); exit(3);
break; break;
default: default:

View file

@ -167,79 +167,80 @@
#define IDS_FLT_ALLFILES 31007 #define IDS_FLT_ALLFILES 31007
#define IDS_FLT_ALLFILES_FLT 31008 #define IDS_FLT_ALLFILES_FLT 31008
#define IDS_ACCESS_FULLCONTROL 31101 #define IDS_ACCESS_FULLCONTROL 31100
#define IDS_ACCESS_READ 31102 #define IDS_ACCESS_READ 31101
#define IDS_ACCESS_QUERYVALUE 31103 #define IDS_ACCESS_QUERYVALUE 31102
#define IDS_ACCESS_SETVALUE 31104 #define IDS_ACCESS_SETVALUE 31103
#define IDS_ACCESS_CREATESUBKEY 31105 #define IDS_ACCESS_CREATESUBKEY 31104
#define IDS_ACCESS_ENUMERATESUBKEYS 31106 #define IDS_ACCESS_ENUMERATESUBKEYS 31105
#define IDS_ACCESS_NOTIFY 31107 #define IDS_ACCESS_NOTIFY 31106
#define IDS_ACCESS_CREATELINK 31108 #define IDS_ACCESS_CREATELINK 31107
#define IDS_ACCESS_DELETE 31109 #define IDS_ACCESS_DELETE 31108
#define IDS_ACCESS_WRITEDAC 31110 #define IDS_ACCESS_WRITEDAC 31109
#define IDS_ACCESS_WRITEOWNER 31111 #define IDS_ACCESS_WRITEOWNER 31110
#define IDS_ACCESS_READCONTROL 31112 #define IDS_ACCESS_READCONTROL 31111
#define IDS_INHERIT_THISKEYONLY 31121 #define IDS_INHERIT_THISKEYONLY 31200
#define IDS_INHERIT_THISKEYANDSUBKEYS 31122 #define IDS_INHERIT_THISKEYANDSUBKEYS 31201
#define IDS_INHERIT_SUBKEYSONLY 31123 #define IDS_INHERIT_SUBKEYSONLY 31202
#define IDS_EXPAND 31124 #define IDS_EXPAND 31203
#define IDS_COLLAPSE 31125 #define IDS_COLLAPSE 31204
#define IDS_NEW_KEY 31126 #define IDS_NEW_KEY 31205
#define IDS_NEW_VALUE 31127 #define IDS_NEW_VALUE 31206
#define IDS_GOTO_SUGGESTED_KEY 31128 #define IDS_GOTO_SUGGESTED_KEY 31207
#define IDS_IMPORT_PROMPT 31129 #define IDS_IMPORT_PROMPT 31300
#define IDS_IMPORT_OK 31130 #define IDS_IMPORT_OK 31301
#define IDS_IMPORT_ERROR 31131 #define IDS_IMPORT_ERROR 31302
#define IDS_EXPORT_ERROR 31303
#define IDS_FINISHEDFIND 31132 #define IDS_FINISHEDFIND 31304
#define IDS_BUSNUMBER 31133 #define IDS_BUSNUMBER 31400
#define IDS_INTERFACE 31134 #define IDS_INTERFACE 31401
#define IDS_DMA_CHANNEL 31135 #define IDS_DMA_CHANNEL 31500
#define IDS_DMA_PORT 31136 #define IDS_DMA_PORT 31501
#define IDS_INTERRUPT_VECTOR 31137 #define IDS_INTERRUPT_VECTOR 31502
#define IDS_INTERRUPT_LEVEL 31138 #define IDS_INTERRUPT_LEVEL 31503
#define IDS_INTERRUPT_AFFINITY 31139 #define IDS_INTERRUPT_AFFINITY 31504
#define IDS_INTERRUPT_TYPE 31140 #define IDS_INTERRUPT_TYPE 31505
#define IDS_MEMORY_ADDRESS 31141 #define IDS_MEMORY_ADDRESS 31506
#define IDS_MEMORY_LENGTH 31142 #define IDS_MEMORY_LENGTH 31507
#define IDS_MEMORY_ACCESS 31143 #define IDS_MEMORY_ACCESS 31508
#define IDS_PORT_ADDRESS 31144 #define IDS_PORT_ADDRESS 31509
#define IDS_PORT_LENGTH 31145 #define IDS_PORT_LENGTH 31510
#define IDS_PORT_ACCESS 31146 #define IDS_PORT_ACCESS 31511
#define IDS_SPECIFIC_RESERVED1 31147 #define IDS_SPECIFIC_RESERVED1 31512
#define IDS_SPECIFIC_RESERVED2 31148 #define IDS_SPECIFIC_RESERVED2 31513
#define IDS_SPECIFIC_DATASIZE 31149 #define IDS_SPECIFIC_DATASIZE 31514
#define IDS_PORT_PORT_IO 31150 #define IDS_PORT_PORT_IO 31520
#define IDS_PORT_MEMORY_IO 31151 #define IDS_PORT_MEMORY_IO 31521
#define IDS_INTERRUPT_EDGE_SENSITIVE 31152 #define IDS_INTERRUPT_EDGE_SENSITIVE 31522
#define IDS_INTERRUPT_LEVEL_SENSITIVE 31153 #define IDS_INTERRUPT_LEVEL_SENSITIVE 31523
#define IDS_MEMORY_READ_ONLY 31154 #define IDS_MEMORY_READ_ONLY 31524
#define IDS_MEMORY_WRITE_ONLY 31155 #define IDS_MEMORY_WRITE_ONLY 31525
#define IDS_MEMORY_READ_WRITE 31156 #define IDS_MEMORY_READ_WRITE 31526
#define IDS_BUS_UNDEFINED 31157 #define IDS_BUS_UNDEFINED 31530
#define IDS_BUS_INTERNAL 31158 #define IDS_BUS_INTERNAL 31531
#define IDS_BUS_ISA 31159 #define IDS_BUS_ISA 31532
#define IDS_BUS_EISA 31160 #define IDS_BUS_EISA 31533
#define IDS_BUS_MICROCHANNEL 31161 #define IDS_BUS_MICROCHANNEL 31534
#define IDS_BUS_TURBOCHANNEL 31162 #define IDS_BUS_TURBOCHANNEL 31535
#define IDS_BUS_PCIBUS 31163 #define IDS_BUS_PCIBUS 31536
#define IDS_BUS_VMEBUS 31164 #define IDS_BUS_VMEBUS 31537
#define IDS_BUS_NUBUS 31165 #define IDS_BUS_NUBUS 31538
#define IDS_BUS_PCMCIABUS 31166 #define IDS_BUS_PCMCIABUS 31539
#define IDS_BUS_CBUS 31167 #define IDS_BUS_CBUS 31540
#define IDS_BUS_MPIBUS 31168 #define IDS_BUS_MPIBUS 31541
#define IDS_BUS_MPSABUS 31169 #define IDS_BUS_MPSABUS 31542
#define IDS_BUS_PROCESSORINTERNAL 31170 #define IDS_BUS_PROCESSORINTERNAL 31543
#define IDS_BUS_INTERNALPOWERBUS 31171 #define IDS_BUS_INTERNALPOWERBUS 31544
#define IDS_BUS_PNPISABUS 31172 #define IDS_BUS_PNPISABUS 31545
#define IDS_BUS_PNPBUS 31173 #define IDS_BUS_PNPBUS 31546
#define IDS_BUS_UNKNOWNTYPE 31174 #define IDS_BUS_UNKNOWNTYPE 31547
#define IDD_EDIT_STRING 2000 #define IDD_EDIT_STRING 2000
#define IDC_VALUE_NAME 2001 #define IDC_VALUE_NAME 2001

View file

@ -129,8 +129,13 @@ extern void SaveSettings(void)
if (keyPath) if (keyPath)
{ {
rootName = get_root_key_name(hRootKey); rootName = get_root_key_name(hRootKey);
_snwprintf(szBuffer, COUNT_OF(szBuffer), L"My Computer\\%s\\%s", rootName, keyPath);
RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE) szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR)); /* Load "My Computer" string and complete it */
LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer));
wcscat(szBuffer, L"\\"); wcscat(szBuffer, rootName);
wcscat(szBuffer, L"\\"); wcscat(szBuffer, keyPath);
RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE)szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR));
} }
/* Get statusbar settings */ /* Get statusbar settings */

View file

@ -601,9 +601,7 @@ BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
} }
else if (!hNewKey) else if (!hNewKey)
{ {
WCHAR sz[256]; InfoMessageBox(hFrameWnd, MB_OK | MB_ICONERROR, NULL, L"Cannot create new key!\n\nError Code: %d", nResult);
wsprintf(sz, L"Cannot create new key!\n\nError Code: %d", nResult);
MessageBoxW(hFrameWnd, sz, NULL, MB_ICONERROR);
goto done; goto done;
} }
} }
@ -668,9 +666,16 @@ BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
LPCWSTR s; LPCWSTR s;
TVITEM tvi; TVITEM tvi;
/* Total no-good hack */ /* Load "My Computer" string... */
if (!_wcsnicmp(keyPath, L"My Computer\\", 12)) LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer));
keyPath += 12; wcscat(szBuffer, L"\\");
/* ... and remove it from the key path */
if (!_wcsnicmp(keyPath, szBuffer, wcslen(szBuffer)))
keyPath += wcslen(szBuffer);
/* Reinitialize szBuffer */
szBuffer[0] = L'\0';
hRoot = TreeView_GetRoot(hwndTV); hRoot = TreeView_GetRoot(hwndTV);
hItem = hRoot; hItem = hRoot;