Click here to Skip to main content
15,917,795 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF: Is there any Flip Book Control available? Pin
Pete O'Hanlon19-Jul-09 22:18
mvePete O'Hanlon19-Jul-09 22:18 
QuestionDeriving new class [modified] Pin
#realJSOP18-Jul-09 2:08
professional#realJSOP18-Jul-09 2:08 
QuestionWPF Call to WCF Service - Sessions? Pin
jeremyadell17-Jul-09 14:47
jeremyadell17-Jul-09 14:47 
AnswerRe: WPF Call to WCF Service - Sessions? Pin
Mark Salsbery18-Jul-09 7:09
Mark Salsbery18-Jul-09 7:09 
GeneralRe: WPF Call to WCF Service - Sessions? Pin
jeremyadell18-Jul-09 9:57
jeremyadell18-Jul-09 9:57 
GeneralRe: WPF Call to WCF Service - Sessions? Pin
Mark Salsbery18-Jul-09 16:59
Mark Salsbery18-Jul-09 16:59 
GeneralRe: WPF Call to WCF Service - Sessions? Pin
jeremyadell18-Jul-09 17:28
jeremyadell18-Jul-09 17:28 
QuestionHow to programmatically add links to quick launch bar and start menu under WPF Pin
fjparisIII17-Jul-09 13:43
fjparisIII17-Jul-09 13:43 
I did this a couple years ago under MFC but it required going to COM, C++ code like this:

HRESULT Sheet::UpdateLink(CString strSourcePath, CString strLinkPath, 
	                 CString strDesc, CString strArguments) 
{ 
	HRESULT hres; 
	IShellLink* psl; 

	// Get a pointer to the IShellLink interface. 
	hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, 
		IID_IShellLink, (LPVOID*)&psl); 
	if (SUCCEEDED(hres)) 
	{
		// Query IShellLink for the IPersistFile interface for loading 
		// from and saving the shortcut in persistent storage. 
		IPersistFile* ppf; 
		hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf); 

		if (SUCCEEDED(hres)) 
		{ 
			LPOLESTR oleLinkPath = (LPOLESTR)(LPCTSTR)strLinkPath;

			// First, try to load an existing link to get current settings.
			hres = ppf->Load(oleLinkPath, STGM_READWRITE);
			if (FAILED(hres))
			{
				// Just assume link doesn't exist
			}

			// Now make the new settings.
			hres = psl->SetPath(strSourcePath); 
			hres = psl->SetDescription(strDesc);

			// If the client specified arguments, set them also.
			if (strArguments.GetLength())
			{
				hres = psl->SetArguments(strArguments);
			}

			// Save the link by calling IPersistFile::Save.
			hres = ppf->Save(oleLinkPath, TRUE);
			ppf->Release();
		}
		psl->Release(); 
	}
	return hres; 
}

I'd like to think those days are history, but after researching for a couple hours, I couldn't find a single mention about how to do this under WPF, or under .NET in general. Is there a way?

If I do have to use COM, how difficult would it be to wrap the above UpdateLink function into something I could call from WPF?

So far I've avoided going to unmanaged code by using System.Runtime.InteropServices stuff. I've done lots of neat stuff with functions in shell32.dll, like applying bitmaps to buttons and labels, sending files to the recycle bin (using SHFileOperation), calling ShellExecuteEx, etc., but no COM stuff. Is there a nightmare in my future if I try to do this?
AnswerRe: How to programmatically add links to quick launch bar and start menu under WPF Pin
Christian Graus17-Jul-09 16:17
protectorChristian Graus17-Jul-09 16:17 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF Pin
fjparisIII17-Jul-09 16:34
fjparisIII17-Jul-09 16:34 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF Pin
Christian Graus17-Jul-09 16:45
protectorChristian Graus17-Jul-09 16:45 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF Pin
fjparisIII17-Jul-09 16:56
fjparisIII17-Jul-09 16:56 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF (SOLVED) Pin
fjparisIII18-Jul-09 10:49
fjparisIII18-Jul-09 10:49 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF (NOT SOLVED after all, sigh...) Pin
fjparisIII18-Jul-09 12:26
fjparisIII18-Jul-09 12:26 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF (SOLVED) Pin
samip shrestha29-Nov-09 18:59
samip shrestha29-Nov-09 18:59 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF (SOLVED) Pin
fjparisIII30-Nov-09 12:49
fjparisIII30-Nov-09 12:49 
AnswerRe: How to programmatically add links to quick launch bar and start menu under WPF Pin
Mark Salsbery19-Jul-09 8:31
Mark Salsbery19-Jul-09 8:31 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF Pin
fjparisIII19-Jul-09 13:25
fjparisIII19-Jul-09 13:25 
GeneralRe: How to programmatically add links to quick launch bar and start menu under WPF Pin
fjparisIII19-Jul-09 13:29
fjparisIII19-Jul-09 13:29 
QuestionTwo-way binding problem Pin
Ravadre17-Jul-09 9:42
Ravadre17-Jul-09 9:42 
AnswerRe: Two-way binding problem Pin
User 27100918-Jul-09 5:21
User 27100918-Jul-09 5:21 
GeneralRe: Two-way binding problem Pin
Ravadre18-Jul-09 5:56
Ravadre18-Jul-09 5:56 
GeneralRe: Two-way binding problem Pin
User 27100918-Jul-09 6:04
User 27100918-Jul-09 6:04 
GeneralRe: Two-way binding problem Pin
Ravadre18-Jul-09 6:10
Ravadre18-Jul-09 6:10 
GeneralRe: Two-way binding problem Pin
User 27100918-Jul-09 6:14
User 27100918-Jul-09 6:14 

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.