Click here to Skip to main content
15,893,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: determine sigma size of Gaussian mask Pin
gentleguy21-Feb-08 22:51
gentleguy21-Feb-08 22:51 
QuestionSend data to a service Pin
nitin321-Feb-08 20:03
nitin321-Feb-08 20:03 
GeneralRe: Send data to a service Pin
Matthew Faithfull21-Feb-08 22:35
Matthew Faithfull21-Feb-08 22:35 
AnswerRe: Send data to a service Pin
Rajkumar R21-Feb-08 22:51
Rajkumar R21-Feb-08 22:51 
GeneralRe: Send data to a service Pin
Maxwell Chen21-Feb-08 23:00
Maxwell Chen21-Feb-08 23:00 
GeneralRe: Send data to a service Pin
Rajkumar R22-Feb-08 2:47
Rajkumar R22-Feb-08 2:47 
Generallnk file path [modified] Pin
john563221-Feb-08 19:35
john563221-Feb-08 19:35 
GeneralRe: lnk file path Pin
Iain Clarke, Warrior Programmer22-Feb-08 5:07
Iain Clarke, Warrior Programmer22-Feb-08 5:07 
My first instinct is to ignore reposts...

But it's a harder question than it sounds.

But when I read your first post, I did a bit of research - and I hate to waste work I already did.

I read through Michael Dunn's shell extension articles (my go to reference for all this stuff). When an extension is initially used, the IShellExiInit interface of your COM object is retrieved, and its Initialize method called.

This gives the PIDL of the directory, and a IDataObject interface to interrogate.

If you call the pDataObject->GetData with the HDROP formatetc parameter, you get the destination of the link.

BUT:

I then called the EnumFormatEtc, and logged the results.

At the bottom is my code, and here are the results:
Clipboard format name: Shell IDList Array
Clipboard format code: 15
Clipboard format name: FileName
Clipboard format name: FileNameW

15 corresponds to CF_HDROP - but there are other formats you can grab the data in.

I think these other formats are worthy of your investigation - especially Shell IDList Array. I've just done a google search, and there are many good soundign hits, even a few from codeproject.

I'd be interested in your results!

Good luck,

Iain.




STDMETHODIMP CSimpleShlExt::Initialize (  LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hProgID )
{
	FORMATETC f, fmt = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
	STGMEDIUM stg = { TYMED_HGLOBAL };
	HDROP     hDrop;
	HRESULT		hr = S_OK;

	TCHAR oBuf [MAX_PATH];
	
	// Look for CF_HDROP data in the data object. If there
	
	// is no such data, return an error back to Explorer.
	IEnumFORMATETC *pEnum = NULL;
	hr = pDataObj->EnumFormatEtc (DATADIR_GET, &pEnum);
	if (SUCCEEDED(hr))
	{
		TCHAR szBuf [1025] = { 0 };
		ULONG lFetched = 0;
		while (S_OK == pEnum->Next (1, &f, &lFetched))
		{
			if (GetClipboardFormatName (f.cfFormat, szBuf, 1024))
				wsprintf (oBuf, _T("Clipboard format name: %s\n"), szBuf);
			else
				wsprintf (oBuf, _T("Clipboard format code: %i\n"), f.cfFormat);

			OutputDebugString (oBuf);
		}

		pEnum->Release ();
	}

        .....

        etc


Iain Clarke appearing in spite of being begged not to by CPallini.

QuestionC++ package objects into separate .dll class library projects Pin
TheGeneral6921-Feb-08 18:40
TheGeneral6921-Feb-08 18:40 
AnswerRe: C++ package objects into separate .dll class library projects Pin
Rajkumar R21-Feb-08 19:15
Rajkumar R21-Feb-08 19:15 
GeneralRe: C++ package objects into separate .dll class library projects Pin
TheGeneral6921-Feb-08 20:40
TheGeneral6921-Feb-08 20:40 
GeneralRe: C++ package objects into separate .dll class library projects Pin
TheGeneral6925-Feb-08 14:50
TheGeneral6925-Feb-08 14:50 
AnswerRe: C++ package objects into separate .dll class library projects Pin
Rajkumar R25-Feb-08 16:56
Rajkumar R25-Feb-08 16:56 
GeneralRe: C++ package objects into separate .dll class library projects Pin
TheGeneral6925-Feb-08 19:12
TheGeneral6925-Feb-08 19:12 
GeneralAbout constructer Pin
rowdy_vc++21-Feb-08 17:46
rowdy_vc++21-Feb-08 17:46 
AnswerRe: About constructer [modified] Pin
Rajkumar R21-Feb-08 18:31
Rajkumar R21-Feb-08 18:31 
QuestionRe: About constructer Pin
CPallini21-Feb-08 21:23
mveCPallini21-Feb-08 21:23 
GeneralRe: About constructer Pin
Hamid_RT23-Feb-08 1:54
Hamid_RT23-Feb-08 1:54 
GeneralRe: About constructer Pin
David Crow22-Feb-08 2:41
David Crow22-Feb-08 2:41 
GeneralNooby would like assistance with compile error building a property sheets program [modified] Pin
doorprize21-Feb-08 17:06
doorprize21-Feb-08 17:06 
GeneralRe: Nooby would like assistance with compile error building a property sheets program Pin
Rajkumar R21-Feb-08 18:23
Rajkumar R21-Feb-08 18:23 
GeneralRe: Nooby would like assistance with compile error building a property sheets program Pin
David Crow22-Feb-08 2:43
David Crow22-Feb-08 2:43 
GeneralSystemtray Pin
act_x21-Feb-08 15:04
act_x21-Feb-08 15:04 
GeneralRe: Systemtray Pin
Stephen Hewitt21-Feb-08 16:06
Stephen Hewitt21-Feb-08 16:06 
GeneralVersion Info Pin
Bram van Kampen21-Feb-08 14:47
Bram van Kampen21-Feb-08 14:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.