Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
21f01902
Commit
21f01902
authored
16 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
explorer: Retrieve the default desktop name from the startup parameters or the registry.
parent
eb7f5dd5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
programs/explorer/desktop.c
+31
-0
31 additions, 0 deletions
programs/explorer/desktop.c
with
31 additions
and
0 deletions
programs/explorer/desktop.c
+
31
−
0
View file @
21f01902
...
...
@@ -111,6 +111,33 @@ static BOOL parse_size( const WCHAR *size, unsigned int *width, unsigned int *he
return
!*
end
;
}
/* retrieve the desktop name to use if not specified on the command line */
static
const
WCHAR
*
get_default_desktop_name
(
void
)
{
static
const
WCHAR
desktopW
[]
=
{
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
0
};
static
const
WCHAR
defaultW
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
0
};
static
const
WCHAR
explorer_keyW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
0
};
static
WCHAR
buffer
[
MAX_PATH
];
DWORD
size
=
sizeof
(
buffer
);
HDESK
desk
=
GetThreadDesktop
(
GetCurrentThreadId
()
);
WCHAR
*
ret
=
NULL
;
HKEY
hkey
;
if
(
desk
&&
GetUserObjectInformationW
(
desk
,
UOI_NAME
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
),
NULL
))
{
if
(
strcmpiW
(
buffer
,
defaultW
))
return
buffer
;
}
/* @@ Wine registry key: HKCU\Software\Wine\Explorer */
if
(
!
RegOpenKeyW
(
HKEY_CURRENT_USER
,
explorer_keyW
,
&
hkey
))
{
if
(
!
RegQueryValueExW
(
hkey
,
desktopW
,
0
,
NULL
,
(
LPBYTE
)
buffer
,
&
size
))
ret
=
buffer
;
RegCloseKey
(
hkey
);
}
return
ret
;
}
/* retrieve the default desktop size from the registry */
static
BOOL
get_default_desktop_size
(
const
WCHAR
*
name
,
unsigned
int
*
width
,
unsigned
int
*
height
)
{
...
...
@@ -230,6 +257,10 @@ void manage_desktop( WCHAR *arg )
if
(
!
p
||
!
parse_size
(
p
,
&
width
,
&
height
))
get_default_desktop_size
(
name
,
&
width
,
&
height
);
}
else
if
((
name
=
get_default_desktop_name
()))
{
if
(
!
get_default_desktop_size
(
name
,
&
width
,
&
height
))
width
=
height
=
0
;
}
else
/* check for the X11 driver key for backwards compatibility (to be removed) */
{
static
const
WCHAR
desktopW
[]
=
{
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
0
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment