I use this code to check if outlook is the default mail client: Function IsOutlookIsDefaultEmailPrg:Boolean; var reg: TRegistry; key: string; begin Result:= False; with TRegistry.Create do TRY RootKey:= HKEY_LOCAL_MACHINE; if OpenKeyReadOnly('Software Clients Mail') then begin key:= Uppercase(ReadString(')); //default value end; result:= (Pos('MICROSOFT OUTLOOK',Key) > 0); FINALLY Free; END; end; it works in general, but on some pc's it has been reported not to work, I checked and the registry key was there. Is Pos case sensitive?

(and put the gmail favicon in c: windows then change your email provider in Set Program Access and Defaults. LifeHacker recommends using an application called Affixa which registers itself as the default email application on your computer and handles file uploading to Gmail. Moj syabr sachinenne pa bel move 2017. The requested action. Please install an email program or, if one is already installed, create an association in the Default Programs control panel. One go about fixing it? Well, in this article, I'll show you how to get rid of this issue using Registry Editor. HKEY_LOCAL_MACHINE SOFTWARE Clients Mail.

Any idea why this cannot work at times? Any better suggestion? I see you are using the HKLM key to check the default client but this can be user depended, so you should really check the HKCU entry (and fall back to HKLM if HKCU does not have the entry). I also removed the With statement and used the ContainsText (include StrUtils unit) function instead of Pos: function IsOutlookTheDefaultEmailClient:Boolean; var Reg: TRegistry; begin Result:= False; Reg:= TRegistry.Create; try // first check HKCU Reg.RootKey:= HKEY_CURRENT_USER; if Reg.OpenKeyReadOnly('Software Clients Mail') then begin Result:= ContainsText(Reg.ReadString('), 'Microsoft Outlook'); Reg.CloseKey; end // fall back to HKLM else begin Reg.RootKey:= HKEY_LOCAL_MACHINE; // this part is susceptible to registry virtualization and my need elevation! If Reg.OpenKeyReadOnly('Software Clients Mail') then begin Result:= ContainsText(Reg.ReadString('), 'Microsoft Outlook'); Reg.CloseKey; end; end; finally Reg.Free; end; end; EDIT The only time this code can fail is when comes into play. This is typical in UAC scenarios. Please check on a failing computer if this key exists in regedit: HKCU Software Classes VirtualStore MACHINE SOFTWARE Clients Mail if that is the case, your application will read this key and not the real HKLM key.

The only solution is request elevation or run your application as administrator. This is my understanding of the issues: • The Pos function is case-sensitive. So if the value is Microsoft Outlook then your test will not find it. You should instead use.

Not only does that do what you want, but it is much more readable than Pos()>0. • The in HKCU Software Clients Mail. If no default mail client is found there, then it checks in HKLM Software Clients Mail.

You should do likewise. • On Windows 7 and later, both HKCU Software Clients and HKLM Software Clients Mail are. On earlier versions of Windows they are. There is potential for errors there. You should use KEY_WOW64_64KEY to access the 64 bit view of the registry.

In order to find out what the default email client is, I found the same information over and over again: Look at the default string in HKLM Software Clients Mail. (see for example this ) However, this seems not to be true for all OSs and/or situations: I have two machines running Win7 64bit, let's call them A and B. A has Outlook 2010 64bit and Thunderbird 3 32bit installed. B has Outlook 2007 32bit and Thunderbird 3 32bit installed.

Both A and B have Thunderbird set as their default mail client. However, the state of the registry is not as I expected it: On machine A, both HKLM Software Clients Mail and HKLM Software Wow6432Node Clients Mail have an empty string as the default string value. On B, both those keys contain Microsoft Outlook as the default string value, which is clearly wrong. Further investigation revealed that the correct value seems to be written to HKCU Software Clients Mail on both machines. I want my application to handle this correctly for all cases. It makes kinda sense, that Win7 now seems to hold a separate default mail client for each user, but it appears rather inconsistent.

When looking at the plethora of information that points to HKLM Software Clients Mail, it seems obvious that previous versions of Windows handled this differently and always wrote to that location. Learn how to think logically. So when did this change? Has the wrong value on machine B any meaning? If not, why does it get written there in the first place?

Hkeylocalmachine

Does the mix of 64bit and 32bit email clients on the same computer change anything? I would most appreciate if anyone would share reliable information or documentation that explains this topic! Maybe there is a Win32 API function that returns the correct value?