Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
182763f6
Commit
182763f6
authored
Apr 16, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Apr 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Convert regedit main code to Unicode.
parent
3571ae27
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
33 deletions
+35
-33
childwnd.c
programs/regedit/childwnd.c
+1
-1
framewnd.c
programs/regedit/framewnd.c
+7
-5
main.c
programs/regedit/main.c
+24
-24
main.h
programs/regedit/main.h
+3
-3
No files found.
programs/regedit/childwnd.c
View file @
182763f6
...
...
@@ -441,7 +441,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
}
/* fall through */
default:
def:
return
DefWindowProc
(
hWnd
,
message
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
programs/regedit/framewnd.c
View file @
182763f6
...
...
@@ -921,15 +921,17 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT
CALLBACK
FrameWndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
const
WCHAR
captionW
[]
=
{
'r'
,
'e'
,
'g'
,
'e'
,
'd'
,
'i'
,
't'
,
' '
,
'c'
,
'h'
,
'i'
,
'l'
,
'd'
,
' '
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
0
};
switch
(
message
)
{
case
WM_CREATE
:
CreateWindowEx
(
0
,
szChildClass
,
_T
(
"regedit child window"
)
,
WS_CHILD
|
WS_VISIBLE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
hWnd
,
NULL
,
hInst
,
0
);
CreateWindowEx
W
(
0
,
szChildClass
,
captionW
,
WS_CHILD
|
WS_VISIBLE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
hWnd
,
NULL
,
hInst
,
0
);
break
;
case
WM_COMMAND
:
if
(
!
_CmdWndProc
(
hWnd
,
message
,
wParam
,
lParam
))
return
DefWindowProc
(
hWnd
,
message
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hWnd
,
message
,
wParam
,
lParam
);
break
;
case
WM_ACTIVATE
:
if
(
LOWORD
(
hWnd
))
...
...
@@ -960,7 +962,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
PostQuitMessage
(
0
);
}
default:
return
DefWindowProc
(
hWnd
,
message
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
programs/regedit/main.c
View file @
182763f6
...
...
@@ -55,30 +55,30 @@ HWND hStatusBar;
HMENU
hMenuFrame
;
HMENU
hPopupMenus
=
0
;
UINT
nClipboardFormat
;
LPCTSTR
strClipboardFormat
=
_T
(
"TODO: SET CORRECT FORMAT"
)
;
const
WCHAR
strClipboardFormat
[]
=
{
'T'
,
'O'
,
'D'
,
'O'
,
':'
,
' '
,
'S'
,
'E'
,
'T'
,
' '
,
'C'
,
'O'
,
'R'
,
'R'
,
'E'
,
'C'
,
'T'
,
' '
,
'F'
,
'O'
,
'R'
,
'M'
,
'A'
,
'T'
,
0
}
;
#define MAX_LOADSTRING 100
T
CHAR
szTitle
[
MAX_LOADSTRING
];
const
T
CHAR
szFrameClass
[]
=
{
'R'
,
'E'
,
'G'
,
'E'
,
'D'
,
'I'
,
'T'
,
'_'
,
'F'
,
'R'
,
'A'
,
'M'
,
'E'
,
0
};
const
T
CHAR
szChildClass
[]
=
{
'R'
,
'E'
,
'G'
,
'E'
,
'D'
,
'I'
,
'T'
,
0
};
W
CHAR
szTitle
[
MAX_LOADSTRING
];
const
W
CHAR
szFrameClass
[]
=
{
'R'
,
'E'
,
'G'
,
'E'
,
'D'
,
'I'
,
'T'
,
'_'
,
'F'
,
'R'
,
'A'
,
'M'
,
'E'
,
0
};
const
W
CHAR
szChildClass
[]
=
{
'R'
,
'E'
,
'G'
,
'E'
,
'D'
,
'I'
,
'T'
,
0
};
static
BOOL
RegisterWindowClasses
(
HINSTANCE
hInstance
,
ATOM
*
hFrameWndClass
,
ATOM
*
hChildWndClass
)
{
WNDCLASSEX
wndclass
=
{
0
};
WNDCLASSEX
W
wndclass
=
{
0
};
/* Frame class */
wndclass
.
cbSize
=
sizeof
(
WNDCLASSEX
);
wndclass
.
cbSize
=
sizeof
(
WNDCLASSEX
W
);
wndclass
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wndclass
.
lpfnWndProc
=
FrameWndProc
;
wndclass
.
hInstance
=
hInstance
;
wndclass
.
hIcon
=
LoadIcon
(
hInstance
,
MAKEINTRESOURCE
(
IDI_REGEDIT
));
wndclass
.
hCursor
=
LoadCursor
(
0
,
IDC_ARROW
);
wndclass
.
hIcon
=
LoadIcon
W
(
hInstance
,
MAKEINTRESOURCEW
(
IDI_REGEDIT
));
wndclass
.
hCursor
=
LoadCursor
W
(
0
,
(
LPCWSTR
)
IDC_ARROW
);
wndclass
.
lpszClassName
=
szFrameClass
;
wndclass
.
hIconSm
=
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
IDI_REGEDIT
),
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
LR_SHARED
);
wndclass
.
hIconSm
=
LoadImage
W
(
hInstance
,
MAKEINTRESOURCEW
(
IDI_REGEDIT
),
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
LR_SHARED
);
if
(
!
(
*
hFrameWndClass
=
RegisterClassEx
(
&
wndclass
)))
if
(
!
(
*
hFrameWndClass
=
RegisterClassEx
W
(
&
wndclass
)))
return
FALSE
;
/* Child class */
...
...
@@ -86,9 +86,9 @@ static BOOL RegisterWindowClasses(HINSTANCE hInstance, ATOM *hFrameWndClass, ATO
wndclass
.
cbWndExtra
=
sizeof
(
HANDLE
);
wndclass
.
lpszClassName
=
szChildClass
;
if
(
!
(
*
hChildWndClass
=
RegisterClassEx
(
&
wndclass
)))
if
(
!
(
*
hChildWndClass
=
RegisterClassEx
W
(
&
wndclass
)))
{
UnregisterClass
(
szFrameClass
,
hInstance
);
UnregisterClass
W
(
szFrameClass
,
hInstance
);
return
FALSE
;
}
...
...
@@ -112,12 +112,12 @@ static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
/* register our hex editor control */
HexEdit_Register
();
nClipboardFormat
=
RegisterClipboardFormat
(
strClipboardFormat
);
nClipboardFormat
=
RegisterClipboardFormat
W
(
strClipboardFormat
);
hFrameWnd
=
CreateWindowEx
(
0
,
MAKEINTRESOURCE
(
hFrameWndClass
),
szTitle
,
WS_OVERLAPPEDWINDOW
|
WS_EX_CLIENTEDGE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
NULL
,
hMenuFrame
,
hInstance
,
NULL
/*lpParam*/
);
hFrameWnd
=
CreateWindowEx
W
(
0
,
MAKEINTRESOURCEW
(
hFrameWndClass
),
szTitle
,
WS_OVERLAPPEDWINDOW
|
WS_EX_CLIENTEDGE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
NULL
,
hMenuFrame
,
hInstance
,
NULL
/*lpParam*/
);
if
(
!
hFrameWnd
)
{
return
FALSE
;
...
...
@@ -148,7 +148,7 @@ static BOOL TranslateChildTabMessage(MSG *msg)
if
(
msg
->
message
!=
WM_KEYDOWN
)
return
FALSE
;
if
(
msg
->
wParam
!=
VK_TAB
)
return
FALSE
;
if
(
GetParent
(
msg
->
hwnd
)
!=
g_pChildWnd
->
hWnd
)
return
FALSE
;
PostMessage
(
g_pChildWnd
->
hWnd
,
WM_COMMAND
,
ID_SWITCH_PANELS
,
0
);
PostMessage
W
(
g_pChildWnd
->
hWnd
,
WM_COMMAND
,
ID_SWITCH_PANELS
,
0
);
return
TRUE
;
}
...
...
@@ -165,7 +165,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
}
/* Initialize global strings */
LoadString
(
hInstance
,
IDS_APP_TITLE
,
szTitle
,
COUNT_OF
(
szTitle
));
LoadString
W
(
hInstance
,
IDS_APP_TITLE
,
szTitle
,
COUNT_OF
(
szTitle
));
LoadStringW
(
hInstance
,
IDS_REGISTRY_DEFAULT_VALUE
,
g_pszDefaultValueName
,
COUNT_OF
(
g_pszDefaultValueName
));
/* Store instance handle in our global variable */
...
...
@@ -175,14 +175,14 @@ int APIENTRY WinMain(HINSTANCE hInstance,
if
(
!
InitInstance
(
hInstance
,
nCmdShow
))
{
return
FALSE
;
}
hAccel
=
LoadAccelerators
(
hInstance
,
(
LPCTSTR
)
IDC_REGEDIT
);
hAccel
=
LoadAccelerators
W
(
hInstance
,
MAKEINTRESOURCEW
(
IDC_REGEDIT
)
);
/* Main message loop */
while
(
GetMessage
(
&
msg
,
NULL
,
0
,
0
))
{
if
(
!
TranslateAccelerator
(
hFrameWnd
,
hAccel
,
&
msg
)
while
(
GetMessage
W
(
&
msg
,
NULL
,
0
,
0
))
{
if
(
!
TranslateAccelerator
W
(
hFrameWnd
,
hAccel
,
&
msg
)
&&
!
TranslateChildTabMessage
(
&
msg
))
{
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
DispatchMessage
W
(
&
msg
);
}
}
ExitInstance
();
...
...
programs/regedit/main.h
View file @
182763f6
...
...
@@ -87,9 +87,9 @@ extern HMENU hPopupMenus;
extern
HFONT
hFont
;
extern
enum
OPTION_FLAGS
Options
;
extern
T
CHAR
szTitle
[];
extern
const
T
CHAR
szFrameClass
[];
extern
const
T
CHAR
szChildClass
[];
extern
W
CHAR
szTitle
[];
extern
const
W
CHAR
szFrameClass
[];
extern
const
W
CHAR
szChildClass
[];
extern
WCHAR
g_pszDefaultValueName
[];
/* Registry class names and their indexes */
...
...
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