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
b96ab35c
Commit
b96ab35c
authored
Dec 28, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Move loading of static icons for 16-bit windows to the 16-bit wrapper.
parent
fadc2cda
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
72 deletions
+68
-72
message.c
dlls/user.exe16/message.c
+27
-0
static.c
dlls/user32/static.c
+41
-72
No files found.
dlls/user.exe16/message.c
View file @
b96ab35c
...
...
@@ -2594,6 +2594,33 @@ static LRESULT static_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
{
switch
(
msg
)
{
case
WM_NCCREATE
:
{
CREATESTRUCTA
*
cs
=
(
CREATESTRUCTA
*
)
lParam
;
LRESULT
ret
=
wow_handlers32
.
static_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
if
(
!
ret
)
return
0
;
if
(((
ULONG_PTR
)
cs
->
hInstance
>>
16
))
return
ret
;
/* 32-bit instance, nothing to do */
switch
(
cs
->
style
&
SS_TYPEMASK
)
{
case
SS_ICON
:
{
HICON16
icon
=
LoadIcon16
(
HINSTANCE_16
(
cs
->
hInstance
),
cs
->
lpszName
);
if
(
!
icon
)
icon
=
LoadCursor16
(
HINSTANCE_16
(
cs
->
hInstance
),
cs
->
lpszName
);
if
(
icon
)
wow_handlers32
.
static_proc
(
hwnd
,
STM_SETIMAGE
,
IMAGE_ICON
,
(
LPARAM
)
HICON_32
(
icon
),
FALSE
);
break
;
}
case
SS_BITMAP
:
{
HBITMAP16
bitmap
=
LoadBitmap16
(
HINSTANCE_16
(
cs
->
hInstance
),
cs
->
lpszName
);
if
(
bitmap
)
wow_handlers32
.
static_proc
(
hwnd
,
STM_SETIMAGE
,
IMAGE_BITMAP
,
(
LPARAM
)
HBITMAP_32
(
bitmap
),
FALSE
);
break
;
}
}
return
ret
;
}
case
STM_SETICON16
:
wParam
=
(
WPARAM
)
HICON_32
(
(
HICON16
)
wParam
);
return
wow_handlers32
.
static_proc
(
hwnd
,
STM_SETICON
,
wParam
,
lParam
,
FALSE
);
...
...
dlls/user32/static.c
View file @
b96ab35c
...
...
@@ -256,23 +256,25 @@ static HANDLE STATIC_GetImage( HWND hwnd, WPARAM wParam, DWORD style )
*
* Load the icon for an SS_ICON control.
*/
static
HICON
STATIC_LoadIconA
(
H
WND
hwnd
,
LPCSTR
name
,
DWORD
style
)
static
HICON
STATIC_LoadIconA
(
H
INSTANCE
hInstance
,
LPCSTR
name
,
DWORD
style
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLongPtrW
(
hwnd
,
GWLP_HINSTANCE
);
if
((
style
&
SS_REALSIZEIMAGE
)
!=
0
)
{
return
LoadImageA
(
hInstance
,
name
,
IMAGE_ICON
,
0
,
0
,
LR_SHARED
);
}
else
HICON
hicon
;
if
(
hInstance
&&
((
ULONG_PTR
)
hInstance
>>
16
))
{
HICON
hicon
=
LoadIconA
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadCursorA
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadIconA
(
0
,
name
);
/* Windows doesn't try to load a standard cursor,
probably because most IDs for standard cursors conflict
with the IDs for standard icons anyway */
return
hicon
;
if
((
style
&
SS_REALSIZEIMAGE
)
!=
0
)
hicon
=
LoadImageA
(
hInstance
,
name
,
IMAGE_ICON
,
0
,
0
,
LR_SHARED
);
else
{
hicon
=
LoadIconA
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadCursorA
(
hInstance
,
name
);
}
}
if
(
!
hicon
)
hicon
=
LoadIconA
(
0
,
name
);
/* Windows doesn't try to load a standard cursor,
probably because most IDs for standard cursors conflict
with the IDs for standard icons anyway */
return
hicon
;
}
/***********************************************************************
...
...
@@ -280,47 +282,25 @@ static HICON STATIC_LoadIconA( HWND hwnd, LPCSTR name, DWORD style )
*
* Load the icon for an SS_ICON control.
*/
static
HICON
STATIC_LoadIconW
(
H
WND
hwnd
,
LPCWSTR
name
,
DWORD
style
)
static
HICON
STATIC_LoadIconW
(
H
INSTANCE
hInstance
,
LPCWSTR
name
,
DWORD
style
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLongPtrW
(
hwnd
,
GWLP_HINSTANCE
);
if
((
style
&
SS_REALSIZEIMAGE
)
!=
0
)
{
return
LoadImageW
(
hInstance
,
name
,
IMAGE_ICON
,
0
,
0
,
LR_SHARED
);
}
else
HICON
hicon
;
if
(
hInstance
&&
((
ULONG_PTR
)
hInstance
>>
16
))
{
HICON
hicon
=
LoadIconW
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadCursorW
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadIconW
(
0
,
name
);
/* Windows doesn't try to load a standard cursor,
probably because most IDs for standard cursors conflict
with the IDs for standard icons anyway */
return
hicon
;
if
((
style
&
SS_REALSIZEIMAGE
)
!=
0
)
hicon
=
LoadImageW
(
hInstance
,
name
,
IMAGE_ICON
,
0
,
0
,
LR_SHARED
);
else
{
hicon
=
LoadIconW
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadCursorW
(
hInstance
,
name
);
}
}
}
/***********************************************************************
* STATIC_LoadBitmapA
*
* Load the bitmap for an SS_BITMAP control.
*/
static
HBITMAP
STATIC_LoadBitmapA
(
HWND
hwnd
,
LPCSTR
name
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLongPtrW
(
hwnd
,
GWLP_HINSTANCE
);
/* Windows doesn't try to load OEM Bitmaps (hInstance == NULL) */
return
LoadBitmapA
(
hInstance
,
name
);
}
/***********************************************************************
* STATIC_LoadBitmapW
*
* Load the bitmap for an SS_BITMAP control.
*/
static
HBITMAP
STATIC_LoadBitmapW
(
HWND
hwnd
,
LPCWSTR
name
)
{
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLongPtrW
(
hwnd
,
GWLP_HINSTANCE
);
/* Windows doesn't try to load OEM Bitmaps (hInstance == NULL) */
return
LoadBitmapW
(
hInstance
,
name
);
if
(
!
hicon
)
hicon
=
LoadIconW
(
0
,
name
);
/* Windows doesn't try to load a standard cursor,
probably because most IDs for standard cursors conflict
with the IDs for standard icons anyway */
return
hicon
;
}
/***********************************************************************
...
...
@@ -471,42 +451,31 @@ LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
case
WM_NCCREATE
:
{
LPCSTR
textA
;
LPCWSTR
textW
;
CREATESTRUCTW
*
cs
=
(
CREATESTRUCTW
*
)
lParam
;
if
(
full_style
&
SS_SUNKEN
)
SetWindowLongW
(
hwnd
,
GWL_EXSTYLE
,
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
)
|
WS_EX_STATICEDGE
);
if
(
unicode
)
{
textA
=
NULL
;
textW
=
((
LPCREATESTRUCTW
)
lParam
)
->
lpszName
;
}
else
{
textA
=
((
LPCREATESTRUCTA
)
lParam
)
->
lpszName
;
textW
=
NULL
;
}
switch
(
style
)
{
case
SS_ICON
:
{
HICON
hIcon
;
if
(
unicode
)
hIcon
=
STATIC_LoadIconW
(
hwnd
,
textW
,
full_style
);
if
(
unicode
||
IS_INTRESOURCE
(
cs
->
lpszName
)
)
hIcon
=
STATIC_LoadIconW
(
cs
->
hInstance
,
cs
->
lpszName
,
full_style
);
else
hIcon
=
STATIC_LoadIconA
(
hwnd
,
textA
,
full_style
);
hIcon
=
STATIC_LoadIconA
(
cs
->
hInstance
,
(
LPCSTR
)
cs
->
lpszName
,
full_style
);
STATIC_SetIcon
(
hwnd
,
hIcon
,
full_style
);
}
break
;
case
SS_BITMAP
:
if
((
ULONG_PTR
)
cs
->
hInstance
>>
16
)
{
HBITMAP
hBitmap
;
if
(
unicode
)
hBitmap
=
STATIC_LoadBitmapW
(
hwnd
,
textW
);
if
(
unicode
||
IS_INTRESOURCE
(
cs
->
lpszName
)
)
hBitmap
=
LoadBitmapW
(
cs
->
hInstance
,
cs
->
lpszName
);
else
hBitmap
=
STATIC_LoadBitmapA
(
hwnd
,
textA
);
hBitmap
=
LoadBitmapA
(
cs
->
hInstance
,
(
LPCSTR
)
cs
->
lpszName
);
STATIC_SetBitmap
(
hwnd
,
hBitmap
,
full_style
);
}
break
;
...
...
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