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
17096364
Commit
17096364
authored
Oct 14, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Add a basic test for IShellView2_CreateViewWindow2.
parent
abb7f92b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
1 deletion
+91
-1
filedlg.c
dlls/comdlg32/tests/filedlg.c
+91
-1
No files found.
dlls/comdlg32/tests/filedlg.c
View file @
17096364
...
...
@@ -22,6 +22,10 @@
#include <windows.h>
#include <wine/test.h>
#include "initguid.h"
#include "shlguid.h"
#define COBJMACROS
#include "shobjidl.h"
/* ##### */
...
...
@@ -131,9 +135,95 @@ static void test_DialogCancel(void)
}
}
static
UINT
CALLBACK
create_view_window2_hook
(
HWND
dlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
msg
==
WM_NOTIFY
)
{
if
(((
LPNMHDR
)
lParam
)
->
code
==
CDN_FOLDERCHANGE
)
{
IShellBrowser
*
shell_browser
=
(
IShellBrowser
*
)
SendMessage
(
GetParent
(
dlg
),
WM_USER
+
7
/* WM_GETISHELLBROWSER */
,
0
,
0
);
IShellView
*
shell_view
=
NULL
;
IShellView2
*
shell_view2
=
NULL
;
SV2CVW2_PARAMS
view_params
;
FOLDERSETTINGS
folder_settings
;
HRESULT
hr
;
RECT
rect
=
{
0
,
0
,
0
,
0
};
hr
=
IShellBrowser_QueryActiveShellView
(
shell_browser
,
&
shell_view
);
ok
(
SUCCEEDED
(
hr
),
"QueryActiveShellView returned %#x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView_QueryInterface
(
shell_view
,
&
IID_IShellView2
,
(
void
**
)
&
shell_view2
);
if
(
hr
==
E_NOINTERFACE
)
{
skip
(
"IShellView2 not supported
\n
"
);
goto
cleanup
;
}
ok
(
SUCCEEDED
(
hr
),
"QueryInterface returned %#x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView2_DestroyViewWindow
(
shell_view2
);
ok
(
SUCCEEDED
(
hr
),
"DestroyViewWindow returned %#x
\n
"
,
hr
);
folder_settings
.
ViewMode
=
FVM_LIST
;
folder_settings
.
fFlags
=
0
;
view_params
.
cbSize
=
sizeof
(
view_params
);
view_params
.
psvPrev
=
NULL
;
view_params
.
pfs
=
&
folder_settings
;
view_params
.
psbOwner
=
shell_browser
;
view_params
.
prcView
=
&
rect
;
view_params
.
pvid
=
NULL
;
view_params
.
hwndView
=
NULL
;
hr
=
IShellView2_CreateViewWindow2
(
shell_view2
,
&
view_params
);
ok
(
SUCCEEDED
(
hr
),
"CreateViewWindow2 returned %#x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView2_GetCurrentInfo
(
shell_view2
,
&
folder_settings
);
ok
(
SUCCEEDED
(
hr
),
"GetCurrentInfo returned %#x
\n
"
,
hr
);
ok
(
folder_settings
.
ViewMode
==
FVM_LIST
,
"view mode is %d, expected %d
\n
"
,
folder_settings
.
ViewMode
,
FVM_LIST
);
hr
=
IShellView2_DestroyViewWindow
(
shell_view2
);
ok
(
SUCCEEDED
(
hr
),
"DestroyViewWindow returned %#x
\n
"
,
hr
);
view_params
.
pvid
=
&
VID_Details
;
hr
=
IShellView2_CreateViewWindow2
(
shell_view2
,
&
view_params
);
ok
(
SUCCEEDED
(
hr
),
"CreateViewWindow2 returned %#x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView2_GetCurrentInfo
(
shell_view2
,
&
folder_settings
);
ok
(
SUCCEEDED
(
hr
),
"GetCurrentInfo returned %#x
\n
"
,
hr
);
ok
(
folder_settings
.
ViewMode
==
FVM_DETAILS
,
"view mode is %d, expected %d
\n
"
,
folder_settings
.
ViewMode
,
FVM_DETAILS
);
cleanup:
if
(
shell_view2
)
IShellView2_Release
(
shell_view2
);
if
(
shell_view
)
IShellView_Release
(
shell_view
);
PostMessage
(
GetParent
(
dlg
),
WM_COMMAND
,
IDCANCEL
,
0
);
}
}
return
0
;
}
static
void
test_create_view_window2
(
void
)
{
OPENFILENAMEA
ofn
=
{
0
};
char
filename
[
1024
]
=
{
0
};
DWORD
ret
;
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
lpstrFile
=
filename
;
ofn
.
nMaxFile
=
1042
;
ofn
.
lpfnHook
=
create_view_window2_hook
;
ofn
.
Flags
=
OFN_ENABLEHOOK
|
OFN_EXPLORER
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
}
START_TEST
(
filedlg
)
{
test_DialogCancel
();
test_create_view_window2
();
}
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