reactos/dll/win32/shell32/droptargets/CexeDropHandler.h
Katayama Hirofumi MZ 49b2b1dab1
[SHELL32] Use STDMETHOD macro and keyword override (#6570)
For simplicity and short typing.
JIRA issue: CORE-19469
- Replace "virtual HRESULT STDMETHODCALLTYPE
  m" with "STDMETHOD(m)" (m is a method name).
- Replace "virtual t STDMETHODCALLTYPE m" with
  "STDMETHOD_(t, m)" (t is a type. m is a method
  name).
- Use "override" keyword as possible.
- CDefView should inherit IShellView3 due to
  override CreateViewWindow3 method.
- Fix CDefView::CreateViewWindow3 (parameter
  prcView is const RECT *, not LPRECT).
2024-03-05 08:43:39 +09:00

66 lines
2.3 KiB
C++

/*
* executable drop target handler
*
* Copyright 2014 Huw Campbell
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _CEXEDROPHANDLER_H_
#define _CEXEDROPHANDLER_H_
class CExeDropHandler :
public CComCoClass<CExeDropHandler, &CLSID_ExeDropHandler>,
public CComObjectRootEx<CComMultiThreadModelNoCS>,
public IDropTarget,
public IPersistFile
{
private:
CLSID *pclsid;
LPWSTR sPathTarget;
public:
CExeDropHandler();
~CExeDropHandler();
// IDropTarget
STDMETHOD(DragEnter)(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override;
STDMETHOD(DragOver)(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override;
STDMETHOD(DragLeave)() override;
STDMETHOD(Drop)(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override;
// IPersist
STDMETHOD(GetClassID)(CLSID *lpClassId) override;
//////// IPersistFile
STDMETHOD(GetCurFile)(LPOLESTR *ppszFileName) override;
STDMETHOD(IsDirty)() override;
STDMETHOD(Load)(LPCOLESTR pszFileName, DWORD dwMode) override;
STDMETHOD(Save)(LPCOLESTR pszFileName, BOOL fRemember) override;
STDMETHOD(SaveCompleted)(LPCOLESTR pszFileName) override;
DECLARE_REGISTRY_RESOURCEID(IDR_EXEDROPHANDLER)
DECLARE_NOT_AGGREGATABLE(CExeDropHandler)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CExeDropHandler)
COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
END_COM_MAP()
};
#endif /* _CEXEDROPHANDLER_H_ */