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
12be9c39
Commit
12be9c39
authored
May 07, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleview: Use the explicit W types/functions in details.c.
parent
14c63217
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
61 deletions
+61
-61
details.c
programs/oleview/details.c
+61
-61
No files found.
programs/oleview/details.c
View file @
12be9c39
...
@@ -40,7 +40,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -40,7 +40,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
const
WCHAR
wszDots
[]
=
{
'.'
,
'.'
,
'.'
,
'\0'
};
const
WCHAR
wszDots
[]
=
{
'.'
,
'.'
,
'.'
,
'\0'
};
const
WCHAR
wszFormat1
[]
=
{
'%'
,
's'
,
' '
,
'['
,
'%'
,
's'
,
']'
,
' '
,
'='
,
' '
,
'%'
,
's'
,
'\0'
};
const
WCHAR
wszFormat1
[]
=
{
'%'
,
's'
,
' '
,
'['
,
'%'
,
's'
,
']'
,
' '
,
'='
,
' '
,
'%'
,
's'
,
'\0'
};
const
WCHAR
wszFormat2
[]
=
{
'%'
,
's'
,
' '
,
'='
,
' '
,
'%'
,
's'
,
'\0'
};
const
WCHAR
wszFormat2
[]
=
{
'%'
,
's'
,
' '
,
'='
,
' '
,
'%'
,
's'
,
'\0'
};
TVINSERTSTRUCT
tvis
;
TVINSERTSTRUCT
W
tvis
;
HTREEITEM
addPlace
=
parent
;
HTREEITEM
addPlace
=
parent
;
U
(
tvis
).
item
.
mask
=
TVIF_TEXT
;
U
(
tvis
).
item
.
mask
=
TVIF_TEXT
;
...
@@ -54,7 +54,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -54,7 +54,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
])
/
sizeof
(
WCHAR
);
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
])
/
sizeof
(
WCHAR
);
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
retEnum
=
RegEnumValue
(
hKey
,
i
,
wszName
,
&
lenName
,
retEnum
=
RegEnumValue
W
(
hKey
,
i
,
wszName
,
&
lenName
,
NULL
,
&
valType
,
(
LPBYTE
)
wszData
,
&
lenData
);
NULL
,
&
valType
,
(
LPBYTE
)
wszData
,
&
lenData
);
if
(
retEnum
!=
ERROR_SUCCESS
)
if
(
retEnum
!=
ERROR_SUCCESS
)
...
@@ -62,7 +62,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -62,7 +62,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
if
(
!
i
&&
lstrlenW
(
wszKeyName
)
>
1
)
if
(
!
i
&&
lstrlenW
(
wszKeyName
)
>
1
)
{
{
U
(
tvis
).
item
.
pszText
=
wszKeyName
;
U
(
tvis
).
item
.
pszText
=
wszKeyName
;
addPlace
=
TreeView_InsertItem
(
details
.
hReg
,
&
tvis
);
addPlace
=
TreeView_InsertItem
W
(
details
.
hReg
,
&
tvis
);
U
(
tvis
).
item
.
pszText
=
wszTree
;
U
(
tvis
).
item
.
pszText
=
wszTree
;
}
}
break
;
break
;
...
@@ -82,7 +82,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -82,7 +82,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
if
(
lenName
)
wsprintfW
(
wszTree
,
wszFormat1
,
wszKeyName
,
wszName
,
wszData
);
if
(
lenName
)
wsprintfW
(
wszTree
,
wszFormat1
,
wszKeyName
,
wszName
,
wszData
);
else
wsprintfW
(
wszTree
,
wszFormat2
,
wszKeyName
,
wszData
);
else
wsprintfW
(
wszTree
,
wszFormat2
,
wszKeyName
,
wszData
);
addPlace
=
TreeView_InsertItem
(
details
.
hReg
,
&
tvis
);
addPlace
=
TreeView_InsertItem
W
(
details
.
hReg
,
&
tvis
);
if
(
addings
&&
!
memcmp
(
wszName
,
wszAppID
,
sizeof
(
WCHAR
[
6
])))
if
(
addings
&&
!
memcmp
(
wszName
,
wszAppID
,
sizeof
(
WCHAR
[
6
])))
{
{
...
@@ -91,24 +91,24 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -91,24 +91,24 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
lstrcpyW
(
wszData
,
wszCLSID
);
lstrcpyW
(
wszData
,
wszCLSID
);
wszData
[
5
]
=
'\\'
;
wszData
[
5
]
=
'\\'
;
if
(
RegOpenKey
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
)
!=
ERROR_SUCCESS
)
if
(
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
)
!=
ERROR_SUCCESS
)
{
{
i
++
;
i
++
;
continue
;
continue
;
}
}
tvis
.
hParent
=
TVI_ROOT
;
tvis
.
hParent
=
TVI_ROOT
;
tvis
.
hParent
=
TreeView_InsertItem
(
details
.
hReg
,
&
tvis
);
tvis
.
hParent
=
TreeView_InsertItem
W
(
details
.
hReg
,
&
tvis
);
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
RegQueryValue
(
hCurKey
,
NULL
,
wszName
,
(
LONG
*
)
&
lenName
);
RegQueryValue
W
(
hCurKey
,
NULL
,
wszName
,
(
LONG
*
)
&
lenName
);
RegCloseKey
(
hCurKey
);
RegCloseKey
(
hCurKey
);
wsprintfW
(
wszTree
,
wszFormat2
,
&
wszData
[
6
],
wszName
);
wsprintfW
(
wszTree
,
wszFormat2
,
&
wszData
[
6
],
wszName
);
SendMessage
(
details
.
hReg
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
tvis
);
SendMessage
W
(
details
.
hReg
,
TVM_INSERTITEMW
,
0
,
(
LPARAM
)
&
tvis
);
SendMessage
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
tvis
.
hParent
);
SendMessage
W
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
tvis
.
hParent
);
tvis
.
hParent
=
parent
;
tvis
.
hParent
=
parent
;
}
}
...
@@ -122,21 +122,21 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -122,21 +122,21 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
{
{
i
++
;
i
++
;
if
(
RegEnumKey
(
hKey
,
i
,
wszName
,
lenName
)
!=
ERROR_SUCCESS
)
break
;
if
(
RegEnumKey
W
(
hKey
,
i
,
wszName
,
lenName
)
!=
ERROR_SUCCESS
)
break
;
if
(
RegOpenKey
(
hKey
,
wszName
,
&
hCurKey
)
!=
ERROR_SUCCESS
)
continue
;
if
(
RegOpenKey
W
(
hKey
,
wszName
,
&
hCurKey
)
!=
ERROR_SUCCESS
)
continue
;
CreateRegRec
(
hCurKey
,
addPlace
,
wszName
,
addings
);
CreateRegRec
(
hCurKey
,
addPlace
,
wszName
,
addings
);
SendMessage
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
addPlace
);
SendMessage
W
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
addPlace
);
if
(
addings
&&
!
memcmp
(
wszName
,
wszProgID
,
sizeof
(
WCHAR
[
7
])))
if
(
addings
&&
!
memcmp
(
wszName
,
wszProgID
,
sizeof
(
WCHAR
[
7
])))
{
{
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
RegQueryValue
(
hCurKey
,
NULL
,
wszData
,
(
LONG
*
)
&
lenData
);
RegQueryValue
W
(
hCurKey
,
NULL
,
wszData
,
(
LONG
*
)
&
lenData
);
RegCloseKey
(
hCurKey
);
RegCloseKey
(
hCurKey
);
if
(
RegOpenKey
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
)
!=
ERROR_SUCCESS
)
if
(
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
)
!=
ERROR_SUCCESS
)
continue
;
continue
;
CreateRegRec
(
hCurKey
,
TVI_ROOT
,
wszData
,
FALSE
);
CreateRegRec
(
hCurKey
,
TVI_ROOT
,
wszData
,
FALSE
);
}
}
...
@@ -144,17 +144,17 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -144,17 +144,17 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
{
{
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
RegQueryValue
(
hCurKey
,
NULL
,
wszData
,
(
LONG
*
)
&
lenData
);
RegQueryValue
W
(
hCurKey
,
NULL
,
wszData
,
(
LONG
*
)
&
lenData
);
RegCloseKey
(
hCurKey
);
RegCloseKey
(
hCurKey
);
RegOpenKey
(
HKEY_CLASSES_ROOT
,
wszCLSID
,
&
hCurKey
);
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
wszCLSID
,
&
hCurKey
);
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
RegQueryValue
(
hCurKey
,
NULL
,
wszName
,
(
LONG
*
)
&
lenName
);
RegQueryValue
W
(
hCurKey
,
NULL
,
wszName
,
(
LONG
*
)
&
lenName
);
tvis
.
hParent
=
TVI_ROOT
;
tvis
.
hParent
=
TVI_ROOT
;
wsprintfW
(
wszTree
,
wszFormat2
,
wszCLSID
,
wszName
);
wsprintfW
(
wszTree
,
wszFormat2
,
wszCLSID
,
wszName
);
tvis
.
hParent
=
TreeView_InsertItem
(
details
.
hReg
,
&
tvis
);
tvis
.
hParent
=
TreeView_InsertItem
W
(
details
.
hReg
,
&
tvis
);
RegCloseKey
(
hCurKey
);
RegCloseKey
(
hCurKey
);
...
@@ -162,39 +162,39 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
...
@@ -162,39 +162,39 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
memcpy
(
wszData
,
wszCLSID
,
sizeof
(
WCHAR
[
6
]));
memcpy
(
wszData
,
wszCLSID
,
sizeof
(
WCHAR
[
6
]));
wszData
[
5
]
=
'\\'
;
wszData
[
5
]
=
'\\'
;
RegOpenKey
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
);
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
);
CreateRegRec
(
hCurKey
,
tvis
.
hParent
,
&
wszData
[
6
],
FALSE
);
CreateRegRec
(
hCurKey
,
tvis
.
hParent
,
&
wszData
[
6
],
FALSE
);
SendMessage
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
tvis
.
hParent
);
SendMessage
W
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
tvis
.
hParent
);
tvis
.
hParent
=
parent
;
tvis
.
hParent
=
parent
;
}
}
else
if
(
addings
&&
!
memcmp
(
wszName
,
wszTypeLib
,
sizeof
(
WCHAR
[
8
])))
else
if
(
addings
&&
!
memcmp
(
wszName
,
wszTypeLib
,
sizeof
(
WCHAR
[
8
])))
{
{
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenData
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
RegQueryValue
(
hCurKey
,
NULL
,
wszData
,
(
LONG
*
)
&
lenData
);
RegQueryValue
W
(
hCurKey
,
NULL
,
wszData
,
(
LONG
*
)
&
lenData
);
RegCloseKey
(
hCurKey
);
RegCloseKey
(
hCurKey
);
RegOpenKey
(
HKEY_CLASSES_ROOT
,
wszTypeLib
,
&
hCurKey
);
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
wszTypeLib
,
&
hCurKey
);
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenName
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
RegQueryValue
(
hCurKey
,
NULL
,
wszName
,
(
LONG
*
)
&
lenName
);
RegQueryValue
W
(
hCurKey
,
NULL
,
wszName
,
(
LONG
*
)
&
lenName
);
tvis
.
hParent
=
TVI_ROOT
;
tvis
.
hParent
=
TVI_ROOT
;
wsprintfW
(
wszTree
,
wszFormat2
,
wszTypeLib
,
wszName
);
wsprintfW
(
wszTree
,
wszFormat2
,
wszTypeLib
,
wszName
);
tvis
.
hParent
=
TreeView_InsertItem
(
details
.
hReg
,
&
tvis
);
tvis
.
hParent
=
TreeView_InsertItem
W
(
details
.
hReg
,
&
tvis
);
RegCloseKey
(
hCurKey
);
RegCloseKey
(
hCurKey
);
memmove
(
&
wszData
[
8
],
wszData
,
sizeof
(
WCHAR
[
lenData
]));
memmove
(
&
wszData
[
8
],
wszData
,
sizeof
(
WCHAR
[
lenData
]));
memcpy
(
wszData
,
wszTypeLib
,
sizeof
(
WCHAR
[
8
]));
memcpy
(
wszData
,
wszTypeLib
,
sizeof
(
WCHAR
[
8
]));
wszData
[
7
]
=
'\\'
;
wszData
[
7
]
=
'\\'
;
RegOpenKey
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
);
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
wszData
,
&
hCurKey
);
CreateRegRec
(
hCurKey
,
tvis
.
hParent
,
&
wszData
[
8
],
FALSE
);
CreateRegRec
(
hCurKey
,
tvis
.
hParent
,
&
wszData
[
8
],
FALSE
);
SendMessage
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
tvis
.
hParent
);
SendMessage
W
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
tvis
.
hParent
);
tvis
.
hParent
=
parent
;
tvis
.
hParent
=
parent
;
}
}
RegCloseKey
(
hCurKey
);
RegCloseKey
(
hCurKey
);
...
@@ -207,7 +207,7 @@ static void CreateReg(WCHAR *buffer)
...
@@ -207,7 +207,7 @@ static void CreateReg(WCHAR *buffer)
DWORD
lenBuffer
=-
1
,
lastLenBuffer
,
lenTree
;
DWORD
lenBuffer
=-
1
,
lastLenBuffer
,
lenTree
;
WCHAR
*
path
;
WCHAR
*
path
;
WCHAR
wszTree
[
MAX_LOAD_STRING
];
WCHAR
wszTree
[
MAX_LOAD_STRING
];
TVINSERTSTRUCT
tvis
;
TVINSERTSTRUCT
W
tvis
;
HTREEITEM
addPlace
=
TVI_ROOT
;
HTREEITEM
addPlace
=
TVI_ROOT
;
U
(
tvis
).
item
.
mask
=
TVIF_TEXT
;
U
(
tvis
).
item
.
mask
=
TVIF_TEXT
;
...
@@ -225,7 +225,7 @@ static void CreateReg(WCHAR *buffer)
...
@@ -225,7 +225,7 @@ static void CreateReg(WCHAR *buffer)
{
{
*
path
=
'\0'
;
*
path
=
'\0'
;
if
(
RegOpenKey
(
HKEY_CLASSES_ROOT
,
buffer
,
&
hKey
)
!=
ERROR_SUCCESS
)
if
(
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
buffer
,
&
hKey
)
!=
ERROR_SUCCESS
)
return
;
return
;
lastLenBuffer
=
lenBuffer
+
1
;
lastLenBuffer
=
lenBuffer
+
1
;
...
@@ -235,7 +235,7 @@ static void CreateReg(WCHAR *buffer)
...
@@ -235,7 +235,7 @@ static void CreateReg(WCHAR *buffer)
lenTree
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
lenTree
=
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]);
if
(
RegQueryValue
(
hKey
,
NULL
,
wszTree
,
(
LONG
*
)
&
lenTree
)
==
ERROR_SUCCESS
)
if
(
RegQueryValue
W
(
hKey
,
NULL
,
wszTree
,
(
LONG
*
)
&
lenTree
)
==
ERROR_SUCCESS
)
{
{
memmove
(
&
wszTree
[
lenBuffer
-
lastLenBuffer
+
3
],
wszTree
,
memmove
(
&
wszTree
[
lenBuffer
-
lastLenBuffer
+
3
],
wszTree
,
sizeof
(
WCHAR
[
lenTree
]));
sizeof
(
WCHAR
[
lenTree
]));
...
@@ -250,7 +250,7 @@ static void CreateReg(WCHAR *buffer)
...
@@ -250,7 +250,7 @@ static void CreateReg(WCHAR *buffer)
wszTree
[
lenBuffer
-
lastLenBuffer
+
2
]
=
' '
;
wszTree
[
lenBuffer
-
lastLenBuffer
+
2
]
=
' '
;
}
}
addPlace
=
TreeView_InsertItem
(
details
.
hReg
,
&
tvis
);
addPlace
=
TreeView_InsertItem
W
(
details
.
hReg
,
&
tvis
);
}
}
tvis
.
hParent
=
addPlace
;
tvis
.
hParent
=
addPlace
;
...
@@ -259,93 +259,93 @@ static void CreateReg(WCHAR *buffer)
...
@@ -259,93 +259,93 @@ static void CreateReg(WCHAR *buffer)
else
break
;
else
break
;
}
}
if
(
RegOpenKey
(
HKEY_CLASSES_ROOT
,
buffer
,
&
hKey
)
!=
ERROR_SUCCESS
)
return
;
if
(
RegOpenKey
W
(
HKEY_CLASSES_ROOT
,
buffer
,
&
hKey
)
!=
ERROR_SUCCESS
)
return
;
CreateRegRec
(
hKey
,
addPlace
,
&
buffer
[
lenBuffer
+
1
],
TRUE
);
CreateRegRec
(
hKey
,
addPlace
,
&
buffer
[
lenBuffer
+
1
],
TRUE
);
RegCloseKey
(
hKey
);
RegCloseKey
(
hKey
);
SendMessage
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
addPlace
);
SendMessage
W
(
details
.
hReg
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
addPlace
);
SendMessage
(
details
.
hReg
,
TVM_ENSUREVISIBLE
,
0
,
(
LPARAM
)
addPlace
);
SendMessage
W
(
details
.
hReg
,
TVM_ENSUREVISIBLE
,
0
,
(
LPARAM
)
addPlace
);
}
}
void
RefreshDetails
(
HTREEITEM
item
)
void
RefreshDetails
(
HTREEITEM
item
)
{
{
TVITEM
tvi
;
TVITEM
W
tvi
;
WCHAR
wszBuf
[
MAX_LOAD_STRING
];
WCHAR
wszBuf
[
MAX_LOAD_STRING
];
WCHAR
wszStaticText
[
MAX_LOAD_STRING
];
WCHAR
wszStaticText
[
MAX_LOAD_STRING
];
const
WCHAR
wszFormat
[]
=
{
'%'
,
's'
,
'\n'
,
'%'
,
's'
,
'\0'
};
const
WCHAR
wszFormat
[]
=
{
'%'
,
's'
,
'\n'
,
'%'
,
's'
,
'\0'
};
BOOL
show
;
BOOL
show
;
memset
(
&
tvi
,
0
,
sizeof
(
TVITEM
));
memset
(
&
tvi
,
0
,
sizeof
(
TVITEM
W
));
memset
(
&
wszStaticText
,
0
,
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]));
memset
(
&
wszStaticText
,
0
,
sizeof
(
WCHAR
[
MAX_LOAD_STRING
]));
tvi
.
mask
=
TVIF_TEXT
;
tvi
.
mask
=
TVIF_TEXT
;
tvi
.
hItem
=
item
;
tvi
.
hItem
=
item
;
tvi
.
pszText
=
wszBuf
;
tvi
.
pszText
=
wszBuf
;
tvi
.
cchTextMax
=
MAX_LOAD_STRING
;
tvi
.
cchTextMax
=
MAX_LOAD_STRING
;
SendMessage
(
globals
.
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
SendMessage
W
(
globals
.
hTree
,
TVM_GETITEMW
,
0
,
(
LPARAM
)
&
tvi
);
if
(
tvi
.
lParam
)
if
(
tvi
.
lParam
)
wsprintfW
(
wszStaticText
,
wszFormat
,
tvi
.
pszText
,
((
ITEM_INFO
*
)
tvi
.
lParam
)
->
clsid
);
wsprintfW
(
wszStaticText
,
wszFormat
,
tvi
.
pszText
,
((
ITEM_INFO
*
)
tvi
.
lParam
)
->
clsid
);
else
lstrcpyW
(
wszStaticText
,
tvi
.
pszText
);
else
lstrcpyW
(
wszStaticText
,
tvi
.
pszText
);
SetWindowText
(
details
.
hStatic
,
wszStaticText
);
SetWindowText
W
(
details
.
hStatic
,
wszStaticText
);
SendMessage
(
details
.
hTab
,
TCM_SETCURSEL
,
0
,
0
);
SendMessage
W
(
details
.
hTab
,
TCM_SETCURSEL
,
0
,
0
);
if
(
tvi
.
lParam
&&
((
ITEM_INFO
*
)
tvi
.
lParam
)
->
cFlag
&
SHOWALL
)
if
(
tvi
.
lParam
&&
((
ITEM_INFO
*
)
tvi
.
lParam
)
->
cFlag
&
SHOWALL
)
{
{
if
(
SendMessageW
(
details
.
hTab
,
TCM_GETITEMCOUNT
,
0
,
0
)
==
1
)
if
(
SendMessageW
(
details
.
hTab
,
TCM_GETITEMCOUNT
,
0
,
0
)
==
1
)
{
{
TCITEM
tci
;
TCITEM
W
tci
;
memset
(
&
tci
,
0
,
sizeof
(
TCITEM
));
memset
(
&
tci
,
0
,
sizeof
(
TCITEM
W
));
tci
.
mask
=
TCIF_TEXT
;
tci
.
mask
=
TCIF_TEXT
;
tci
.
pszText
=
wszBuf
;
tci
.
pszText
=
wszBuf
;
tci
.
cchTextMax
=
sizeof
(
wszBuf
)
/
sizeof
(
wszBuf
[
0
]);
tci
.
cchTextMax
=
sizeof
(
wszBuf
)
/
sizeof
(
wszBuf
[
0
]);
LoadString
(
globals
.
hMainInst
,
IDS_TAB_IMPL
,
LoadString
W
(
globals
.
hMainInst
,
IDS_TAB_IMPL
,
wszBuf
,
sizeof
(
wszBuf
)
/
sizeof
(
wszBuf
[
0
]));
wszBuf
,
sizeof
(
wszBuf
)
/
sizeof
(
wszBuf
[
0
]));
SendMessage
(
details
.
hTab
,
TCM_INSERTITEM
,
1
,
(
LPARAM
)
&
tci
);
SendMessage
W
(
details
.
hTab
,
TCM_INSERTITEMW
,
1
,
(
LPARAM
)
&
tci
);
LoadString
(
globals
.
hMainInst
,
IDS_TAB_ACTIV
,
LoadString
W
(
globals
.
hMainInst
,
IDS_TAB_ACTIV
,
wszBuf
,
sizeof
(
wszBuf
)
/
sizeof
(
wszBuf
[
0
]));
wszBuf
,
sizeof
(
wszBuf
)
/
sizeof
(
wszBuf
[
0
]));
SendMessage
(
details
.
hTab
,
TCM_INSERTITEM
,
2
,
(
LPARAM
)
&
tci
);
SendMessage
W
(
details
.
hTab
,
TCM_INSERTITEMW
,
2
,
(
LPARAM
)
&
tci
);
}
}
}
}
else
else
{
{
SendMessage
(
details
.
hTab
,
TCM_DELETEITEM
,
2
,
0
);
SendMessage
W
(
details
.
hTab
,
TCM_DELETEITEM
,
2
,
0
);
SendMessage
(
details
.
hTab
,
TCM_DELETEITEM
,
1
,
0
);
SendMessage
W
(
details
.
hTab
,
TCM_DELETEITEM
,
1
,
0
);
}
}
show
=
CreateRegPath
(
item
,
wszBuf
,
MAX_LOAD_STRING
);
show
=
CreateRegPath
(
item
,
wszBuf
,
MAX_LOAD_STRING
);
ShowWindow
(
details
.
hTab
,
show
?
SW_SHOW
:
SW_HIDE
);
ShowWindow
(
details
.
hTab
,
show
?
SW_SHOW
:
SW_HIDE
);
/* FIXME Next line deals with TreeView_EnsureVisible bug */
/* FIXME Next line deals with TreeView_EnsureVisible bug */
SendMessage
(
details
.
hReg
,
TVM_ENSUREVISIBLE
,
0
,
SendMessage
W
(
details
.
hReg
,
TVM_ENSUREVISIBLE
,
0
,
SendMessage
(
details
.
hReg
,
TVM_GETNEXTITEM
,
TVGN_CHILD
,
(
LPARAM
)
TVI_ROOT
));
SendMessage
W
(
details
.
hReg
,
TVM_GETNEXTITEM
,
TVGN_CHILD
,
(
LPARAM
)
TVI_ROOT
));
SendMessage
(
details
.
hReg
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
TVI_ROOT
);
SendMessage
W
(
details
.
hReg
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
TVI_ROOT
);
if
(
show
)
CreateReg
(
wszBuf
);
if
(
show
)
CreateReg
(
wszBuf
);
}
}
static
void
CreateTabCtrl
(
HWND
hWnd
)
static
void
CreateTabCtrl
(
HWND
hWnd
)
{
{
TCITEM
tci
;
TCITEM
W
tci
;
WCHAR
buffer
[
MAX_LOAD_STRING
];
WCHAR
buffer
[
MAX_LOAD_STRING
];
memset
(
&
tci
,
0
,
sizeof
(
TCITEM
));
memset
(
&
tci
,
0
,
sizeof
(
TCITEM
W
));
tci
.
mask
=
TCIF_TEXT
;
tci
.
mask
=
TCIF_TEXT
;
tci
.
pszText
=
buffer
;
tci
.
pszText
=
buffer
;
tci
.
cchTextMax
=
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]);
tci
.
cchTextMax
=
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]);
details
.
hTab
=
CreateWindow
(
WC_TABCONTROL
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
details
.
hTab
=
CreateWindow
W
(
WC_TABCONTROLW
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
hWnd
,
(
HMENU
)
TAB_WINDOW
,
globals
.
hMainInst
,
NULL
);
0
,
0
,
0
,
0
,
hWnd
,
(
HMENU
)
TAB_WINDOW
,
globals
.
hMainInst
,
NULL
);
ShowWindow
(
details
.
hTab
,
SW_HIDE
);
ShowWindow
(
details
.
hTab
,
SW_HIDE
);
LoadString
(
globals
.
hMainInst
,
IDS_TAB_REG
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]));
LoadString
W
(
globals
.
hMainInst
,
IDS_TAB_REG
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]));
SendMessage
(
details
.
hTab
,
TCM_INSERTITEM
,
0
,
(
LPARAM
)
&
tci
);
SendMessage
W
(
details
.
hTab
,
TCM_INSERTITEMW
,
0
,
(
LPARAM
)
&
tci
);
details
.
hReg
=
CreateWindowEx
(
WS_EX_CLIENTEDGE
,
WC_TREEVIE
W
,
NULL
,
details
.
hReg
=
CreateWindowEx
W
(
WS_EX_CLIENTEDGE
,
WC_TREEVIEW
W
,
NULL
,
WS_CHILD
|
WS_VISIBLE
|
TVS_HASLINES
,
WS_CHILD
|
WS_VISIBLE
|
TVS_HASLINES
,
0
,
0
,
0
,
0
,
details
.
hTab
,
NULL
,
globals
.
hMainInst
,
NULL
);
0
,
0
,
0
,
0
,
details
.
hTab
,
NULL
,
globals
.
hMainInst
,
NULL
);
}
}
...
@@ -360,7 +360,7 @@ static LRESULT CALLBACK DetailsProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
...
@@ -360,7 +360,7 @@ static LRESULT CALLBACK DetailsProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
{
{
const
WCHAR
wszStatic
[]
=
{
'S'
,
't'
,
'a'
,
't'
,
'i'
,
'c'
,
'\0'
};
const
WCHAR
wszStatic
[]
=
{
'S'
,
't'
,
'a'
,
't'
,
'i'
,
'c'
,
'\0'
};
details
.
hStatic
=
CreateWindow
(
wszStatic
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
details
.
hStatic
=
CreateWindow
W
(
wszStatic
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
hWnd
,
NULL
,
globals
.
hMainInst
,
NULL
);
0
,
0
,
0
,
0
,
hWnd
,
NULL
,
globals
.
hMainInst
,
NULL
);
CreateTabCtrl
(
hWnd
);
CreateTabCtrl
(
hWnd
);
}
}
...
@@ -384,24 +384,24 @@ static LRESULT CALLBACK DetailsProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
...
@@ -384,24 +384,24 @@ static LRESULT CALLBACK DetailsProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
}
}
break
;
break
;
default:
default:
return
DefWindowProc
(
hWnd
,
uMsg
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hWnd
,
uMsg
,
wParam
,
lParam
);
}
}
return
0
;
return
0
;
}
}
HWND
CreateDetailsWindow
(
HINSTANCE
hInst
)
HWND
CreateDetailsWindow
(
HINSTANCE
hInst
)
{
{
WNDCLASS
wcd
;
WNDCLASS
W
wcd
;
const
WCHAR
wszDetailsClass
[]
=
{
'D'
,
'E'
,
'T'
,
'A'
,
'I'
,
'L'
,
'S'
,
'\0'
};
const
WCHAR
wszDetailsClass
[]
=
{
'D'
,
'E'
,
'T'
,
'A'
,
'I'
,
'L'
,
'S'
,
'\0'
};
memset
(
&
wcd
,
0
,
sizeof
(
WNDCLASS
));
memset
(
&
wcd
,
0
,
sizeof
(
WNDCLASS
W
));
wcd
.
lpfnWndProc
=
DetailsProc
;
wcd
.
lpfnWndProc
=
DetailsProc
;
wcd
.
lpszClassName
=
wszDetailsClass
;
wcd
.
lpszClassName
=
wszDetailsClass
;
wcd
.
hbrBackground
=
(
HBRUSH
)
COLOR_WINDOW
;
wcd
.
hbrBackground
=
(
HBRUSH
)
COLOR_WINDOW
;
if
(
!
RegisterClass
(
&
wcd
))
return
NULL
;
if
(
!
RegisterClass
W
(
&
wcd
))
return
NULL
;
globals
.
hDetails
=
CreateWindowEx
(
WS_EX_CLIENTEDGE
,
wszDetailsClass
,
NULL
,
globals
.
hDetails
=
CreateWindowEx
W
(
WS_EX_CLIENTEDGE
,
wszDetailsClass
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
globals
.
hPaneWnd
,
NULL
,
hInst
,
NULL
);
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
globals
.
hPaneWnd
,
NULL
,
hInst
,
NULL
);
return
globals
.
hDetails
;
return
globals
.
hDetails
;
...
...
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