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
da257e33
Commit
da257e33
authored
Feb 15, 2009
by
Rein Klazes
Committed by
Alexandre Julliard
Feb 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Fix for owner draw statusbar.
Ownerdraw status bar should update on receiveing a SB_SETTEXT message, even if the 'text' parameter has not changed. Fix with conformance test.
parent
788add57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
status.c
dlls/comctl32/status.c
+0
-2
status.c
dlls/comctl32/tests/status.c
+50
-0
No files found.
dlls/comctl32/status.c
View file @
da257e33
...
@@ -759,8 +759,6 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
...
@@ -759,8 +759,6 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
if
(
style
&
SBT_OWNERDRAW
)
{
if
(
style
&
SBT_OWNERDRAW
)
{
if
(
!
(
oldStyle
&
SBT_OWNERDRAW
))
if
(
!
(
oldStyle
&
SBT_OWNERDRAW
))
Free
(
part
->
text
);
Free
(
part
->
text
);
else
if
(
part
->
text
==
text
)
return
TRUE
;
part
->
text
=
(
LPWSTR
)
text
;
part
->
text
=
(
LPWSTR
)
text
;
}
else
{
}
else
{
LPWSTR
ntext
;
LPWSTR
ntext
;
...
...
dlls/comctl32/tests/status.c
View file @
da257e33
...
@@ -42,6 +42,8 @@ static HWND g_hMainWnd;
...
@@ -42,6 +42,8 @@ static HWND g_hMainWnd;
static
int
g_wmsize_count
=
0
;
static
int
g_wmsize_count
=
0
;
static
DWORD
g_ysize
;
static
DWORD
g_ysize
;
static
DWORD
g_dpisize
;
static
DWORD
g_dpisize
;
static
int
g_wmdrawitm_ctr
;
static
WNDPROC
g_wndproc_saved
;
static
HWND
create_status_control
(
DWORD
style
,
DWORD
exstyle
)
static
HWND
create_status_control
(
DWORD
style
,
DWORD
exstyle
)
{
{
...
@@ -407,6 +409,53 @@ static void test_status_control(void)
...
@@ -407,6 +409,53 @@ static void test_status_control(void)
DestroyWindow
(
hWndStatus
);
DestroyWindow
(
hWndStatus
);
}
}
static
LRESULT
WINAPI
ownerdraw_test_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LRESULT
ret
;
if
(
msg
==
WM_DRAWITEM
)
g_wmdrawitm_ctr
++
;
ret
=
CallWindowProc
(
g_wndproc_saved
,
hwnd
,
msg
,
wParam
,
lParam
);
return
ret
;
}
static
void
test_status_ownerdraw
(
void
)
{
HWND
hWndStatus
;
int
r
;
const
char
*
statustext
=
"STATUS TEXT"
;
LONG
oldstyle
;
/* subclass the main window and make sure it is visible */
g_wndproc_saved
=
(
WNDPROC
)
SetWindowLongPtr
(
g_hMainWnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
ownerdraw_test_wndproc
);
ok
(
g_wndproc_saved
!=
0
,
"failed to set the WndProc
\n
"
);
SetWindowPos
(
g_hMainWnd
,
HWND_TOPMOST
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
);
oldstyle
=
GetWindowLong
(
g_hMainWnd
,
GWL_STYLE
);
SetWindowLong
(
g_hMainWnd
,
GWL_STYLE
,
oldstyle
|
WS_VISIBLE
);
/* create a status child window */
ok
((
hWndStatus
=
CreateWindowA
(
SUBCLASS_NAME
,
""
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
100
,
100
,
g_hMainWnd
,
NULL
,
NULL
,
0
))
!=
NULL
,
"CreateWindowA failed
\n
"
);
/* set text */
g_wmdrawitm_ctr
=
0
;
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
0
,
(
LPARAM
)
statustext
);
ok
(
r
==
TRUE
,
"Sendmessage returned %d, expected 1
\n
"
,
r
);
ok
(
0
==
g_wmdrawitm_ctr
,
"got %d drawitem messages expected none
\n
"
,
g_wmdrawitm_ctr
);
/* set same text, with ownerdraw flag */
g_wmdrawitm_ctr
=
0
;
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
SBT_OWNERDRAW
,
(
LPARAM
)
statustext
);
ok
(
r
==
TRUE
,
"Sendmessage returned %d, expected 1
\n
"
,
r
);
ok
(
1
==
g_wmdrawitm_ctr
,
"got %d drawitem messages expected 1
\n
"
,
g_wmdrawitm_ctr
);
/* ;and again */
g_wmdrawitm_ctr
=
0
;
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
SBT_OWNERDRAW
,
(
LPARAM
)
statustext
);
ok
(
r
==
TRUE
,
"Sendmessage returned %d, expected 1
\n
"
,
r
);
ok
(
1
==
g_wmdrawitm_ctr
,
"got %d drawitem messages expected 1
\n
"
,
g_wmdrawitm_ctr
);
/* clean up */
DestroyWindow
(
hWndStatus
);
SetWindowLong
(
g_hMainWnd
,
GWL_STYLE
,
oldstyle
);
SetWindowLongPtr
(
g_hMainWnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
g_wndproc_saved
);
}
START_TEST
(
status
)
START_TEST
(
status
)
{
{
hinst
=
GetModuleHandleA
(
NULL
);
hinst
=
GetModuleHandleA
(
NULL
);
...
@@ -423,4 +472,5 @@ START_TEST(status)
...
@@ -423,4 +472,5 @@ START_TEST(status)
test_status_control
();
test_status_control
();
test_create
();
test_create
();
test_height
();
test_height
();
test_status_ownerdraw
();
}
}
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