*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <regedit.h>
while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION))
;
}
-
+
lResult = RegOpenKey(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey);
if (lResult != ERROR_SUCCESS)
goto done;
static void OnEnterMenuLoop(HWND hWnd)
{
int nParts;
+ UNREFERENCED_PARAMETER(hWnd);
/* Update the status bar pane sizes */
nParts = -1;
/* load appropriate string*/
LPTSTR lpsz = str;
/* first newline terminates actual string*/
- lpsz = _tcschr(lpsz, '\n');
+ lpsz = _tcschr(lpsz, _T('\n'));
if (lpsz != NULL)
*lpsz = '\0';
}
void UpdateStatusBar(void)
{
- TCHAR text[260];
- DWORD size;
-
- size = sizeof(text)/sizeof(TCHAR);
- GetComputerName(text, &size);
- SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)text);
+ NMHDR nmhdr;
+ ZeroMemory(&nmhdr, sizeof(NMHDR));
+ nmhdr.code = TVN_SELCHANGED;
+ SendMessage(g_pChildWnd->hWnd, WM_NOTIFY, (WPARAM)TREE_WINDOW, (LPARAM)&nmhdr);
}
static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
static BOOL CheckCommDlgError(HWND hWnd)
{
DWORD dwErrorCode = CommDlgExtendedError();
+ UNREFERENCED_PARAMETER(hWnd);
switch (dwErrorCode) {
case CDERR_DIALOGFAILURE:
break;
LPTSTR pszSelectedKey;
OFNOTIFY *pOfnNotify;
+ UNREFERENCED_PARAMETER(wParam);
+
switch(uiMsg) {
case WM_INITDIALOG:
pOfn = (OPENFILENAME *) lParam;
hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL);
if (hwndExportAll)
- SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey[0] ? BST_UNCHECKED : BST_CHECKED, 0);
+ SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0);
hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
if (hwndExportBranch)
- SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey[0] ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0);
hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
if (hwndExportBranchText)
InitOpenFileName(hWnd, &ofn);
LoadString(hInst, IDS_EXPORT_REG_FILE, Caption, sizeof(Caption)/sizeof(TCHAR));
ofn.lpstrTitle = Caption;
- ofn.lCustData = (LPARAM) ExportKeyPath;
+
+ /* Only set the path if a key (not the root node) is selected */
+ if (hKeyRoot != 0)
+ {
+ ofn.lCustData = (LPARAM) ExportKeyPath;
+ }
ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK;
ofn.lpfnHook = ExportRegistryFile_OFNHookProc;
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORTRANGE);
{
#if 1
PRINTDLG pd;
+ UNREFERENCED_PARAMETER(path);
ZeroMemory(&pd, sizeof(PRINTDLG));
pd.lStructSize = sizeof(PRINTDLG);
LVFINDINFO lvfi;
if (RegOpenKey(hRootKey, pszKeyPath, &hKey) != ERROR_SUCCESS)
- return FALSE;
+ return FALSE;
LoadString(hInst, IDS_NEW_VALUE, szNewValueFormat, sizeof(szNewValueFormat)
/ sizeof(szNewValueFormat[0]));
lvfi.psz = szNewValue;
iIndex = ListView_FindItem(g_pChildWnd->hListWnd, -1, &lvfi);
if (iIndex >= 0)
- ListView_EditLabel(g_pChildWnd->hListWnd, iIndex);
+ (void)ListView_EditLabel(g_pChildWnd->hListWnd, iIndex);
return TRUE;
}
STGMEDIUM stm;
FORMATETC fe;
- fe.cfFormat = RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
+ fe.cfFormat = (CLIPFORMAT) RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
fe.ptd = NULL;
fe.dwAspect = DVASPECT_CONTENT;
fe.lindex = -1;
{
if (SelectionList->cItems == 1)
{
- UINT nlen = wcslen(SelectionList->aDsSelection[0].pwzName);
+ size_t nlen = wcslen(SelectionList->aDsSelection[0].pwzName);
if (nlen >= uSize)
{
nlen = uSize - 1;
LONG lRet;
int item;
+ UNREFERENCED_PARAMETER(lParam);
+ UNREFERENCED_PARAMETER(message);
+
switch (LOWORD(wParam)) {
case ID_REGISTRY_IMPORTREGISTRYFILE:
ImportRegistryFile(hWnd);
IDsObjectPicker *ObjectPicker;
TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
HRESULT hRet;
-
+
hRet = CoInitialize(NULL);
if (SUCCEEDED(hRet))
{
if (lRet != ERROR_SUCCESS) hKey = 0;
}
- switch (LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case ID_EDIT_MODIFY:
if (valueName && ModifyValue(hWnd, hKey, valueName, FALSE))
RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
break;
case ID_EDIT_RENAME:
- if(ListView_GetSelectedCount(g_pChildWnd->hListWnd) == 1)
+ if (GetFocus() == g_pChildWnd->hListWnd)
{
- item = ListView_GetNextItem(g_pChildWnd->hListWnd, -1, LVNI_SELECTED);
- if(item > -1)
- {
- ListView_EditLabel(g_pChildWnd->hListWnd, item);
- }
+ if(ListView_GetSelectedCount(g_pChildWnd->hListWnd) == 1)
+ {
+ item = ListView_GetNextItem(g_pChildWnd->hListWnd, -1, LVNI_SELECTED);
+ if(item > -1)
+ {
+ (void)ListView_EditLabel(g_pChildWnd->hListWnd, item);
+ }
+ }
+ }
+ if (GetFocus() == g_pChildWnd->hTreeWnd)
+ {
+ /* Get focused entry of treeview (if any) */
+ HTREEITEM hItem = TreeView_GetSelection(g_pChildWnd->hTreeWnd);
+ if (hItem != NULL)
+ (void)TreeView_EditLabel(g_pChildWnd->hTreeWnd, hItem);
}
break;
case ID_EDIT_DELETE:
}
}
}
- } else
+ } else
if (GetFocus() == g_pChildWnd->hTreeWnd)
{
if (keyPath == 0 || *keyPath == 0)
{
- MessageBeep(MB_ICONHAND);
+ MessageBeep(MB_ICONHAND);
} else
if (DeleteKey(hWnd, hKeyRoot, keyPath))
+ {
DeleteNode(g_pChildWnd->hTreeWnd, 0);
+ RefreshTreeView(g_pChildWnd->hTreeWnd);
+ }
}
break;
case ID_EDIT_NEW_STRINGVALUE:
CopyKeyName(hWnd, hKeyRoot, keyPath);
break;
case ID_EDIT_PERMISSIONS:
- if(keyPath != NULL && _tcslen(keyPath) > 0)
- {
- RegKeyEditPermissions(hWnd, hKey, NULL, keyPath);
- }
- else
- {
- MessageBeep(MB_ICONASTERISK);
- }
+ RegKeyEditPermissions(hWnd, hKeyRoot, NULL, keyPath);
break;
case ID_REGISTRY_PRINTERSETUP:
/*PRINTDLG pd;*/
return DefWindowProc(hWnd, message, wParam, lParam);
break;
case WM_ACTIVATE:
- if (LOWORD(hWnd))
+ if (LOWORD(hWnd))
SetFocus(g_pChildWnd->hWnd);
break;
case WM_SIZE: