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
3d4db9f2
Commit
3d4db9f2
authored
Oct 12, 2012
by
Sergey Guralnik
Committed by
Alexandre Julliard
Oct 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add internal class small icons.
parent
06d284ca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
class.c
dlls/user32/class.c
+29
-3
class.c
dlls/user32/tests/class.c
+0
-5
No files found.
dlls/user32/class.c
View file @
3d4db9f2
...
...
@@ -56,6 +56,7 @@ typedef struct tagCLASS
HINSTANCE
hInstance
;
/* Module that created the task */
HICON
hIcon
;
/* Default icon */
HICON
hIconSm
;
/* Default small icon */
HICON
hIconSmIntern
;
/* Internal small icon, derived from hIcon */
HCURSOR
hCursor
;
/* Default cursor */
HBRUSH
hbrBackground
;
/* Default background */
ATOM
atomName
;
/* Name of the class */
...
...
@@ -518,6 +519,10 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
classPtr
->
hIcon
=
wc
->
hIcon
;
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hIconSmIntern
=
wc
->
hIcon
&&
!
wc
->
hIconSm
?
CopyImage
(
wc
->
hIcon
,
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
0
)
:
NULL
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
winproc
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
FALSE
);
...
...
@@ -556,6 +561,10 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
classPtr
->
hIcon
=
wc
->
hIcon
;
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hIconSmIntern
=
wc
->
hIcon
&&
!
wc
->
hIconSm
?
CopyImage
(
wc
->
hIcon
,
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
0
)
:
NULL
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
winproc
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
TRUE
);
...
...
@@ -741,7 +750,7 @@ static ULONG_PTR CLASS_GetClassLong( HWND hwnd, INT offset, UINT size,
retvalue
=
(
ULONG_PTR
)
class
->
hIcon
;
break
;
case
GCLP_HICONSM
:
retvalue
=
(
ULONG_PTR
)
class
->
hIconSm
;
retvalue
=
(
ULONG_PTR
)
(
class
->
hIconSm
?
class
->
hIconSm
:
class
->
hIconSmIntern
)
;
break
;
case
GCL_STYLE
:
retvalue
=
class
->
style
;
...
...
@@ -884,10 +893,27 @@ static ULONG_PTR CLASS_SetClassLong( HWND hwnd, INT offset, LONG_PTR newval,
break
;
case
GCLP_HICON
:
retval
=
(
ULONG_PTR
)
class
->
hIcon
;
if
(
retval
&&
class
->
hIconSmIntern
)
{
DestroyIcon
(
class
->
hIconSmIntern
);
class
->
hIconSmIntern
=
NULL
;
}
if
(
newval
&&
!
class
->
hIconSm
)
class
->
hIconSmIntern
=
CopyImage
(
(
HICON
)
newval
,
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
0
);
class
->
hIcon
=
(
HICON
)
newval
;
break
;
case
GCLP_HICONSM
:
retval
=
(
ULONG_PTR
)
class
->
hIconSm
;
if
(
retval
&&
!
newval
)
class
->
hIconSmIntern
=
class
->
hIcon
?
CopyImage
(
class
->
hIcon
,
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
0
)
:
NULL
;
else
if
(
!
retval
&&
newval
&&
class
->
hIconSmIntern
)
{
DestroyIcon
(
class
->
hIconSmIntern
);
class
->
hIconSmIntern
=
NULL
;
}
class
->
hIconSm
=
(
HICON
)
newval
;
break
;
case
GCL_STYLE
:
...
...
@@ -1099,7 +1125,7 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, WNDCLASSEXA *wc )
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
wc
->
hIcon
=
classPtr
->
hIcon
;
wc
->
hIconSm
=
classPtr
->
hIconSm
;
wc
->
hIconSm
=
classPtr
->
hIconSm
?
classPtr
->
hIconSm
:
classPtr
->
hIconSmIntern
;
wc
->
hCursor
=
classPtr
->
hCursor
;
wc
->
hbrBackground
=
classPtr
->
hbrBackground
;
wc
->
lpszMenuName
=
CLASS_GetMenuNameA
(
classPtr
);
...
...
@@ -1141,7 +1167,7 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, WNDCLASSEXW *wc
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
wc
->
hIcon
=
classPtr
->
hIcon
;
wc
->
hIconSm
=
classPtr
->
hIconSm
;
wc
->
hIconSm
=
classPtr
->
hIconSm
?
classPtr
->
hIconSm
:
classPtr
->
hIconSmIntern
;
wc
->
hCursor
=
classPtr
->
hCursor
;
wc
->
hbrBackground
=
classPtr
->
hbrBackground
;
wc
->
lpszMenuName
=
CLASS_GetMenuNameW
(
classPtr
);
...
...
dlls/user32/tests/class.c
View file @
3d4db9f2
...
...
@@ -999,11 +999,9 @@ static void test_icons(void)
ok
(
GetClassInfoExW
(
hinst
,
cls_name
,
&
ret_wcex
),
"Class info was not retrieved
\n
"
);
ok
(
wcex
.
hIcon
==
ret_wcex
.
hIcon
,
"Icons don't match
\n
"
);
todo_wine
ok
(
ret_wcex
.
hIconSm
!=
NULL
,
"hIconSm should be non-zero handle
\n
"
);
hsmicon
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
);
todo_wine
ok
(
hsmicon
!=
NULL
,
"GetClassLong should return non-zero handle
\n
"
);
hsmallnew
=
CopyImage
(
wcex
.
hIcon
,
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
...
...
@@ -1016,7 +1014,6 @@ todo_wine
SetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
,
0
);
hsmicon
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
);
todo_wine
ok
(
hsmicon
!=
NULL
,
"GetClassLong should return non-zero handle
\n
"
);
SetClassLongPtrW
(
hwnd
,
GCLP_HICON
,
0
);
...
...
@@ -1024,10 +1021,8 @@ todo_wine
SetClassLongPtrW
(
hwnd
,
GCLP_HICON
,
(
LONG_PTR
)
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_QUESTION
));
hsmicon
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
);
todo_wine
ok
(
hsmicon
!=
NULL
,
"GetClassLong should return non-zero handle
\n
"
);
UnregisterClassW
(
cls_name
,
hinst
);
todo_wine
ok
(
GetIconInfo
(
hsmicon
,
&
icinf
),
"Icon should NOT be destroyed
\n
"
);
DestroyIcon
(
hsmallnew
);
...
...
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