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
9ee82b94
Commit
9ee82b94
authored
May 07, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/msgbox: Fix static control id.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
36b7d6f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
5 deletions
+44
-5
msgbox.c
dlls/user32/msgbox.c
+1
-4
resources.h
dlls/user32/resources.h
+1
-1
dialog.c
dlls/user32/tests/dialog.c
+42
-0
No files found.
dlls/user32/msgbox.c
View file @
9ee82b94
...
...
@@ -28,15 +28,12 @@
#include "winternl.h"
#include "dlgs.h"
#include "user_private.h"
#include "resources.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dialog
);
WINE_DECLARE_DEBUG_CHANNEL
(
msgbox
);
#define MSGBOX_IDICON stc1
#define MSGBOX_IDTEXT 100
#define IDS_ERROR 2
struct
ThreadWindows
{
UINT
numHandles
;
...
...
dlls/user32/resources.h
View file @
9ee82b94
...
...
@@ -26,5 +26,5 @@
#define MDI_IDC_LISTBOX 100
#define IDS_MDI_MOREWINDOWS 13
#define MSGBOX_IDICON stc1
#define MSGBOX_IDTEXT
100
#define MSGBOX_IDTEXT
0xffff
#define IDS_ERROR 2
dlls/user32/tests/dialog.c
View file @
9ee82b94
...
...
@@ -1522,6 +1522,47 @@ static void test_timer_message(void)
DialogBoxA
(
g_hinst
,
"RADIO_TEST_DIALOG"
,
NULL
,
timer_message_dlg_proc
);
}
static
LRESULT
CALLBACK
msgbox_hook_proc
(
INT
code
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
code
==
HCBT_ACTIVATE
)
{
HWND
msgbox
=
(
HWND
)
wParam
,
msghwnd
;
char
text
[
64
];
if
(
msgbox
)
{
text
[
0
]
=
0
;
GetWindowTextA
(
msgbox
,
text
,
sizeof
(
text
));
ok
(
!
strcmp
(
text
,
"MSGBOX caption"
),
"Unexpected window text
\"
%s
\"\n
"
,
text
);
msghwnd
=
GetDlgItem
(
msgbox
,
0xffff
);
ok
(
msghwnd
!=
NULL
,
"Expected static control
\n
"
);
text
[
0
]
=
0
;
GetWindowTextA
(
msghwnd
,
text
,
sizeof
(
text
));
ok
(
!
strcmp
(
text
,
"Text"
),
"Unexpected window text
\"
%s
\"\n
"
,
text
);
SendDlgItemMessageA
(
msgbox
,
IDCANCEL
,
WM_LBUTTONDOWN
,
0
,
0
);
SendDlgItemMessageA
(
msgbox
,
IDCANCEL
,
WM_LBUTTONUP
,
0
,
0
);
}
}
return
CallNextHookEx
(
NULL
,
code
,
wParam
,
lParam
);
}
static
void
test_MessageBox
(
void
)
{
HHOOK
hook
;
int
ret
;
hook
=
SetWindowsHookExA
(
WH_CBT
,
msgbox_hook_proc
,
NULL
,
GetCurrentThreadId
());
ret
=
MessageBoxA
(
NULL
,
"Text"
,
"MSGBOX caption"
,
MB_OKCANCEL
);
ok
(
ret
==
IDCANCEL
,
"got %d
\n
"
,
ret
);
UnhookWindowsHookEx
(
hook
);
}
START_TEST
(
dialog
)
{
g_hinst
=
GetModuleHandleA
(
0
);
...
...
@@ -1539,4 +1580,5 @@ START_TEST(dialog)
test_MessageBoxFontTest
();
test_SaveRestoreFocus
();
test_timer_message
();
test_MessageBox
();
}
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