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
7369b6cf
Commit
7369b6cf
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: Refactor window class initialization to a separate function.
parent
1054b955
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
35 deletions
+34
-35
main.c
programs/regedit/main.c
+34
-35
No files found.
programs/regedit/main.c
View file @
7369b6cf
...
...
@@ -63,7 +63,37 @@ TCHAR szTitle[MAX_LOADSTRING];
const
TCHAR
szFrameClass
[]
=
{
'R'
,
'E'
,
'G'
,
'E'
,
'D'
,
'I'
,
'T'
,
'_'
,
'F'
,
'R'
,
'A'
,
'M'
,
'E'
,
0
};
const
TCHAR
szChildClass
[]
=
{
'R'
,
'E'
,
'G'
,
'E'
,
'D'
,
'I'
,
'T'
,
0
};
static
BOOL
RegisterWindowClasses
(
HINSTANCE
hInstance
,
ATOM
*
hFrameWndClass
,
ATOM
*
hChildWndClass
)
{
WNDCLASSEX
wndclass
=
{
0
};
/* Frame class */
wndclass
.
cbSize
=
sizeof
(
WNDCLASSEX
);
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
.
lpszClassName
=
szFrameClass
;
wndclass
.
hIconSm
=
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
IDI_REGEDIT
),
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
LR_SHARED
);
if
(
!
(
*
hFrameWndClass
=
RegisterClassEx
(
&
wndclass
)))
return
FALSE
;
/* Child class */
wndclass
.
lpfnWndProc
=
ChildWndProc
;
wndclass
.
cbWndExtra
=
sizeof
(
HANDLE
);
wndclass
.
lpszClassName
=
szChildClass
;
if
(
!
(
*
hChildWndClass
=
RegisterClassEx
(
&
wndclass
)))
{
UnregisterClass
(
szFrameClass
,
hInstance
);
return
FALSE
;
}
return
TRUE
;
}
/*******************************************************************************
*
*
...
...
@@ -80,41 +110,10 @@ const TCHAR szChildClass[] = {'R','E','G','E','D','I','T',0};
static
BOOL
InitInstance
(
HINSTANCE
hInstance
,
int
nCmdShow
)
{
WCHAR
empty
=
0
;
WNDCLASSEX
wcFrame
=
{
sizeof
(
WNDCLASSEX
),
CS_HREDRAW
|
CS_VREDRAW
/*style*/
,
FrameWndProc
,
0
/*cbClsExtra*/
,
0
/*cbWndExtra*/
,
hInstance
,
LoadIcon
(
hInstance
,
MAKEINTRESOURCE
(
IDI_REGEDIT
)),
LoadCursor
(
0
,
IDC_ARROW
),
0
/*hbrBackground*/
,
0
/*lpszMenuName*/
,
szFrameClass
,
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
IDI_REGEDIT
),
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
LR_SHARED
)
};
ATOM
hFrameWndClass
=
RegisterClassEx
(
&
wcFrame
);
/* register frame window class */
WNDCLASSEX
wcChild
=
{
sizeof
(
WNDCLASSEX
),
CS_HREDRAW
|
CS_VREDRAW
/*style*/
,
ChildWndProc
,
0
/*cbClsExtra*/
,
sizeof
(
HANDLE
)
/*cbWndExtra*/
,
hInstance
,
LoadIcon
(
hInstance
,
MAKEINTRESOURCE
(
IDI_REGEDIT
)),
LoadCursor
(
0
,
IDC_ARROW
),
0
/*hbrBackground*/
,
0
/*lpszMenuName*/
,
szChildClass
,
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
IDI_REGEDIT
),
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
LR_SHARED
)
};
ATOM
hChildWndClass
=
RegisterClassEx
(
&
wcChild
);
/* register child windows class */
hChildWndClass
=
hChildWndClass
;
/* warning eater */
ATOM
hFrameWndClass
,
hChildWndClass
;
if
(
!
RegisterWindowClasses
(
hInstance
,
&
hFrameWndClass
,
&
hChildWndClass
))
return
FALSE
;
hMenuFrame
=
LoadMenuW
(
hInstance
,
MAKEINTRESOURCEW
(
IDR_REGEDIT_MENU
));
hPopupMenus
=
LoadMenuW
(
hInstance
,
MAKEINTRESOURCEW
(
IDR_POPUP_MENUS
));
...
...
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