Autor Beitrag
blackbirdXXX

ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1077
Erhaltene Danke: 1

Ubuntu Dapper

BeitragVerfasst: Sa 17.05.03 07:39 
Ich habe einen HTML Editor programmiert und möchte Menüknopf anlegen der den Internet Explorer mit meinem Dokument öffnet.

Ich habe es so:
ausblenden Delphi-Quelltext
1:
ShellExecute(0'open', pchar('iexplore ') + pchar(ffilename),nilnil, SW_SHOWNORMAL);					


und so:
ausblenden Delphi-Quelltext
1:
ShellExecute(0'open''iexplore ' + pchar(ffilename),nilnil, SW_SHOWNORMAL);					


probiert. Beide führen zu keinem Ergebnis. der Compilierer zeigt mir an das String und PChar nicht kompatibel ist und Operator in dieser Umwandlung nicht möglich.

Vielleicht kann mir einer helfen.

Der ganze Text:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Preview1Click(Sender: TObject);
begin
  if FFileName = 'Unbenannt' then
  begin
   Speichernunter1.Click;
   ShellExecute(0'open', pchar('iexplore ') + pchar(ffilename),nilnil, SW_SHOWNORMAL);
  end
  else
  begin
    Editor.Lines.SaveToFile(FFileName);
    Editor.Modified := False;
    SetModified(False);
    tempstr := 'iexplore.exe ' + FFileName;
    ShellExecute(0'open', tempstr,nilnil, SW_SHOWNORMAL);
  end;
end;

_________________
Klein, schwarz und ärgert Techniker? Jumper!
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 17.05.03 07:44 
ausblenden Quelltext
1:
ShellExecute(0, 'open', PChar('iexplore ' + ffilename),nil, nil, SW_SHOWNORMAL);					
blackbirdXXX Threadstarter

ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1077
Erhaltene Danke: 1

Ubuntu Dapper

BeitragVerfasst: Sa 17.05.03 07:52 
Danke. Das funzt

_________________
Klein, schwarz und ärgert Techniker? Jumper!
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 17.05.03 12:05 
kleiner tip: du kannst statt dem iexplore auch einfach nur die URL als Programmpfad angeben. dann wird die URL automatisch im Standardbrowser geöffnet !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
rancor187
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Di 01.07.03 23:47 
matze hat folgendes geschrieben:
kleiner tip: du kannst statt dem iexplore auch einfach nur die URL als Programmpfad angeben. dann wird die URL automatisch im Standardbrowser geöffnet !


kann mir jem. den Code posten und auch noch sagen wie man die ShellExecute einbindet. Ich will eine Datei starten, die im selben verzeichnis liegt wie das Programm.
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Do 03.07.03 14:06 
@Rancor: Zum einbinden kannst du z.B. den Code oben nehmen und ihn auf eine Button-Klick Prozedur setzen und in die Uses-Anweisung nimmst du noch ShellApi auf..

_________________
Hasta La Victoria Siempre
Unzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 57



BeitragVerfasst: So 06.07.03 09:04 
Hier ist mal ein Code zum öffnen einer URL:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
uses ShellApi;
//...
procedure TForm1.Preview1Click(Sender: TObject);
begin
  if FFileName = 'Unbenannt' then
  begin
   Speichernunter1.Click;
   ShellExecute(0'open',pchar(ffilename),nil, pchar(filedir), SW_SHOW);
  end
  else
  begin
    Editor.Lines.SaveToFile(FFileName);
    Editor.Modified := False;
    SetModified(False);
    ShellExecute(0'open', pchar(ffilename),nil, pchar(filedir), SW_SHOW);
  end;
end;

Er öffnet die Datei mit dem aktuell eingestellten Browser von Windows. Das ist besser für Mozilla/Netscape/Opera-Nutzer ;) .

Gruß!
Unzi