joachim99@77: /*************************************************************************** joachim99@77: ShellContextMenu.h - description joachim99@77: ------------------- joachim99@77: begin : Sat Mar 4 2006 joachim99@77: copyright : (C) 2005-2007 by Joachim Eibl joachim99@77: email : joachim dot eibl at gmx dot de joachim99@77: ***************************************************************************/ joachim99@77: joachim99@77: /*************************************************************************** joachim99@77: * * joachim99@77: * This program is free software; you can redistribute it and/or modify * joachim99@77: * it under the terms of the GNU General Public License as published by * joachim99@77: * the Free Software Foundation; either version 2 of the License, or * joachim99@77: * (at your option) any later version. * joachim99@77: * * joachim99@77: ***************************************************************************/ joachim99@77: // ShellContextMenu.h: Schnittstelle fr die Klasse CShellContextMenu. joachim99@69: // joachim99@69: ////////////////////////////////////////////////////////////////////// joachim99@69: joachim99@69: #ifndef SHELLCONTEXTMENU_H joachim99@69: #define SHELLCONTEXTMENU_H joachim99@69: joachim99@69: ///////////////////////////////////////////////////////////////////// joachim99@69: // class to show shell contextmenu of files/folders/shell objects joachim99@69: // developed by R. Engels 2003 joachim99@69: ///////////////////////////////////////////////////////////////////// joachim99@69: joachim99@69: class CShellContextMenu joachim99@69: { joachim99@69: public: joachim99@69: HMENU GetMenu (); joachim99@69: void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem); joachim99@69: void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount); joachim99@69: void SetObjects (LPITEMIDLIST pidl); joachim99@69: void SetObjects (const QString& strObject); joachim99@69: void SetObjects (const QStringList& strList); joachim99@70: UINT ShowContextMenu (QWidget* pParent, QPoint pt, QMenu* pMenu); joachim99@69: CShellContextMenu(); joachim99@69: virtual ~CShellContextMenu(); joachim99@69: joachim99@69: private: joachim99@69: int nItems; joachim99@69: BOOL bDelete; joachim99@69: HMENU m_hMenu; joachim99@69: IShellFolder * m_psfFolder; joachim99@69: LPITEMIDLIST * m_pidlArray; joachim99@69: joachim99@69: void InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand); joachim99@69: BOOL GetContextMenu (void ** ppContextMenu, int & iMenuType); joachim99@69: HRESULT SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast); joachim99@69: static LRESULT CALLBACK HookWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); joachim99@69: void FreePIDLArray (LPITEMIDLIST * pidlArray); joachim99@69: LPITEMIDLIST CopyPIDL (LPCITEMIDLIST pidl, int cb = -1); joachim99@69: UINT GetPIDLSize (LPCITEMIDLIST pidl); joachim99@69: LPBYTE GetPIDLPos (LPCITEMIDLIST pidl, int nPos); joachim99@69: int GetPIDLCount (LPCITEMIDLIST pidl); joachim99@69: }; joachim99@69: joachim99@69: #endif