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
b9265bc3
Commit
b9265bc3
authored
Mar 08, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Support default colours for wineconsole.
parent
00ad4c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
1 deletion
+59
-1
wcmdmain.c
programs/cmd/wcmdmain.c
+59
-1
No files found.
programs/cmd/wcmdmain.c
View file @
b9265bc3
...
...
@@ -262,10 +262,68 @@ int main (int argc, char *argv[])
/* Note: cmd.exe /c dir does not get a new color, /k dir does */
if
(
opt_t
)
{
if
(
!
(((
opt_t
&
0xF0
)
>>
4
)
==
(
opt_t
&
0x0F
)))
{
defaultColor
=
opt_t
;
defaultColor
=
opt_t
&
0xFF
;
param1
[
0
]
=
0x00
;
WCMD_color
();
}
}
else
{
/* Check HKCU\Software\Microsoft\Command Processor
Then HKLM\Software\Microsoft\Command Processor
for defaultcolour value
Note Can be supplied as DWORD or REG_SZ
Note2 When supplied as REG_SZ it's in decimal!!! */
HKEY
key
;
DWORD
type
;
DWORD
value
=
0
,
size
=
4
;
if
(
RegOpenKeyEx
(
HKEY_CURRENT_USER
,
"Software
\\
Microsoft
\\
Command Processor"
,
0
,
KEY_READ
,
&
key
)
==
ERROR_SUCCESS
)
{
char
strvalue
[
4
];
/* See if DWORD or REG_SZ */
if
(
RegQueryValueEx
(
key
,
"DefaultColor"
,
NULL
,
&
type
,
NULL
,
NULL
)
==
ERROR_SUCCESS
)
{
if
(
type
==
REG_DWORD
)
{
size
=
sizeof
(
DWORD
);
RegQueryValueEx
(
key
,
"DefaultColor"
,
NULL
,
NULL
,
(
LPBYTE
)
&
value
,
&
size
);
}
else
if
(
type
==
REG_SZ
)
{
size
=
sizeof
(
strvalue
);
RegQueryValueEx
(
key
,
"DefaultColor"
,
NULL
,
NULL
,
(
LPBYTE
)
strvalue
,
&
size
);
value
=
strtoul
(
strvalue
,
NULL
,
10
);
}
}
}
if
(
value
==
0
&&
RegOpenKeyEx
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Command Processor"
,
0
,
KEY_READ
,
&
key
)
==
ERROR_SUCCESS
)
{
char
strvalue
[
4
];
/* See if DWORD or REG_SZ */
if
(
RegQueryValueEx
(
key
,
"DefaultColor"
,
NULL
,
&
type
,
NULL
,
NULL
)
==
ERROR_SUCCESS
)
{
if
(
type
==
REG_DWORD
)
{
size
=
sizeof
(
DWORD
);
RegQueryValueEx
(
key
,
"DefaultColor"
,
NULL
,
NULL
,
(
LPBYTE
)
&
value
,
&
size
);
}
else
if
(
type
==
REG_SZ
)
{
size
=
sizeof
(
strvalue
);
RegQueryValueEx
(
key
,
"DefaultColor"
,
NULL
,
NULL
,
(
LPBYTE
)
strvalue
,
&
size
);
value
=
strtoul
(
strvalue
,
NULL
,
10
);
}
}
}
/* If one found, set the screen to that colour */
if
(
!
(((
value
&
0xF0
)
>>
4
)
==
(
value
&
0x0F
)))
{
defaultColor
=
value
&
0xFF
;
param1
[
0
]
=
0x00
;
WCMD_color
();
}
}
if
(
opt_k
)
{
...
...
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