DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Default Browser

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 412
Location: Tehran, Iran

PostPosted: 20/07/04 09:35    Post subject: Default Browser Reply with quote

Does anybody know how can I set the default browser to my own application?

Any help would be appreciated.

Cheers,
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
Johnny_Bit
Moderator


Joined: 15 Jun 2003
Posts: 154

PostPosted: 20/07/04 18:38    Post subject: Reply with quote

God... i tried to deal with it half year ago & what i know for shure is that it's stored in registry in direct InternetExplorer Settings or it has to deal with extension of html files, the way you can search for it is to set as default browser som non-standard browser and search in registry for values=path of that browser... i'm sure it was working with default editor.
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 412
Location: Tehran, Iran

PostPosted: 21/07/04 07:05    Post subject: Reply with quote

I know where XP keeps the list of installed browsers, and I can add my browser to the list and set it as default. Also, I have no problem on associating relative file types to my application.

However, I couldn't find yet how to associate my browser to the URLs.
Back to top
View user's profile Send e-mail Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 412
Location: Tehran, Iran

PostPosted: 21/07/04 10:11    Post subject: Reply with quote

I found the answer.

The association for the protocols is as same as file types.
Back to top
View user's profile Send e-mail Visit poster's website
Johnny_Bit
Moderator


Joined: 15 Jun 2003
Posts: 154

PostPosted: 25/07/04 16:28    Post subject: Reply with quote

Can You show me where's it's stored, and how to get/set it?
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 412
Location: Tehran, Iran

PostPosted: 25/07/04 22:46    Post subject: Reply with quote

The following is the Inno Setup script I wrote for this purpose.

Code:
[Tasks]
Name: DefaultBrowser; Description: Set QualiWEB Pro as your default &browser

[Registry]

; --- Start Menu Internet

Root: HKLM; SubKey: SOFTWARE\Clients\StartMenuInternet\QWP.EXE; ValueType: string; ValueData: QualiWEB Pro; Flags: uninsdeletekey noerror; Check: StartMenuInternetExists

Root: HKLM; SubKey: SOFTWARE\Clients\StartMenuInternet\QWP.EXE\DefaultIcon; ValueType: string; ValueData: """{app}\QWP.EXE"",0"; Flags: uninsdeletekey noerror; Check: StartMenuInternetExists

Root: HKLM; SubKey: SOFTWARE\Clients\StartMenuInternet\QWP.EXE\shell\open\command; ValueType: string; ValueData: """{app}\QWP.EXE"""; Flags: uninsdeletekey noerror; Check: StartMenuInternetExists

Root: HKCU; Subkey: SOFTWARE\Clients\StartMenuInternet; ValueType: string; ValueData: QWP.EXE; Flags: uninsdeletevalue noerror dontcreatekey; Tasks: DefaultBrowser; Check: StartMenuInternetExists

; --- End of Start Menu Internet

; --- Protocol & File Type Associations

Root: HKCR; Subkey: http\shell\open\command; ValueType: string; ValueData: """{app}\QWP.EXE"" %1"; Flags: uninsdeletevalue noerror dontcreatekey; Tasks: DefaultBrowser

Root: HKCR; Subkey: http\shell\open\ddeexec; ValueType: none; Flags: noerror dontcreatekey deletekey; Tasks: DefaultBrowser

Root: HKCR; Subkey: https\shell\open\command; ValueType: string; ValueData: """{app}\QWP.EXE"" %1"; Flags: uninsdeletevalue noerror dontcreatekey; Tasks: DefaultBrowser

Root: HKCR; Subkey: https\shell\open\ddeexec; ValueType: none; Flags: noerror dontcreatekey deletekey; Tasks: DefaultBrowser

Root: HKCR; Subkey: htmlfile\shell\open\command; ValueType: string; ValueData: """{app}\QWP.EXE"" %1"; Flags: uninsdeletevalue noerror dontcreatekey; Tasks: DefaultBrowser

Root: HKCR; Subkey: htmlfile\shell\opennew\command; ValueType: string; ValueData: """{app}\QWP.EXE"" %1"; Flags: uninsdeletevalue noerror dontcreatekey; Tasks: DefaultBrowser

; --- End of Protocol & File Type Associations

[_code]
function StartMenuInternetExists: Boolean;
begin
  Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Clients\StartMenuInternet');
end;


Consider that because for sending a URL to a running instance of the application, I don't use DDE, I've deleted the related registry entry to perevent Windows error message.

Hope that it helps.
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group