joachim99@77
|
1 /***************************************************************************
|
joachim99@77
|
2 ShellContextMenu.h - description
|
joachim99@77
|
3 -------------------
|
joachim99@77
|
4 begin : Sat Mar 4 2006
|
joachim99@77
|
5 copyright : (C) 2005-2007 by Joachim Eibl
|
joachim99@77
|
6 email : joachim dot eibl at gmx dot de
|
joachim99@77
|
7 ***************************************************************************/
|
joachim99@77
|
8
|
joachim99@77
|
9 /***************************************************************************
|
joachim99@77
|
10 * *
|
joachim99@77
|
11 * This program is free software; you can redistribute it and/or modify *
|
joachim99@77
|
12 * it under the terms of the GNU General Public License as published by *
|
joachim99@77
|
13 * the Free Software Foundation; either version 2 of the License, or *
|
joachim99@77
|
14 * (at your option) any later version. *
|
joachim99@77
|
15 * *
|
joachim99@77
|
16 ***************************************************************************/
|
joachim99@77
|
17 // ShellContextMenu.h: Schnittstelle fr die Klasse CShellContextMenu.
|
joachim99@69
|
18 //
|
joachim99@69
|
19 //////////////////////////////////////////////////////////////////////
|
joachim99@69
|
20
|
joachim99@69
|
21 #ifndef SHELLCONTEXTMENU_H
|
joachim99@69
|
22 #define SHELLCONTEXTMENU_H
|
joachim99@69
|
23
|
joachim99@69
|
24 /////////////////////////////////////////////////////////////////////
|
joachim99@69
|
25 // class to show shell contextmenu of files/folders/shell objects
|
joachim99@69
|
26 // developed by R. Engels 2003
|
joachim99@69
|
27 /////////////////////////////////////////////////////////////////////
|
joachim99@69
|
28
|
joachim99@69
|
29 class CShellContextMenu
|
joachim99@69
|
30 {
|
joachim99@69
|
31 public:
|
joachim99@69
|
32 HMENU GetMenu ();
|
joachim99@69
|
33 void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem);
|
joachim99@69
|
34 void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount);
|
joachim99@69
|
35 void SetObjects (LPITEMIDLIST pidl);
|
joachim99@69
|
36 void SetObjects (const QString& strObject);
|
joachim99@69
|
37 void SetObjects (const QStringList& strList);
|
joachim99@70
|
38 UINT ShowContextMenu (QWidget* pParent, QPoint pt, QMenu* pMenu);
|
joachim99@69
|
39 CShellContextMenu();
|
joachim99@69
|
40 virtual ~CShellContextMenu();
|
joachim99@69
|
41
|
joachim99@69
|
42 private:
|
joachim99@69
|
43 int nItems;
|
joachim99@69
|
44 BOOL bDelete;
|
joachim99@69
|
45 HMENU m_hMenu;
|
joachim99@69
|
46 IShellFolder * m_psfFolder;
|
joachim99@69
|
47 LPITEMIDLIST * m_pidlArray;
|
joachim99@69
|
48
|
joachim99@69
|
49 void InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand);
|
joachim99@69
|
50 BOOL GetContextMenu (void ** ppContextMenu, int & iMenuType);
|
joachim99@69
|
51 HRESULT SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast);
|
joachim99@69
|
52 static LRESULT CALLBACK HookWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
joachim99@69
|
53 void FreePIDLArray (LPITEMIDLIST * pidlArray);
|
joachim99@69
|
54 LPITEMIDLIST CopyPIDL (LPCITEMIDLIST pidl, int cb = -1);
|
joachim99@69
|
55 UINT GetPIDLSize (LPCITEMIDLIST pidl);
|
joachim99@69
|
56 LPBYTE GetPIDLPos (LPCITEMIDLIST pidl, int nPos);
|
joachim99@69
|
57 int GetPIDLCount (LPCITEMIDLIST pidl);
|
joachim99@69
|
58 };
|
joachim99@69
|
59
|
joachim99@69
|
60 #endif
|