Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: mouse position in treeview Pin
Naveen14-Jun-06 22:15
Naveen14-Jun-06 22:15 
QuestionRe: mouse position in treeview Pin
zeus_master15-Jun-06 0:05
zeus_master15-Jun-06 0:05 
AnswerRe: mouse position in treeview Pin
Naveen15-Jun-06 1:14
Naveen15-Jun-06 1:14 
GeneralRe: mouse position in treeview Pin
zeus_master15-Jun-06 16:52
zeus_master15-Jun-06 16:52 
QuestionCTabCtrl in MDI splitter won't compile Pin
Vaclav14-Jun-06 15:52
Vaclav14-Jun-06 15:52 
AnswerRe: CTabCtrl in MDI splitter won't compile Pin
Vaclav14-Jun-06 16:58
Vaclav14-Jun-06 16:58 
GeneralRe: CTabCtrl in MDI splitter won't compile Pin
Ryan Binns14-Jun-06 18:53
Ryan Binns14-Jun-06 18:53 
QuestionMenu items missing in shell context menu... Pin
nm_11414-Jun-06 15:13
nm_11414-Jun-06 15:13 
I'm trying to show the shell context menu for a file when only having the file name. I got the menu to come up but not all the menu items are showing up - like the ones virus scanners or zip utilities add to all files ("Scan File", "Add to Zip" etc.). Is there anything I'm missing:
typedef HRESULT (WINAPI *lpfnSHBindToParent)(LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast);

LRESULT OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	lpfnSHBindToParent pSHBindToParent = (lpfnSHBindToParent)GetProcAddress(GetModuleHandle(TEXT("SHELL32.DLL")), "SHBindToParent");

	if (pSHBindToParent)
	{
		LPOLESTR pwszFileName;
#ifdef UNICODE
		pwszFileName = strFullFileName;
#else
		WCHAR wsz[MAX_PATH];
		MultiByteToWideChar(CP_ACP, 0, strFullFileName, -1, wsz, ARRAYSIZE(wsz));
		pwszFileName = wsz;
#endif

		LPSHELLFOLDER pDesktopFolder;
		if (SHGetDesktopFolder(&pDesktopFolder) == NOERROR)
		{
			LPITEMIDLIST pidl;
			if (pDesktopFolder->ParseDisplayName(hMainWnd, NULL, pwszFileName, NULL, &pidl, NULL) == S_OK)
			{
				LPSHELLFOLDER pParentFolder;
				LPCITEMIDLIST pidlLast;
				if (pSHBindToParent(pidl, IID_IShellFolder, (void**)&pParentFolder, &pidlLast) == S_OK)
				{
					IContextMenu* picm;
					if (pParentFolder->GetUIObjectOf(hMainWnd, 1, &pidlLast, IID_IContextMenu, NULL, (void**)&picm) == S_OK)
					{
						HMENU hMenuPopup = CreatePopupMenu();
						if (hMenuPopup)
						{
							if ( SUCCEEDED( picm->QueryContextMenu(hMenuPopup, 0, 1, 0x7fff, CMF_NORMAL) ))
							{
								// when menu is shown not all the menu items are there...
							}
							DestroyMenu(hMenuPopup);
						}
						picm->Release();
					}
					pParentFolder->Release();
				}
				CoTaskMemFree(pidl);
			}
			pDesktopFolder->Release();
		}
	}

	return 0;
}



- thanks
QuestionMFC Publications Pin
sidkraft14-Jun-06 14:13
sidkraft14-Jun-06 14:13 
AnswerRe: MFC Publications Pin
Vaclav14-Jun-06 16:12
Vaclav14-Jun-06 16:12 
Questionusing mci Pin
locoone14-Jun-06 13:28
locoone14-Jun-06 13:28 
AnswerRe: using mci Pin
Hamid_RT14-Jun-06 19:21
Hamid_RT14-Jun-06 19:21 
GeneralRe: using mci [modified] Pin
locoone15-Jun-06 12:10
locoone15-Jun-06 12:10 
GeneralRe: using mci Pin
Hamid_RT15-Jun-06 20:09
Hamid_RT15-Jun-06 20:09 
GeneralRe: using mci [modified] Pin
locoone16-Jun-06 11:50
locoone16-Jun-06 11:50 
GeneralRe: using mci Pin
Hamid_RT16-Jun-06 19:10
Hamid_RT16-Jun-06 19:10 
GeneralRe: using mci Pin
locoone16-Jun-06 23:19
locoone16-Jun-06 23:19 
QuestionSetupDiEnumDeviceInterfaces() Pin
kitty514-Jun-06 11:04
kitty514-Jun-06 11:04 
AnswerRe: SetupDiEnumDeviceInterfaces() Pin
Jörgen Sigvardsson14-Jun-06 11:41
Jörgen Sigvardsson14-Jun-06 11:41 
Questionscanf bug? Pin
Deian14-Jun-06 9:53
Deian14-Jun-06 9:53 
AnswerRe: scanf bug? Pin
David Crow14-Jun-06 10:46
David Crow14-Jun-06 10:46 
GeneralRe: scanf bug? Pin
Deian14-Jun-06 11:11
Deian14-Jun-06 11:11 
AnswerRe: scanf bug? Pin
Arvind Bharti14-Jun-06 17:16
Arvind Bharti14-Jun-06 17:16 
GeneralRe: scanf bug? Pin
Deian14-Jun-06 21:50
Deian14-Jun-06 21:50 
GeneralRe: scanf bug? Pin
Arvind Bharti15-Jun-06 23:27
Arvind Bharti15-Jun-06 23:27 

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.