+ Reply to Thread
Results 1 to 2 of 2

Thread: How to get default browser exe?

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    46

    How to get default browser exe?

    Hi all,

    How to get default browser executable in Windows?

    Is there any direct way to do this?

  2. #2
    Junior Member
    Join Date
    Apr 2012
    Posts
    38
    You can use following example.

    Example:

    Code:
    CString GetDefaultBrowser()
    {
    	CString strDefaultBrowser ;
    	
    	TCHAR szDefaultBrowser[MAX_PATH] ;
    	DWORD dwLength = MAX_PATH ;
    
    	if (S_OK == AssocQueryString(0,
    					 ASSOCSTR_EXECUTABLE,
    					 ".htm",
    					 "open",
    					 szDefaultBrowser,
    					 &dwLength) )
    	{
    		strDefaultBrowser = szDefaultBrowser ;
    	}
    
    	return strDefaultBrowser ;
    }

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts