Author: ssawant
Date: Thu Jun 15 17:07:22 2017
New Revision: 75050
URL:
http://svn.reactos.org/svn/reactos?rev=75050&view=rev
Log:
{QCKLNCH]
-Successfully added CISFBand to CQuickLaunchBand.
-Forwarded methods exported by CISFBand to CQuickLaunchBand.
Modified:
branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp
Modified: branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/shellext/reactos/dll/…
==============================================================================
---
branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp [iso-8859-1]
(original)
+++
branches/GSoC_2017/shellext/reactos/dll/shellext/qcklnch/CQuickLaunchBand.cpp [iso-8859-1]
Thu Jun 15 17:07:22 2017
@@ -67,26 +67,39 @@
//ATL Construct
HRESULT CQuickLaunchBand::FinalConstruct()
- {
+ {
+ //MessageBox(0, L"CQuickLaunchBand::FinalConstruct Begin!",
L"Testing", MB_OK | MB_ICONINFORMATION);
+
HRESULT hr = CoCreateInstance(CLSID_ISFBand, NULL, CLSCTX_INPROC_SERVER,
IID_IUnknown, (void**) &m_punkISFB);
if (SUCCEEDED(hr))
- {
+ {
+ //MessageBox(0, L"CoCreateInstance success!", L"Testing",
MB_OK | MB_ICONINFORMATION);
+
CComPtr<IShellFolderBand> pISFB;
hr = m_punkISFB->QueryInterface(IID_IShellFolderBand, (void**)
&pISFB);
if (SUCCEEDED(hr))
{
- MessageBox(0, L"CISFBand Init success!!", L"Testing",
MB_OK | MB_ICONINFORMATION);
+ // MessageBox(0, L"IID_ISFBand query success!",
L"Testing", MB_OK | MB_ICONINFORMATION);
+
CComPtr<IShellFolder> pISF;
hr = SHGetDesktopFolder(&pISF);
if (SUCCEEDED(hr))
{
- pISFB->InitializeSFB(pISF, 0);
- MessageBox(0, L"CISFBand Init success!!",
L"Testing", MB_OK | MB_ICONINFORMATION);
- }
+ //MessageBox(0, L"pisf success!", L"Testing",
MB_OK | MB_ICONINFORMATION);
+
+ //LPITEMIDLIST pidl;
+ //hr = SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
+ if (SUCCEEDED(hr))
+ {
+ //MessageBox(0, L"pidl success!", L"Testing",
MB_OK | MB_ICONINFORMATION);
+
+ pISFB->InitializeSFB(pISF, 0);
+ }
+ }
}
}
-
- MessageBox(0, L"CISFBand Init success!!", L"Testing", MB_OK |
MB_ICONINFORMATION);
+
+ // MessageBox(0, L"CQuickLaunchBand::FinalConstruct End!",
L"Testing", MB_OK | MB_ICONINFORMATION);
return hr;
}
@@ -95,7 +108,7 @@
{
MessageBox(0, L"CQuickLaunchBand::SetSite called!",
L"Testing", MB_OK | MB_ICONINFORMATION);
- HRESULT hRet;
+ /* HRESULT hRet;
HWND hwndParent;
TRACE("CQuickLaunchBand::SetSite(0x%p)\n", pUnkSite);
@@ -109,8 +122,13 @@
m_Site = pUnkSite;
m_hWnd = CreateWindowEx(0, L"BUTTON", L">>", WS_CHILD,
CW_USEDEFAULT, CW_USEDEFAULT, 50, 50, hwndParent, 0, m_hInstance, 0);
SetWindowSubclass(hwndParent, MyWndProc, 0, 0); //when button is clicked, parent
receives WM_COMMAND, and thus subclassed to show a test message box
-
- return S_OK;
+ */
+ //Internal CISFBand Calls
+ CComPtr<IObjectWithSite> pIOWS;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IObjectWithSite,
(void**)&pIOWS);
+ if (FAILED(hr)) return hr;
+
+ return pIOWS->SetSite(pUnkSite);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSite(
@@ -120,14 +138,19 @@
//MessageBox(0, L"GetSite called!", L"Test Caption", MB_OK |
MB_ICONINFORMATION);
TRACE("CQuickLaunchBand::GetSite(0x%p,0x%p)\n", riid, ppvSite);
+ /* HRESULT hr;
if (m_Site != NULL)
{
- return m_Site->QueryInterface(riid, ppvSite);
- }
-
- *ppvSite = NULL;
-
- return E_FAIL;
+ hr = m_Site->QueryInterface(riid, ppvSite);
+ if (FAILED(hr)) return hr;
+ }*/
+
+ //Internal CISFBand Calls
+ CComPtr<IObjectWithSite> pIOWS;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IObjectWithSite,
(void**)&pIOWS);
+ if (FAILED(hr)) return hr;
+
+ return pIOWS->GetSite(riid, ppvSite);
}
/*****************************************************************************/
@@ -136,13 +159,18 @@
{
//MessageBox(0, L"GetWindow called!", L"Test Caption", MB_OK
| MB_ICONINFORMATION);
- if (!m_hWnd)
+ /*if (!m_hWnd)
return E_FAIL;
if (!phwnd)
return E_INVALIDARG;
- *phwnd = m_hWnd;
-
- return S_OK;
+ *phwnd = m_hWnd;*/
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBand> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->GetWindow(phwnd);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ContextSensitiveHelp(
@@ -151,7 +179,13 @@
/* FIXME: Implement */
//MessageBox(0, L"ContextSensitiveHelp called!", L"Test
Caption", MB_OK | MB_ICONINFORMATION);
- return E_NOTIMPL;
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBand> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->ContextSensitiveHelp(fEnterMode);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ShowDW(
@@ -159,12 +193,17 @@
{
//MessageBox(0, L"ShowDW called!", L"Test Caption", MB_OK |
MB_ICONINFORMATION);
- if (m_hWnd)
+ /*if (m_hWnd)
{
ShowWindow(m_hWnd, bShow ? SW_SHOW : SW_HIDE);
- }
-
- return S_OK;
+ }*/
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBand> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->ShowDW(bShow);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::CloseDW(
@@ -172,14 +211,19 @@
{
//MessageBox(0, L"CloseDW called!", L"Test Caption", MB_OK |
MB_ICONINFORMATION);
- if (m_hWnd)
+ /*if (m_hWnd)
{
ShowWindow(m_hWnd, SW_HIDE);
DestroyWindow(m_hWnd);
m_hWnd = NULL;
- }
-
- return S_OK;
+ }*/
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBand> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->CloseDW(dwReserved);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::ResizeBorderDW(
@@ -190,7 +234,13 @@
/* No need to implement this method */
//MessageBox(0, L"ResizeBorderDW called!", L"Test Caption",
MB_OK | MB_ICONINFORMATION);
- return E_NOTIMPL;
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBand> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->ResizeBorderDW(prcBorder, punkToolbarSite, fReserved);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetBandInfo( //Need a check
@@ -201,68 +251,13 @@
//MessageBox(0, L"GetBandInfo called!", L"Test Caption",
MB_OK | MB_ICONINFORMATION);
TRACE("CTaskBand::GetBandInfo(0x%x,0x%x,0x%p) hWnd=0x%p\n", dwBandID,
dwViewMode, pdbi, m_hWnd);
- HRESULT hr = E_INVALIDARG;
-
- if (m_hWnd && pdbi)
- {
- m_BandID = dwBandID;
- pdbi->dwModeFlags = DBIMF_VARIABLEHEIGHT;
-
- if (dwViewMode & DBIF_VIEWMODE_VERTICAL)
- {
- pdbi->ptIntegral.y = 1;
- pdbi->ptMinSize.y = 20;
- /* FIXME: Get the button metrics from the task bar object!!! */
- pdbi->ptMinSize.x = (3 * GetSystemMetrics(SM_CXEDGE) / 2) + /* FIXME:
Might be wrong if only one column! */
- GetSystemMetrics(SM_CXSIZE) + (2 * GetSystemMetrics(SM_CXEDGE)); /*
FIXME: Min button size, query!!! */
- }
- else
- {
- /* When the band is horizontal its minimum height is the height of the
start button */
- RECT rcButton;
- GetWindowRect(m_hWndStartButton, &rcButton);
- pdbi->ptMinSize.y = rcButton.bottom - rcButton.top;
- pdbi->ptIntegral.y = pdbi->ptMinSize.y + (3 *
GetSystemMetrics(SM_CYEDGE) / 2); /* FIXME: Query metrics */
- /* We're not going to allow task bands where not even the minimum
button size fits into the band */
- pdbi->ptMinSize.x = pdbi->ptIntegral.y;
- }
-
- if (pdbi->dwMask & DBIM_MAXSIZE)
- {
- pdbi->ptMaxSize.y = -1;
- }
-
- if (pdbi->dwMask & DBIM_ACTUAL)
- {
- pdbi->ptActual.x = 35;
- pdbi->ptActual.y = 30;
- }
-
- if (pdbi->dwMask & DBIM_TITLE)
- {
- // Don't show title by removing this flag.
- pdbi->dwMask &= ~DBIM_TITLE;
- }
-
- if (pdbi->dwMask & DBIM_MODEFLAGS)
- {
- pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT;
- }
-
- if (pdbi->dwMask & DBIM_BKCOLOR)
- {
- // Use the default background color by removing this flag.
- pdbi->dwMask &= ~DBIM_BKCOLOR;
- }
-
- TRACE("H: %d, Min: %d,%d, Integral.y: %d Actual: %d,%d\n",
(dwViewMode & DBIF_VIEWMODE_VERTICAL) == 0,
- pdbi->ptMinSize.x, pdbi->ptMinSize.y, pdbi->ptIntegral.y,
- pdbi->ptActual.x, pdbi->ptActual.y);
-
- hr = S_OK;
- }
-
- return hr;
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBand> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBand, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->GetBandInfo(dwBandID, dwViewMode, pdbi);
}
/*****************************************************************************/
@@ -273,7 +268,13 @@
TRACE("IDeskBar::SetClient(0x%p)\n", punkClient);
//MessageBox(0, L"SetClient called!", L"Test Caption", MB_OK
| MB_ICONINFORMATION);
- return E_NOTIMPL;
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBar> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBar, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->SetClient(punkClient);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetClient(
@@ -282,18 +283,28 @@
TRACE("IDeskBar::GetClient(0x%p)\n", ppunkClient);
//MessageBox(0, L"GetClient called!", L"Test Caption", MB_OK
| MB_ICONINFORMATION);
- return E_NOTIMPL;
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBar> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBar, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->GetClient(ppunkClient);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::OnPosRectChangeDB(
IN RECT *prc)
{
- TRACE("IDeskBar::OnPosRectChangeDB(0x%p=(%d,%d,%d,%d))\n", prc,
prc->left, prc->top, prc->right, prc->bottom);
- if (prc->bottom - prc->top == 0)
- return S_OK;
+ TRACE("IDeskBar::OnPosRectChangeDB(0x%p=(%d,%d,%d,%d))\n", prc,
prc->left, prc->top, prc->right, prc->bottom);
//MessageBox(0, L"OnPosRectChangeDB called!", L"Test
Caption", MB_OK | MB_ICONINFORMATION);
- return S_FALSE;
+
+ //Internal CISFBand Calls
+ CComPtr<IDeskBar> pIDB;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IDeskBar, (void**)&pIDB);
+ if (FAILED(hr)) return hr;
+
+ return pIDB->OnPosRectChangeDB(prc);
}
/*****************************************************************************/
@@ -304,9 +315,14 @@
//MessageBox(0, L"GetClassID called!", L"Test Caption", MB_OK
| MB_ICONINFORMATION);
TRACE("CQuickLaunchBand::GetClassID(0x%p)\n", pClassID);
/* We're going to return the (internal!) CLSID of the quick launch band */
- *pClassID = CLSID_QuickLaunchBand;
-
- return S_OK;
+ /* *pClassID = CLSID_QuickLaunchBand; */
+
+ //Internal CISFBand Calls
+ CComPtr<IPersistStream> pIPS;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream,
(void**)&pIPS);
+ if (FAILED(hr)) return hr;
+
+ return pIPS->GetClassID(pClassID);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::IsDirty()
@@ -314,7 +330,13 @@
/* The object hasn't changed since the last save! */
//MessageBox(0, L"IsDirty called!", L"Test Caption", MB_OK |
MB_ICONINFORMATION);
- return S_FALSE;
+
+ //Internal CISFBand Calls
+ CComPtr<IPersistStream> pIPS;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream,
(void**)&pIPS);
+ if (FAILED(hr)) return hr;
+
+ return pIPS->IsDirty();
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Load(
@@ -324,7 +346,13 @@
/* Nothing to do */
//MessageBox(0, L"Load called!", L"Test Caption", MB_OK |
MB_ICONINFORMATION);
- return S_OK;
+
+ //Internal CISFBand Calls
+ CComPtr<IPersistStream> pIPS;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream,
(void**)&pIPS);
+ if (FAILED(hr)) return hr;
+
+ return pIPS->Load(pStm);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Save(
@@ -334,17 +362,29 @@
/* Nothing to do */
//MessageBox(0, L"Save called!", L"Test Caption", MB_OK |
MB_ICONINFORMATION);
- return S_OK;
+
+ //Internal CISFBand Calls
+ CComPtr<IPersistStream> pIPS;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream,
(void**)&pIPS);
+ if (FAILED(hr)) return hr;
+
+ return pIPS->Save(pStm, fClearDirty);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::GetSizeMax(
OUT ULARGE_INTEGER *pcbSize)
{
TRACE("CQuickLaunchBand::GetSizeMax called\n");
- pcbSize->QuadPart = 0;
+ //pcbSize->QuadPart = 0;
//MessageBox(0, L"GetSizeMax called!", L"Test Caption", MB_OK
| MB_ICONINFORMATION);
- return S_OK;
+
+ //Internal CISFBand Calls
+ CComPtr<IPersistStream> pIPS;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IPersistStream,
(void**)&pIPS);
+ if (FAILED(hr)) return hr;
+
+ return pIPS->GetSizeMax(pcbSize);
}
@@ -368,27 +408,40 @@
{
//MessageBox(0, L"ContainsWindow called!", L"Test Caption",
MB_OK | MB_ICONINFORMATION);
- if (hWnd == m_hWnd ||
+ /*if (hWnd == m_hWnd ||
IsChild(m_hWnd, hWnd))
{
TRACE("CQuickLaunchBand::ContainsWindow(0x%p) returns S_OK\n",
hWnd);
return S_OK;
- }
-
- return S_FALSE;
+ }*/
+
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
wParam, LPARAM lParam, LRESULT *theResult)
{
//MessageBox(0, L"OnWinEvent called!", L"Test Caption", MB_OK
| MB_ICONINFORMATION);
- UNIMPLEMENTED;
- return E_NOTIMPL;
+ //UNIMPLEMENTED;
+
+ //Internal CISFBand Calls
+ CComPtr<IWinEventHandler> pWEH;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IWinEventHandler,
(void**)&pWEH);
+ if (FAILED(hr)) return hr;
+
+ return pWEH->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::IsWindowOwner(HWND hWnd)
{
//MessageBox(0, L"IsWindowOwner called!", L"Test Caption",
MB_OK | MB_ICONINFORMATION);
- return (hWnd == m_hWnd) ? S_OK : S_FALSE;
+ //return (hWnd == m_hWnd) ? S_OK : S_FALSE;
+
+ //Internal CISFBand Calls
+ CComPtr<IWinEventHandler> pWEH;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IWinEventHandler,
(void**)&pWEH);
+ if (FAILED(hr)) return hr;
+
+ return pWEH->IsWindowOwner(hWnd);
}
/*****************************************************************************/
@@ -396,13 +449,19 @@
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::QueryStatus(const GUID *pguidCmdGroup,
ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
{
//MessageBox(0, L"QueryStatus called!", L"Test Caption",
MB_OK | MB_ICONINFORMATION);
- UNIMPLEMENTED;
- return E_NOTIMPL;
+ //UNIMPLEMENTED;
+
+ //Internal CISFBand Calls
+ CComPtr<IOleCommandTarget> pOCT;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IOleCommandTarget,
(void**)&pOCT);
+ if (FAILED(hr)) return hr;
+
+ return pOCT->QueryStatus(pguidCmdGroup, cCmds, prgCmds, pCmdText);
}
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::Exec(const GUID *pguidCmdGroup, DWORD
nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
{
- if (IsEqualIID(*pguidCmdGroup, IID_IBandSite))
+ /*if (IsEqualIID(*pguidCmdGroup, IID_IBandSite))
{
return S_OK;
}
@@ -410,11 +469,15 @@
if (IsEqualIID(*pguidCmdGroup, IID_IDeskBand))
{
return S_OK;
- }
+ }*/
//MessageBox(0, L"Exec called!", L"Test Caption", MB_OK |
MB_ICONINFORMATION);
- UNIMPLEMENTED;
-
- return E_NOTIMPL;
+
+ //Internal CISFBand Calls
+ CComPtr<IOleCommandTarget> pOCT;
+ HRESULT hr = m_punkISFB->QueryInterface(IID_IOleCommandTarget,
(void**)&pOCT);
+ if (FAILED(hr)) return hr;
+
+ return pOCT->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
}