mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 13:01:24 +00:00
[QCKLNCH]
-Tested CISFband in FinalConstruct. -Performed Clean up on whitespace issues. svn path=/branches/GSoC_2017/shellext/; revision=75036
This commit is contained in:
parent
a34b262695
commit
abfd95f82e
3 changed files with 113 additions and 83 deletions
|
@ -16,26 +16,24 @@ static const GUID CLSID_QuickLaunchBand = { 0x260cb95d, 0x4544, 0x44f6, { 0xa0,
|
||||||
//Componenet Category Registration
|
//Componenet Category Registration
|
||||||
HRESULT RegisterComCat()
|
HRESULT RegisterComCat()
|
||||||
{
|
{
|
||||||
ICatRegister *pcr;
|
CComPtr<ICatRegister> pcr;
|
||||||
HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
|
HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
CATID catid = CATID_DeskBand;
|
CATID catid = CATID_DeskBand;
|
||||||
hr = pcr->RegisterClassImplCategories(CLSID_QuickLaunchBand, 1, &catid);
|
hr = pcr->RegisterClassImplCategories(CLSID_QuickLaunchBand, 1, &catid);
|
||||||
pcr->Release();
|
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT UnregisterComCat()
|
HRESULT UnregisterComCat()
|
||||||
{
|
{
|
||||||
ICatRegister *pcr;
|
CComPtr<ICatRegister> pcr;
|
||||||
HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
|
HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
CATID catid = CATID_DeskBand;
|
CATID catid = CATID_DeskBand;
|
||||||
hr = pcr->UnRegisterClassImplCategories(CLSID_QuickLaunchBand, 1, &catid);
|
hr = pcr->UnRegisterClassImplCategories(CLSID_QuickLaunchBand, 1, &catid);
|
||||||
pcr->Release();
|
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
@ -66,6 +64,31 @@ HRESULT UnregisterComCat()
|
||||||
CQuickLaunchBand::~CQuickLaunchBand() { }
|
CQuickLaunchBand::~CQuickLaunchBand() { }
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
//ATL Construct
|
||||||
|
|
||||||
|
HRESULT CQuickLaunchBand::FinalConstruct()
|
||||||
|
{
|
||||||
|
HRESULT hr = CoCreateInstance(CLSID_ISFBand, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**) &m_punkISFB);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
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"CISFBand Init success!!", L"Testing", MB_OK | MB_ICONINFORMATION);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
//IObjectWithSite
|
//IObjectWithSite
|
||||||
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::SetSite(IUnknown *pUnkSite)
|
HRESULT STDMETHODCALLTYPE CQuickLaunchBand::SetSite(IUnknown *pUnkSite)
|
||||||
|
@ -84,9 +107,7 @@ HRESULT UnregisterComCat()
|
||||||
return hRet;
|
return hRet;
|
||||||
}
|
}
|
||||||
m_Site = pUnkSite;
|
m_Site = pUnkSite;
|
||||||
|
|
||||||
m_hWnd = CreateWindowEx(0, L"BUTTON", L">>", WS_CHILD, CW_USEDEFAULT, CW_USEDEFAULT, 50, 50, hwndParent, 0, m_hInstance, 0);
|
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
|
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;
|
return S_OK;
|
||||||
|
|
|
@ -25,16 +25,24 @@ class CQuickLaunchBand :
|
||||||
public IOleCommandTarget
|
public IOleCommandTarget
|
||||||
{
|
{
|
||||||
CComPtr<IUnknown> m_Site;
|
CComPtr<IUnknown> m_Site;
|
||||||
|
CComPtr<IUnknown> m_punkISFB;
|
||||||
|
|
||||||
HINSTANCE m_hInstance;
|
HINSTANCE m_hInstance;
|
||||||
HWND m_hWnd;
|
HWND m_hWnd;
|
||||||
HWND m_hWndStartButton;
|
HWND m_hWndStartButton;
|
||||||
DWORD m_BandID;
|
DWORD m_BandID;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CQuickLaunchBand();
|
CQuickLaunchBand();
|
||||||
virtual ~CQuickLaunchBand();
|
virtual ~CQuickLaunchBand();
|
||||||
|
|
||||||
|
//ATL construct
|
||||||
|
|
||||||
|
HRESULT FinalConstruct();
|
||||||
|
|
||||||
//IObjectWithSite
|
//IObjectWithSite
|
||||||
|
|
||||||
virtual HRESULT STDMETHODCALLTYPE GetSite(
|
virtual HRESULT STDMETHODCALLTYPE GetSite(
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <ddeml.h>
|
#include <ddeml.h>
|
||||||
#include <shlguid_undoc.h>
|
#include <shlguid_undoc.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
|
#include <shlguid.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
#include <shlobj_undoc.h>
|
#include <shlobj_undoc.h>
|
||||||
#include <shlwapi_undoc.h>
|
#include <shlwapi_undoc.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue