Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
0035421e
Commit
0035421e
authored
Aug 31, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Sep 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Remove an ANSI function.
parent
d2664e0f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
36 deletions
+9
-36
framewnd.c
programs/regedit/framewnd.c
+5
-7
listview.c
programs/regedit/listview.c
+3
-28
main.h
programs/regedit/main.h
+1
-1
No files found.
programs/regedit/framewnd.c
View file @
0035421e
...
...
@@ -639,7 +639,6 @@ static INT_PTR CALLBACK removefavorite_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM w
static
BOOL
_CmdWndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HKEY
hKeyRoot
=
0
;
LPCTSTR
valueName
;
DWORD
valueType
;
int
curIndex
;
BOOL
firstItem
=
TRUE
;
...
...
@@ -693,9 +692,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
WCHAR
*
keyPath
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hKeyRoot
);
curIndex
=
ListView_GetNextItem
(
g_pChildWnd
->
hListWnd
,
-
1
,
LVNI_SELECTED
);
while
(
curIndex
!=
-
1
)
{
WCHAR
*
valueName
W
;
WCHAR
*
valueName
=
GetItemText
(
g_pChildWnd
->
hListWnd
,
curIndex
)
;
valueName
=
GetItemText
(
g_pChildWnd
->
hListWnd
,
curIndex
);
curIndex
=
ListView_GetNextItem
(
g_pChildWnd
->
hListWnd
,
curIndex
,
LVNI_SELECTED
);
if
(
curIndex
!=
-
1
&&
firstItem
)
{
if
(
MessageBoxW
(
hWnd
,
MAKEINTRESOURCEW
(
IDS_DELETE_BOX_TEXT_MULTIPLE
),
...
...
@@ -703,14 +701,14 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
MB_YESNO
|
MB_ICONEXCLAMATION
)
!=
IDYES
)
break
;
}
valueNameW
=
GetWideString
(
valueName
);
if
(
!
DeleteValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
W
,
curIndex
==-
1
&&
firstItem
))
if
(
!
DeleteValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
,
curIndex
==-
1
&&
firstItem
))
{
HeapFree
(
GetProcessHeap
(),
0
,
valueName
W
);
HeapFree
(
GetProcessHeap
(),
0
,
valueName
);
break
;
}
firstItem
=
FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
valueName
W
);
HeapFree
(
GetProcessHeap
(),
0
,
valueName
);
}
RefreshListView
(
g_pChildWnd
->
hListWnd
,
hKeyRoot
,
keyPath
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
keyPath
);
...
...
programs/regedit/listview.c
View file @
0035421e
...
...
@@ -22,11 +22,9 @@
#include <windows.h>
#include <commctrl.h>
#include <stdlib.h>
#include <tchar.h>
#include <stdio.h>
#include "main.h"
#include "regproc.h"
#include "wine/unicode.h"
static
INT
Image_String
;
...
...
@@ -56,30 +54,7 @@ static WCHAR g_szValueNotSet[64];
static
int
default_column_widths
[
MAX_LIST_COLUMNS
]
=
{
200
,
175
,
400
};
static
int
column_alignment
[
MAX_LIST_COLUMNS
]
=
{
LVCFMT_LEFT
,
LVCFMT_LEFT
,
LVCFMT_LEFT
};
LPTSTR
GetItemText
(
HWND
hwndLV
,
UINT
item
)
{
LPTSTR
newStr
,
curStr
;
unsigned
int
maxLen
=
128
;
curStr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
maxLen
);
if
(
!
curStr
)
return
NULL
;
if
(
item
==
0
)
{
/* first item is ALWAYS a default */
HeapFree
(
GetProcessHeap
(),
0
,
curStr
);
return
NULL
;
}
do
{
ListView_GetItemText
(
hwndLV
,
item
,
0
,
curStr
,
maxLen
);
if
(
_tcslen
(
curStr
)
<
maxLen
-
1
)
return
curStr
;
newStr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
curStr
,
maxLen
*
2
);
if
(
!
newStr
)
break
;
curStr
=
newStr
;
maxLen
*=
2
;
}
while
(
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
curStr
);
return
NULL
;
}
LPWSTR
GetItemTextW
(
HWND
hwndLV
,
UINT
item
)
LPWSTR
GetItemText
(
HWND
hwndLV
,
UINT
item
)
{
LPWSTR
newStr
,
curStr
;
unsigned
int
maxLen
=
128
;
...
...
@@ -113,7 +88,7 @@ LPCWSTR GetValueName(HWND hwndLV)
item
=
ListView_GetNextItem
(
hwndLV
,
-
1
,
LVNI_FOCUSED
);
if
(
item
==
-
1
)
return
NULL
;
g_valueName
=
GetItemText
W
(
hwndLV
,
item
);
g_valueName
=
GetItemText
(
hwndLV
,
item
);
return
g_valueName
;
}
...
...
@@ -422,7 +397,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
break
;
case
LVN_ENDLABELEDITW
:
{
LPNMLVDISPINFOW
dispInfo
=
(
LPNMLVDISPINFOW
)
lParam
;
LPWSTR
oldName
=
GetItemText
W
(
hWnd
,
dispInfo
->
item
.
iItem
);
LPWSTR
oldName
=
GetItemText
(
hWnd
,
dispInfo
->
item
.
iItem
);
LONG
ret
;
if
(
!
oldName
)
return
-
1
;
/* cannot rename a default value */
ret
=
RenameValue
(
hWnd
,
g_currentRootKey
,
g_currentPath
,
oldName
,
dispInfo
->
item
.
pszText
);
...
...
programs/regedit/main.h
View file @
0035421e
...
...
@@ -120,7 +120,7 @@ extern void UpdateStatusBar(void);
extern
HWND
CreateListView
(
HWND
hwndParent
,
UINT
id
);
extern
BOOL
RefreshListView
(
HWND
hwndLV
,
HKEY
hKeyRoot
,
LPCWSTR
keyPath
,
LPCWSTR
highlightValue
);
extern
HWND
StartValueRename
(
HWND
hwndLV
);
extern
LP
T
STR
GetItemText
(
HWND
hwndLV
,
UINT
item
);
extern
LP
W
STR
GetItemText
(
HWND
hwndLV
,
UINT
item
);
extern
LPCWSTR
GetValueName
(
HWND
hwndLV
);
extern
BOOL
ListWndNotifyProc
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
*
Result
);
extern
BOOL
IsDefaultValue
(
HWND
hwndLV
,
int
i
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment