14#define test_S_OK(hres, message) ok(hres == S_OK, "%s (0x%lx instead of S_OK)\n",message, hResult);
15#define test_HRES(hres, hresExpected, message) ok(hres == hresExpected, "%s (0x%lx instead of 0x%lx)\n",message, hResult,hresExpected);
64 hResult =
CoCreateInstance(CLSID_MenuBand,
NULL, CLSCTX_INPROC_SERVER, IID_IShellMenu,
reinterpret_cast<void **
>(shellMenu));
65 test_S_OK(hResult,
"Failed to instantiate CLSID_MenuBand");
66 if (!shellMenu)
return FALSE;
68 hResult = (*shellMenu)->
QueryInterface(IID_IDockingWindow,
reinterpret_cast<void **
>(dockingMenu));
69 test_S_OK(hResult,
"Failed to query IID_IDockingWindow");
71 test_S_OK(hResult,
"Failed to query IID_IObjectWithSite");
72 if (!dockingMenu || !menuWithSite)
return FALSE;
96 skip(
"failed to create CShellMenuObject\n");
104 test_S_OK(hResult,
"GetMenuInfo failed");
105 ok (psmc ==
NULL,
"wrong psmc\n");
106 ok (uId == 11,
"wrong uid\n");
107 ok (uIdAncestor == 22,
"wrong uIdAncestor\n");
108 ok (
dwFlags == 0xdeadbeef,
"wrong dwFlags\n");
110 hResult = shellMenu->
Initialize(
NULL, 0, ANCESTORDEFAULT, SMINIT_TOPLEVEL|SMINIT_VERTICAL);
113 hResult = dockingMenu->
GetWindow(&hwndToolbar);
116 hResult = shellMenu->
GetMenu(&
hmenu, &hwndOwner, &menuFlagss);
124 hResult = dockingMenu->
GetWindow(&hwndToolbar);
126 ok (hwndToolbar ==
NULL,
"Expected NULL window\n");
131 hResult = shellMenu->
GetMenu(&
hmenu, &hwndOwner, &menuFlagss);
135 hResult = dockingMenu->
GetWindow(&hwndToolbar);
139 test_S_OK(hResult,
"SHGetDesktopFolder failed");
142 test_S_OK(hResult,
"SetShellFolder failed");
148 hResult = dockingMenu->
GetWindow(&hwndToolbar);
150 ok (hwndToolbar ==
NULL,
"Expected NULL window\n");
175 skip(
"failed to create CShellMenuObject\n");
181 test_S_OK(hResult,
"SHGetDesktopFolder failed");
183 hResult = shellMenu->
Initialize(
NULL, 0, ANCESTORDEFAULT, SMINIT_TOPLEVEL|SMINIT_VERTICAL);
187 test_S_OK(hResult,
"SetShellFolder failed");
189 hResult = menuWithSite->
SetSite(dummyWindow);
192 hResult = dockingMenu->
GetWindow(&hwndToolbar);
194 ok(hwndToolbar !=
NULL,
"GetWindow should return a window\n");
204 ok(!
IsWindow(hwndToolbar),
"The toolbar window should not exist\n");
267 ok(psmd !=
NULL,
"Got NULL psmd\n");
271 if(uMsg == SMC_CREATE)
273 ok(psmd->
dwFlags == 0,
"wrong dwFlags\n");
274 ok(psmd->
dwMask == 0,
"wrong dwMask\n");
275 ok(psmd->
hmenu == 0,
"wrong hmenu\n");
276 ok(psmd->
hwnd == 0,
"wrong hwnd\n");
280 if (uMsg == SMC_GETSFOBJECT)
282 ok(psmd->
psf != 0,
"wrong dwFlags\n");
304 skip(
"failed to create CShellMenuObject\n");
309 struct _test_info cbtest_info[] = { {1, SMC_CREATE},
310 {2, SMC_GETSFOBJECT},
330 hResult = shellMenu->
Initialize(
callback, 0,ANCESTORDEFAULT, SMINIT_TOPLEVEL|SMINIT_VERTICAL);
335 test_S_OK(hResult,
"SetShellFolder failed");
341 hResult = menuWithSite->
SetSite(dummyWindow);
360 hResult =
CoCreateInstance(CLSID_MenuDeskBar,
NULL, CLSCTX_INPROC_SERVER, IID_IMenuPopup,
reinterpret_cast<void **
>(&menuPopup));
361 test_S_OK(hResult,
"Failed to instantiate CLSID_MenuDeskBar");
363 test_S_OK(hResult,
"Failed to instantiate CLSID_MenuBandSite");
364 if (!bCreated || !menuPopup || !bandSite)
366 skip(
"failed to create MenuBandSite object\n");
371 hResult = shellMenu->
Initialize(
NULL, 0, ANCESTORDEFAULT, SMINIT_TOPLEVEL|SMINIT_VERTICAL);
375 hResult = menuPopup->
SetClient(bandSite);
377 hResult = bandSite->
AddBand(shellMenu);
385 HWND hWndToolbar, hWndToplevel;
388 hResult = dockingMenu->
GetWindow(&hWndToolbar);
390 ok(hWndToolbar !=
NULL,
"GetWindow should return a window\n");
392 hResult = menuPopup->
GetWindow(&hWndToplevel);
394 ok(hWndToolbar !=
NULL,
"GetWindow should return a window\n");
397 ok(
GetParent(hwndRealParent) == hWndToplevel,
"Wrong parent\n");
412 test_S_OK(hResult,
"SHGetDesktopFolder failed");
421 iteminfo.
cbSize =
sizeof(iteminfo);
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define UlongToHandle(ul)
#define STDMETHODCALLTYPE
HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
const GUID CLSID_MenuBandSite
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HRESULT AddBand([in] IUnknown *punk)
HRESULT SetClient([in] IUnknown *punkClient)
HRESULT ShowDW([in] BOOL fShow)
HRESULT SetSite([in] IUnknown *pUnkSite)
HRESULT GetWindow([out] HWND *phwnd)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static IPrintDialogCallback callback
const IID IID_IObjectWithSite
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
@ COINIT_APARTMENTTHREADED
const GUID IID_IOleWindow
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define OFFSETOFCLASS(base, derived)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
BOOL WINAPI IsWindow(_In_opt_ HWND)
HMENU WINAPI CreatePopupMenu(void)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI GetDesktopWindow(void)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
HWND WINAPI GetParent(_In_ HWND)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)