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
73ee2a8b
Commit
73ee2a8b
authored
Feb 16, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Select text control content while setting dialog focus.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
09b14675
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
dialog.c
dlls/user32/dialog.c
+4
-0
dialog.c
dlls/user32/tests/dialog.c
+30
-1
resource.rc
dlls/user32/tests/resource.rc
+8
-0
No files found.
dlls/user32/dialog.c
View file @
73ee2a8b
...
...
@@ -707,7 +707,11 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
focus
=
GetNextDlgTabItem
(
hwnd
,
0
,
FALSE
);
if
(
!
focus
)
focus
=
GetNextDlgGroupItem
(
hwnd
,
0
,
FALSE
);
if
(
focus
)
{
if
(
SendMessageW
(
focus
,
WM_GETDLGCODE
,
0
,
0
)
&
DLGC_HASSETSEL
)
SendMessageW
(
focus
,
EM_SETSEL
,
0
,
MAXLONG
);
SetFocus
(
focus
);
}
}
}
...
...
dlls/user32/tests/dialog.c
View file @
73ee2a8b
...
...
@@ -786,7 +786,8 @@ static INT_PTR CALLBACK focusDlgWinProc (HWND hDlg, UINT uiMsg, WPARAM wParam,
switch
(
uiMsg
)
{
case
WM_INITDIALOG
:
return
TRUE
;
SetWindowTextA
(
GetDlgItem
(
hDlg
,
200
),
"new caption"
);
return
TRUE
;
case
WM_COMMAND
:
if
(
LOWORD
(
wParam
)
==
200
)
...
...
@@ -958,6 +959,34 @@ static void test_focus(void)
DestroyWindow
(
hDlg
);
}
/* Test 5:
* Select textbox's text on creation */
{
HWND
hDlg
;
HRSRC
hResource
;
HANDLE
hTemplate
;
DLGTEMPLATE
*
pTemplate
;
HWND
edit
;
DWORD
selectionStart
=
0xdead
,
selectionEnd
=
0xbeef
;
hResource
=
FindResourceA
(
g_hinst
,
"FOCUS_TEST_DIALOG_3"
,
(
LPCSTR
)
RT_DIALOG
);
hTemplate
=
LoadResource
(
g_hinst
,
hResource
);
pTemplate
=
LockResource
(
hTemplate
);
hDlg
=
CreateDialogIndirectParamA
(
g_hinst
,
pTemplate
,
NULL
,
focusDlgWinProc
,
0
);
ok
(
hDlg
!=
0
,
"Failed to create test dialog.
\n
"
);
edit
=
GetDlgItem
(
hDlg
,
200
);
ok
(
GetFocus
()
==
edit
,
"Focus not set to edit, focus=%p, dialog=%p, edit=%p
\n
"
,
GetFocus
(),
hDlg
,
edit
);
SendMessageA
(
edit
,
EM_GETSEL
,
(
WPARAM
)
&
selectionStart
,
(
LPARAM
)
&
selectionEnd
);
ok
(
selectionStart
==
0
&&
selectionEnd
==
11
,
"Text selection after WM_SETFOCUS is [%i, %i) expected [0, 11)
\n
"
,
selectionStart
,
selectionEnd
);
DestroyWindow
(
hDlg
);
}
}
static
void
test_GetDlgItemText
(
void
)
...
...
dlls/user32/tests/resource.rc
View file @
73ee2a8b
...
...
@@ -107,6 +107,14 @@ FONT 8, "MS Shell Dlg"
LTEXT "Hello world", 200,4,4,50,14
}
FOCUS_TEST_DIALOG_3 DIALOG 0, 0, 60, 30
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Test dialog"
FONT 8, "MS Shell Dlg"
{
EDITTEXT 200,4,4,50,14
}
IDD_DIALOG DIALOG 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
...
...
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