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
c37cdce9
Commit
c37cdce9
authored
Jul 19, 2010
by
Dylan Smith
Committed by
Alexandre Julliard
Jul 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Save and load word wrap registry options.
parent
9de83579
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
registry.c
programs/wordpad/registry.c
+23
-9
wordpad.c
programs/wordpad/wordpad.c
+1
-1
wordpad.h
programs/wordpad/wordpad.h
+1
-1
No files found.
programs/wordpad/registry.c
View file @
c37cdce9
...
...
@@ -34,6 +34,7 @@ static const WCHAR key_text[] = {'T','e','x','t',0};
static
const
WCHAR
var_file
[]
=
{
'F'
,
'i'
,
'l'
,
'e'
,
'%'
,
'd'
,
0
};
static
const
WCHAR
var_framerect
[]
=
{
'F'
,
'r'
,
'a'
,
'm'
,
'e'
,
'R'
,
'e'
,
'c'
,
't'
,
0
};
static
const
WCHAR
var_barstate0
[]
=
{
'B'
,
'a'
,
'r'
,
'S'
,
't'
,
'a'
,
't'
,
'e'
,
'0'
,
0
};
static
const
WCHAR
var_wrap
[]
=
{
'W'
,
'r'
,
'a'
,
'p'
,
0
};
static
const
WCHAR
var_maximized
[]
=
{
'M'
,
'a'
,
'x'
,
'i'
,
'm'
,
'i'
,
'z'
,
'e'
,
'd'
,
0
};
static
LRESULT
registry_get_handle
(
HKEY
*
hKey
,
LPDWORD
action
,
LPCWSTR
subKey
)
...
...
@@ -377,10 +378,22 @@ static void registry_read_formatopts(int index, LPCWSTR key, DWORD barState[], D
if
(
!
fetched
)
barState
[
index
]
=
(
1
<<
BANDID_TOOLBAR
)
|
(
1
<<
BANDID_FORMATBAR
)
|
(
1
<<
BANDID_RULER
)
|
(
1
<<
BANDID_STATUSBAR
);
if
(
index
==
reg_formatindex
(
SF_RTF
))
wordWrap
[
index
]
=
ID_WORDWRAP_WINDOW
;
else
if
(
index
==
reg_formatindex
(
SF_TEXT
))
wordWrap
[
index
]
=
ID_WORDWRAP_NONE
;
fetched
=
FALSE
;
if
(
action
==
REG_OPENED_EXISTING_KEY
)
{
DWORD
size
=
sizeof
(
DWORD
);
if
(
RegQueryValueExW
(
hKey
,
var_wrap
,
0
,
NULL
,
(
LPBYTE
)
&
wordWrap
[
index
],
&
size
)
==
ERROR_SUCCESS
)
fetched
=
TRUE
;
}
if
(
!
fetched
)
{
if
(
index
==
reg_formatindex
(
SF_RTF
))
wordWrap
[
index
]
=
ID_WORDWRAP_WINDOW
;
else
if
(
index
==
reg_formatindex
(
SF_TEXT
))
wordWrap
[
index
]
=
ID_WORDWRAP_NONE
;
}
RegCloseKey
(
hKey
);
}
...
...
@@ -391,7 +404,7 @@ void registry_read_formatopts_all(DWORD barState[], DWORD wordWrap[])
registry_read_formatopts
(
reg_formatindex
(
SF_TEXT
),
key_text
,
barState
,
wordWrap
);
}
static
void
registry_set_formatopts
(
int
index
,
LPCWSTR
key
,
DWORD
barState
[])
static
void
registry_set_formatopts
(
int
index
,
LPCWSTR
key
,
DWORD
barState
[]
,
DWORD
wordWrap
[]
)
{
HKEY
hKey
;
DWORD
action
=
0
;
...
...
@@ -400,13 +413,14 @@ static void registry_set_formatopts(int index, LPCWSTR key, DWORD barState[])
{
RegSetValueExW
(
hKey
,
var_barstate0
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
barState
[
index
],
sizeof
(
DWORD
));
RegSetValueExW
(
hKey
,
var_wrap
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
wordWrap
[
index
],
sizeof
(
DWORD
));
RegCloseKey
(
hKey
);
}
}
void
registry_set_formatopts_all
(
DWORD
barState
[])
void
registry_set_formatopts_all
(
DWORD
barState
[]
,
DWORD
wordWrap
[]
)
{
registry_set_formatopts
(
reg_formatindex
(
SF_RTF
),
key_rtf
,
barState
);
registry_set_formatopts
(
reg_formatindex
(
SF_TEXT
),
key_text
,
barState
);
registry_set_formatopts
(
reg_formatindex
(
SF_RTF
),
key_rtf
,
barState
,
wordWrap
);
registry_set_formatopts
(
reg_formatindex
(
SF_TEXT
),
key_text
,
barState
,
wordWrap
);
}
programs/wordpad/wordpad.c
View file @
c37cdce9
...
...
@@ -2639,7 +2639,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
}
else
if
(
prompt_save_changes
())
{
registry_set_options
(
hMainWnd
);
registry_set_formatopts_all
(
barState
);
registry_set_formatopts_all
(
barState
,
wordWrap
);
PostQuitMessage
(
0
);
}
break
;
...
...
programs/wordpad/wordpad.h
View file @
c37cdce9
...
...
@@ -262,5 +262,5 @@ void registry_read_formatopts_all(DWORD[], DWORD[]);
void
registry_read_winrect
(
RECT
*
);
void
registry_read_maximized
(
DWORD
*
);
void
registry_set_filelist
(
LPCWSTR
,
HWND
);
void
registry_set_formatopts_all
(
DWORD
[]);
void
registry_set_formatopts_all
(
DWORD
[]
,
DWORD
[]
);
void
registry_set_options
(
HWND
);
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