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
46ea43e6
Commit
46ea43e6
authored
Aug 26, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Aug 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Convert menu & statusbar handling to unicode.
parent
918303a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
framewnd.c
programs/regedit/framewnd.c
+18
-14
main.c
programs/regedit/main.c
+5
-4
No files found.
programs/regedit/framewnd.c
View file @
46ea43e6
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "main.h"
#include "main.h"
#include "regproc.h"
#include "regproc.h"
#include "wine/unicode.h"
/********************************************************************************
/********************************************************************************
* Global and Local Variables:
* Global and Local Variables:
...
@@ -82,12 +83,13 @@ static void resize_frame_client(HWND hWnd)
...
@@ -82,12 +83,13 @@ static void resize_frame_client(HWND hWnd)
static
void
OnEnterMenuLoop
(
HWND
hWnd
)
static
void
OnEnterMenuLoop
(
HWND
hWnd
)
{
{
int
nParts
;
int
nParts
;
WCHAR
empty
=
0
;
/* Update the status bar pane sizes */
/* Update the status bar pane sizes */
nParts
=
-
1
;
nParts
=
-
1
;
SendMessage
(
hStatusBar
,
SB_SETPARTS
,
1
,
(
long
)
&
nParts
);
SendMessage
W
(
hStatusBar
,
SB_SETPARTS
,
1
,
(
long
)
&
nParts
);
bInMenuLoop
=
TRUE
;
bInMenuLoop
=
TRUE
;
SendMessage
(
hStatusBar
,
SB_SETTEXT
,
(
WPARAM
)
0
,
(
LPARAM
)
_T
(
""
)
);
SendMessage
W
(
hStatusBar
,
SB_SETTEXTW
,
(
WPARAM
)
0
,
(
LPARAM
)
&
empty
);
}
}
static
void
OnExitMenuLoop
(
HWND
hWnd
)
static
void
OnExitMenuLoop
(
HWND
hWnd
)
...
@@ -102,8 +104,8 @@ static void UpdateMenuItems(HMENU hMenu) {
...
@@ -102,8 +104,8 @@ static void UpdateMenuItems(HMENU hMenu) {
HWND
hwndTV
=
g_pChildWnd
->
hTreeWnd
;
HWND
hwndTV
=
g_pChildWnd
->
hTreeWnd
;
BOOL
bAllowEdit
=
FALSE
;
BOOL
bAllowEdit
=
FALSE
;
HKEY
hRootKey
=
NULL
;
HKEY
hRootKey
=
NULL
;
LP
CT
STR
keyName
;
LP
W
STR
keyName
;
keyName
=
GetItemPath
(
hwndTV
,
TreeView_GetSelection
(
hwndTV
),
&
hRootKey
);
keyName
=
GetItemPath
W
(
hwndTV
,
TreeView_GetSelection
(
hwndTV
),
&
hRootKey
);
if
(
GetFocus
()
!=
hwndTV
||
(
keyName
&&
*
keyName
))
{
/* can't modify root keys, but allow for their values */
if
(
GetFocus
()
!=
hwndTV
||
(
keyName
&&
*
keyName
))
{
/* can't modify root keys, but allow for their values */
bAllowEdit
=
TRUE
;
bAllowEdit
=
TRUE
;
}
}
...
@@ -115,6 +117,8 @@ static void UpdateMenuItems(HMENU hMenu) {
...
@@ -115,6 +117,8 @@ static void UpdateMenuItems(HMENU hMenu) {
EnableMenuItem
(
hMenu
,
ID_FAVORITES_ADDTOFAVORITES
,
(
hRootKey
?
MF_ENABLED
:
MF_GRAYED
)
|
MF_BYCOMMAND
);
EnableMenuItem
(
hMenu
,
ID_FAVORITES_ADDTOFAVORITES
,
(
hRootKey
?
MF_ENABLED
:
MF_GRAYED
)
|
MF_BYCOMMAND
);
EnableMenuItem
(
hMenu
,
ID_FAVORITES_REMOVEFAVORITE
,
EnableMenuItem
(
hMenu
,
ID_FAVORITES_REMOVEFAVORITE
,
(
GetMenuItemCount
(
hMenu
)
>
2
?
MF_ENABLED
:
MF_GRAYED
)
|
MF_BYCOMMAND
);
(
GetMenuItemCount
(
hMenu
)
>
2
?
MF_ENABLED
:
MF_GRAYED
)
|
MF_BYCOMMAND
);
HeapFree
(
GetProcessHeap
(),
0
,
keyName
);
}
}
static
void
OnInitMenuPopup
(
HWND
hWnd
,
HMENU
hMenu
,
short
wItem
)
static
void
OnInitMenuPopup
(
HWND
hWnd
,
HMENU
hMenu
,
short
wItem
)
...
@@ -154,23 +158,23 @@ static void OnInitMenuPopup(HWND hWnd, HMENU hMenu, short wItem)
...
@@ -154,23 +158,23 @@ static void OnInitMenuPopup(HWND hWnd, HMENU hMenu, short wItem)
static
void
OnMenuSelect
(
HWND
hWnd
,
UINT
nItemID
,
UINT
nFlags
,
HMENU
hSysMenu
)
static
void
OnMenuSelect
(
HWND
hWnd
,
UINT
nItemID
,
UINT
nFlags
,
HMENU
hSysMenu
)
{
{
T
CHAR
str
[
100
];
W
CHAR
str
[
100
];
_tcscpy
(
str
,
_T
(
""
))
;
str
[
0
]
=
0
;
if
(
nFlags
&
MF_POPUP
)
{
if
(
nFlags
&
MF_POPUP
)
{
if
(
hSysMenu
!=
GetMenu
(
hWnd
))
{
if
(
hSysMenu
!=
GetMenu
(
hWnd
))
{
if
(
nItemID
==
2
)
nItemID
=
5
;
if
(
nItemID
==
2
)
nItemID
=
5
;
}
}
}
}
if
(
LoadString
(
hInst
,
nItemID
,
str
,
100
))
{
if
(
LoadString
W
(
hInst
,
nItemID
,
str
,
100
))
{
/* load appropriate string*/
/* load appropriate string*/
LP
T
STR
lpsz
=
str
;
LP
W
STR
lpsz
=
str
;
/* first newline terminates actual string*/
/* first newline terminates actual string*/
lpsz
=
_tcschr
(
lpsz
,
'\n'
);
lpsz
=
strchrW
(
lpsz
,
'\n'
);
if
(
lpsz
!=
NULL
)
if
(
lpsz
!=
NULL
)
*
lpsz
=
'\0'
;
*
lpsz
=
'\0'
;
}
}
SendMessage
(
hStatusBar
,
SB_SETTEXT
,
0
,
(
LPARAM
)
str
);
SendMessage
W
(
hStatusBar
,
SB_SETTEXTW
,
0
,
(
LPARAM
)
str
);
}
}
void
SetupStatusBar
(
HWND
hWnd
,
BOOL
bResize
)
void
SetupStatusBar
(
HWND
hWnd
,
BOOL
bResize
)
...
@@ -181,15 +185,15 @@ void SetupStatusBar(HWND hWnd, BOOL bResize)
...
@@ -181,15 +185,15 @@ void SetupStatusBar(HWND hWnd, BOOL bResize)
nParts
=
rc
.
right
;
nParts
=
rc
.
right
;
/* nParts = -1;*/
/* nParts = -1;*/
if
(
bResize
)
if
(
bResize
)
SendMessage
(
hStatusBar
,
WM_SIZE
,
0
,
0
);
SendMessage
W
(
hStatusBar
,
WM_SIZE
,
0
,
0
);
SendMessage
(
hStatusBar
,
SB_SETPARTS
,
1
,
(
LPARAM
)
&
nParts
);
SendMessage
W
(
hStatusBar
,
SB_SETPARTS
,
1
,
(
LPARAM
)
&
nParts
);
UpdateStatusBar
();
UpdateStatusBar
();
}
}
void
UpdateStatusBar
(
void
)
void
UpdateStatusBar
(
void
)
{
{
LP
TSTR
fullPath
=
GetItemFullPath
(
g_pChildWnd
->
hTreeWnd
,
NULL
,
TRUE
);
LP
WSTR
fullPath
=
GetItemFullPathW
(
g_pChildWnd
->
hTreeWnd
,
NULL
,
TRUE
);
SendMessage
(
hStatusBar
,
SB_SETTEXT
,
0
,
(
LPARAM
)
fullPath
);
SendMessage
W
(
hStatusBar
,
SB_SETTEXTW
,
0
,
(
LPARAM
)
fullPath
);
HeapFree
(
GetProcessHeap
(),
0
,
fullPath
);
HeapFree
(
GetProcessHeap
(),
0
,
fullPath
);
}
}
...
...
programs/regedit/main.c
View file @
46ea43e6
...
@@ -80,6 +80,7 @@ const TCHAR szChildClass[] = {'R','E','G','E','D','I','T',0};
...
@@ -80,6 +80,7 @@ const TCHAR szChildClass[] = {'R','E','G','E','D','I','T',0};
static
BOOL
InitInstance
(
HINSTANCE
hInstance
,
int
nCmdShow
)
static
BOOL
InitInstance
(
HINSTANCE
hInstance
,
int
nCmdShow
)
{
{
WCHAR
empty
=
0
;
WNDCLASSEX
wcFrame
=
{
WNDCLASSEX
wcFrame
=
{
sizeof
(
WNDCLASSEX
),
sizeof
(
WNDCLASSEX
),
CS_HREDRAW
|
CS_VREDRAW
/*style*/
,
CS_HREDRAW
|
CS_VREDRAW
/*style*/
,
...
@@ -116,8 +117,8 @@ static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
...
@@ -116,8 +117,8 @@ static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
ATOM
hChildWndClass
=
RegisterClassEx
(
&
wcChild
);
/* register child windows class */
ATOM
hChildWndClass
=
RegisterClassEx
(
&
wcChild
);
/* register child windows class */
hChildWndClass
=
hChildWndClass
;
/* warning eater */
hChildWndClass
=
hChildWndClass
;
/* warning eater */
hMenuFrame
=
LoadMenu
(
hInstance
,
MAKEINTRESOURCE
(
IDR_REGEDIT_MENU
));
hMenuFrame
=
LoadMenu
W
(
hInstance
,
MAKEINTRESOURCEW
(
IDR_REGEDIT_MENU
));
hPopupMenus
=
LoadMenu
(
hInstance
,
MAKEINTRESOURCE
(
IDR_POPUP_MENUS
));
hPopupMenus
=
LoadMenu
W
(
hInstance
,
MAKEINTRESOURCEW
(
IDR_POPUP_MENUS
));
/* Initialize the Windows Common Controls DLL */
/* Initialize the Windows Common Controls DLL */
InitCommonControls
();
InitCommonControls
();
...
@@ -140,8 +141,8 @@ static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
...
@@ -140,8 +141,8 @@ static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
}
}
/* Create the status bar */
/* Create the status bar */
hStatusBar
=
CreateStatusWindow
(
WS_VISIBLE
|
WS_CHILD
|
WS_CLIPSIBLINGS
|
SBT_NOBORDERS
,
hStatusBar
=
CreateStatusWindow
W
(
WS_VISIBLE
|
WS_CHILD
|
WS_CLIPSIBLINGS
|
SBT_NOBORDERS
,
_T
(
""
)
,
hFrameWnd
,
STATUS_WINDOW
);
&
empty
,
hFrameWnd
,
STATUS_WINDOW
);
if
(
hStatusBar
)
{
if
(
hStatusBar
)
{
/* Create the status bar panes */
/* Create the status bar panes */
SetupStatusBar
(
hFrameWnd
,
FALSE
);
SetupStatusBar
(
hFrameWnd
,
FALSE
);
...
...
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