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
8c64ebc9
Commit
8c64ebc9
authored
Jul 12, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up CURSORICON_Load.
parent
4b9f3728
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
45 deletions
+39
-45
cursoricon.c
dlls/user/cursoricon.c
+39
-45
No files found.
dlls/user/cursoricon.c
View file @
8c64ebc9
...
...
@@ -919,69 +919,63 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
{
HANDLE
handle
=
0
;
HICON
hIcon
=
0
;
HRSRC
hRsrc
;
HRSRC
hRsrc
,
hGroupRsrc
;
CURSORICONDIR
*
dir
;
CURSORICONDIRENTRY
*
dirEntry
;
LPBYTE
bits
;
WORD
wResId
;
DWORD
dwBytesInRes
;
if
(
loadflags
&
LR_LOADFROMFILE
)
/* Load from file */
{
hIcon
=
CURSORICON_LoadFromFile
(
name
,
width
,
height
,
colors
,
fCursor
,
loadflags
);
}
else
/* Load from resource */
{
HRSRC
hGroupRsrc
;
WORD
wResId
;
DWORD
dwBytesInRes
;
return
CURSORICON_LoadFromFile
(
name
,
width
,
height
,
colors
,
fCursor
,
loadflags
);
if
(
!
hInstance
)
hInstance
=
user32_module
;
/* Load OEM cursor/icon */
if
(
!
hInstance
)
hInstance
=
user32_module
;
/* Load OEM cursor/icon */
/* Normalize hInstance (must be uniquely represented for icon cache) */
/* Normalize hInstance (must be uniquely represented for icon cache) */
if
(
!
HIWORD
(
hInstance
))
hInstance
=
HINSTANCE_32
(
GetExePtr
(
HINSTANCE_16
(
hInstance
)
));
if
(
!
HIWORD
(
hInstance
))
hInstance
=
HINSTANCE_32
(
GetExePtr
(
HINSTANCE_16
(
hInstance
)
));
/* Get directory resource ID */
/* Get directory resource ID */
if
(
!
(
hRsrc
=
FindResourceW
(
hInstance
,
name
,
(
LPWSTR
)(
fCursor
?
RT_GROUP_CURSOR
:
RT_GROUP_ICON
)
)))
return
0
;
hGroupRsrc
=
hRsrc
;
if
(
!
(
hRsrc
=
FindResourceW
(
hInstance
,
name
,
(
LPWSTR
)(
fCursor
?
RT_GROUP_CURSOR
:
RT_GROUP_ICON
)
)))
return
0
;
hGroupRsrc
=
hRsrc
;
/* Find the best entry in the directory */
/* Find the best entry in the directory */
if
(
!
(
handle
=
LoadResource
(
hInstance
,
hRsrc
)))
return
0
;
if
(
!
(
dir
=
(
CURSORICONDIR
*
)
LockResource
(
handle
)))
return
0
;
if
(
fCursor
)
dirEntry
=
CURSORICON_FindBestCursorRes
(
dir
,
width
,
height
,
1
);
else
dirEntry
=
CURSORICON_FindBestIconRes
(
dir
,
width
,
height
,
colors
);
if
(
!
dirEntry
)
return
0
;
wResId
=
dirEntry
->
wResId
;
dwBytesInRes
=
dirEntry
->
dwBytesInRes
;
FreeResource
(
handle
);
if
(
!
(
handle
=
LoadResource
(
hInstance
,
hRsrc
)))
return
0
;
if
(
!
(
dir
=
(
CURSORICONDIR
*
)
LockResource
(
handle
)))
return
0
;
if
(
fCursor
)
dirEntry
=
CURSORICON_FindBestCursorRes
(
dir
,
width
,
height
,
1
);
else
dirEntry
=
CURSORICON_FindBestIconRes
(
dir
,
width
,
height
,
colors
);
if
(
!
dirEntry
)
return
0
;
wResId
=
dirEntry
->
wResId
;
dwBytesInRes
=
dirEntry
->
dwBytesInRes
;
FreeResource
(
handle
);
/* Load the resource */
/* Load the resource */
if
(
!
(
hRsrc
=
FindResourceW
(
hInstance
,
MAKEINTRESOURCEW
(
wResId
),
(
LPWSTR
)(
fCursor
?
RT_CURSOR
:
RT_ICON
)
)))
return
0
;
if
(
!
(
hRsrc
=
FindResourceW
(
hInstance
,
MAKEINTRESOURCEW
(
wResId
),
(
LPWSTR
)(
fCursor
?
RT_CURSOR
:
RT_ICON
)
)))
return
0
;
/* If shared icon, check whether it was already loaded */
if
(
(
loadflags
&
LR_SHARED
)
&&
(
hIcon
=
CURSORICON_FindSharedIcon
(
hInstance
,
hRsrc
)
)
!=
0
)
return
hIcon
;
/* If shared icon, check whether it was already loaded */
if
(
(
loadflags
&
LR_SHARED
)
&&
(
hIcon
=
CURSORICON_FindSharedIcon
(
hInstance
,
hRsrc
)
)
!=
0
)
return
hIcon
;
if
(
!
(
handle
=
LoadResource
(
hInstance
,
hRsrc
)))
return
0
;
bits
=
(
LPBYTE
)
LockResource
(
handle
);
hIcon
=
CreateIconFromResourceEx
(
bits
,
dwBytesInRes
,
!
fCursor
,
0x00030000
,
width
,
height
,
loadflags
);
FreeResource
(
handle
);
if
(
!
(
handle
=
LoadResource
(
hInstance
,
hRsrc
)))
return
0
;
bits
=
(
LPBYTE
)
LockResource
(
handle
);
hIcon
=
CreateIconFromResourceEx
(
bits
,
dwBytesInRes
,
!
fCursor
,
0x00030000
,
width
,
height
,
loadflags
);
FreeResource
(
handle
);
/* If shared icon, add to icon cache */
/* If shared icon, add to icon cache */
if
(
hIcon
&&
(
loadflags
&
LR_SHARED
)
)
CURSORICON_AddSharedIcon
(
hInstance
,
hRsrc
,
hGroupRsrc
,
hIcon
);
}
if
(
hIcon
&&
(
loadflags
&
LR_SHARED
)
)
CURSORICON_AddSharedIcon
(
hInstance
,
hRsrc
,
hGroupRsrc
,
hIcon
);
return
hIcon
;
}
...
...
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