Solved

lunch browser

Posted on 1997-11-02
4
391 Views
Last Modified: 2010-04-04
hi
i would like to know how can i add a the option to my program that do the folow thing ..
when i push on some Tbuttom the program automaticly lunch the browser (explorer/navigatore or other ... the program should find out witch is the current browser)
with a specific Http address ;
10x
asi
0
Comment
Question by:asi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:chrb
ID: 1349347
Hi,

Just use the shellexecute and send the address as file to execute, maybe you must run "start" as program with the address as parameter
0
 

Author Comment

by:asi
ID: 1349348
hi
1)but how can i find out what browser does any local computer has ?
2) what do u mean "maybe you must run                        "start" as program with the address as parameter " can u be more specific , example ?
10x
asi


0
 

Expert Comment

by:chrb
ID: 1349349
I will give you an example, just have to make it first :)

Chr
0
 
LVL 4

Accepted Solution

by:
itamar earned 50 total points
ID: 1349350

Here goes the D2 source-code. Just copy, paste and run !
(Please, think about increasing points if you like this ;)


            >>>>>>>>>>> 

            unit Unit1;

            interface

            uses
              Windows, Messages, SysUtils, Classes, Graphics,
            Controls, Forms, Dialogs,
            StdCtrls,
            ShellAPI;

            type
              TForm1 = class(TForm)
                btnGO: TButton;
                edtURL: TEdit;
            procedure btnGOClick(Sender: TObject);
            procedure ExecuteFile(Command, Params,
            WorkDir:string);
              private
                { Private declarations }
              public
                { Public declarations }
              end;

            var
              Form1: TForm1;

            implementation

            {$R *.DFM}

            procedure TForm1.ExecuteFile(Command, Params,
            WorkDir:string);
            var aux : integer;
            begin
            { convert Pascal string to Null-termintated strings }
            Command := Command + #0;
            Params := Params + #0;
            WorkDir := WorkDir + #0;
            { run/open application/file }
            aux := ShellExecute(Self.Handle,'Open',@Command[1],

            @Params[1], @WorkDir[1], SW_SHOWNORMAL);
            if aux < 32 Then
            MessageDlg('Could not execute ' +
            Command,mtError,[mbOK],0);
            end;

            procedure TForm1.btnGOClick(Sender: TObject);
            begin
            If edtURL.Text <> '' Then
            ExecuteFile('http://' + edtURL.Text,'','');
            end;

            end.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month7 days, 8 hours left to enroll

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question