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
3e76f88d
Commit
3e76f88d
authored
Oct 07, 2009
by
Rein Klazes
Committed by
Alexandre Julliard
Oct 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Make explorer type file dialogs without custom template or hook proc resizable.
parent
21589993
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
filedlg.c
dlls/comdlg32/filedlg.c
+7
-0
filedlg.c
dlls/comdlg32/tests/filedlg.c
+47
-0
No files found.
dlls/comdlg32/filedlg.c
View file @
3e76f88d
...
...
@@ -271,6 +271,13 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
return
FALSE
;
}
/* msdn: explorer style dialogs permit sizing by default.
* The OFN_ENABLESIZING flag is only needed when a hook or
* custom tmeplate is provided */
if
(
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_EXPLORER
)
&&
!
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_ENABLEHOOK
|
OFN_ENABLETEMPLATE
|
OFN_ENABLETEMPLATEHANDLE
)))
fodInfos
->
ofnInfos
->
Flags
|=
OFN_ENABLESIZING
;
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
{
((
LPDLGTEMPLATEW
)
template
)
->
style
|=
WS_SIZEBOX
;
...
...
dlls/comdlg32/tests/filedlg.c
View file @
3e76f88d
...
...
@@ -29,6 +29,8 @@
/* ##### */
static
int
resizesupported
=
TRUE
;
static
void
toolbarcheck
(
HWND
hDlg
)
{
/* test toolbar properties */
...
...
@@ -349,6 +351,7 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
if
(
resize_testcases
[
index
].
flags
&
OFN_ENABLESIZING
)
if
(
!
(
style
&
WS_SIZEBOX
))
{
win_skip
(
"OFN_ENABLESIZING flag not supported.
\n
"
);
resizesupported
=
FALSE
;
PostMessage
(
parent
,
WM_COMMAND
,
IDCANCEL
,
0
);
}
else
ok
(
style
&
WS_SIZEBOX
,
...
...
@@ -934,6 +937,49 @@ static void test_getfolderpath(void)
CommDlgExtendedError
());
}
static
void
test_resizable2
(
void
)
{
OPENFILENAMEA
ofn
=
{
0
};
char
filename
[
1024
]
=
"pls press Enter if sizable, Esc otherwise"
;
DWORD
ret
;
/* interactive because there is no hook function */
if
(
!
winetest_interactive
)
{
skip
(
"some interactive resizable dialog tests (set WINETEST_INTERACTIVE=1)
\n
"
);
return
;
}
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
lpstrFile
=
filename
;
ofn
.
nMaxFile
=
1024
;
ofn
.
lpfnHook
=
NULL
;
ofn
.
hInstance
=
GetModuleHandleA
(
NULL
);
ofn
.
lpTemplateName
=
"template1"
;
ofn
.
Flags
=
OFN_EXPLORER
;
#define ISSIZABLE 1
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
==
ISSIZABLE
,
"File Dialog should have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_ENABLETEMPLATE
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
!=
ISSIZABLE
,
"File Dialog should NOT have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_ENABLETEMPLATEHANDLE
;
ofn
.
hInstance
=
LoadResource
(
GetModuleHandle
(
NULL
),
FindResource
(
GetModuleHandle
(
NULL
),
"template1"
,
(
LPSTR
)
RT_DIALOG
));
ofn
.
lpTemplateName
=
NULL
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
!=
ISSIZABLE
,
"File Dialog should NOT have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_ENABLEHOOK
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
!=
ISSIZABLE
,
"File Dialog should NOT have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
#undef ISSIZABLE
}
START_TEST
(
filedlg
)
{
test_DialogCancel
();
...
...
@@ -943,4 +989,5 @@ START_TEST(filedlg)
test_resize
();
test_ok
();
test_getfolderpath
();
if
(
resizesupported
)
test_resizable2
();
}
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