Click here to Skip to main content
15,917,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
BaldwinMartin20-Nov-03 15:19
BaldwinMartin20-Nov-03 15:19 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
Peter Molnar20-Nov-03 15:34
Peter Molnar20-Nov-03 15:34 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
Peter Molnar20-Nov-03 15:51
Peter Molnar20-Nov-03 15:51 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
Anonymous20-Nov-03 16:06
Anonymous20-Nov-03 16:06 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
Peter Molnar20-Nov-03 16:13
Peter Molnar20-Nov-03 16:13 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
BaldwinMartin20-Nov-03 19:25
BaldwinMartin20-Nov-03 19:25 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
BaldwinMartin20-Nov-03 19:48
BaldwinMartin20-Nov-03 19:48 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
Peter Molnar21-Nov-03 1:12
Peter Molnar21-Nov-03 1:12 
Try this:
HKEY hKey;
TCHAR szDefaultMailClientPath[MAX_PATH] = {0};
DWORD dwSize = MAX_PATH;
if (RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("mailto\\shell\\open\\command"), 0, KEY_READ, &hKey) == ERROR_SUCCESS &&
	RegQueryValueEx(hKey, _T(""), 0, NULL, (BYTE*)&szDefaultMailClientPath, &dwSize) == ERROR_SUCCESS)
{
	CString sPathWithCL(szDefaultMailClientPath);
	CString sPath = sPathWithCL.Mid(sPathWithCL.Find('"') + 1,sPathWithCL.ReverseFind('"') - sPathWithCL.Find('"') - 1);
	CString sEnvString = sPath.Mid(sPath.Find('%'),sPath.ReverseFind('%') - sPath.Find('%') + 1);
	if (sEnvString.GetLength())
	{
		TCHAR szEnvStringResolution[MAX_PATH] = {0};
		ExpandEnvironmentStrings(sEnvString,szEnvStringResolution,MAX_PATH);
		sPath.Replace(sEnvString,szEnvStringResolution);
	}
	MessageBox(sPath);
}


Peter Molnar
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
BaldwinMartin21-Nov-03 8:02
BaldwinMartin21-Nov-03 8:02 
GeneralRe: How do you get the default email client on 95/98/98se/me/xp/nt/2000 Pin
Peter Molnar21-Nov-03 9:28
Peter Molnar21-Nov-03 9:28 
GeneralFunction decorators Pin
Abin20-Nov-03 13:38
Abin20-Nov-03 13:38 
GeneralRe: Function decorators Pin
Terry O'Nolley20-Nov-03 13:50
Terry O'Nolley20-Nov-03 13:50 
GeneralRe: Function decorators Pin
Jörgen Sigvardsson20-Nov-03 14:14
Jörgen Sigvardsson20-Nov-03 14:14 
GeneralRe: Function decorators Pin
Terry O'Nolley20-Nov-03 16:14
Terry O'Nolley20-Nov-03 16:14 
GeneralRe: Function decorators Pin
Michael Dunn20-Nov-03 14:31
sitebuilderMichael Dunn20-Nov-03 14:31 
GeneralThanks to all of you Pin
Abin20-Nov-03 15:51
Abin20-Nov-03 15:51 
GeneralRe: Thanks to all of you Pin
bni77720-Nov-03 17:47
bni77720-Nov-03 17:47 
GeneralWord Automation Pin
Member 54540420-Nov-03 13:27
Member 54540420-Nov-03 13:27 
GeneralRe: Word Automation Pin
l a u r e n20-Nov-03 13:29
l a u r e n20-Nov-03 13:29 
Generalvisual layering Pin
halblonious20-Nov-03 13:01
halblonious20-Nov-03 13:01 
GeneralRe: visual layering Pin
l a u r e n20-Nov-03 13:28
l a u r e n20-Nov-03 13:28 
GeneralRe: visual layering Pin
halblonious20-Nov-03 21:01
halblonious20-Nov-03 21:01 
Generalto confinning users for del,rename & format Pin
Mahmoud Komeily20-Nov-03 10:30
Mahmoud Komeily20-Nov-03 10:30 
GeneralRe: to confinning users for del,rename & format Pin
John R. Shaw20-Nov-03 12:33
John R. Shaw20-Nov-03 12:33 
GeneralRe: to confinning users for del,rename & format Pin
Peter Molnar20-Nov-03 13:29
Peter Molnar20-Nov-03 13:29 

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.