Autor Beitrag
Calyptus
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 386

Win Xp Prof
D3, D6 Pers, D7 Ent
BeitragVerfasst: So 13.03.05 10:35 
Wenn ich auf eine Datei in Windows doppelklicke, dann will ich das diese mit meinem Programm geöffnet wird. Aber wie bekommt mein Programm mit auf welche datei ich geklickt habe?

P.S. Ich weiß nicht nach was ich da suchen soll, also sorry wenns schonmal so ein Thread gab.

_________________
Luft- und Raumfahrtechnik an der Uni Stuttgart
Casimodo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26

WinXP Pro, Win 98 SE
D7 Enterprise
BeitragVerfasst: So 13.03.05 10:40 
Rechtsklick auf die Datei dann "Datei Öffnen mit..." und da dein Programm auswählen das dürfte klappen.
3rdnuss
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 139



BeitragVerfasst: So 13.03.05 10:42 
Mhhh.

Also evtl. mit FindWindow oder FindWindowEx .

Oder meinst du etwas anderes?

Gruß Felix
Holgerwa
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 325

WIN XP Pro, Vista Business
Delphi 7 Pro, BDS 2006 Pro
BeitragVerfasst: So 13.03.05 10:54 
Hallo,

wenn ich es richtig verstanden habe, dann willst Du eine Dateiendung mit Deinem Programm verbinden, sodaß bei einem Doppelklick (z.B. im Windows-Explorer) eine Datei mit dieser Endung (z.B. .txt) dann mit Deinem Programm gestartet wird?

- Starte Windows-Explorer, und im Menü Extras, click auf Ordneroptionen, und dann auf den Tab Dateitypen.
- In der Liste suchst Du die Dateiendung, die Du mit Deinem Programm verbinden willst.
- Markiere Sie und klicke auf "Ändern"
- Jetzt kommt eine Liste mit Anwendungen, die Du zuweisen kannst. Wenn Dein Programm nicht drin ist, click auf Durchsuchen und such die .exe Datei.
- Jetzt noch ein Check der Option "Dateityp immer mit dem ausgewählten Programm öffnen", und alle Fenster mit OK schließen.

Danach sollte Dein Programm aufgerufen werden, wenn so eine Datei doppelt angeklickt wird. Wenn ich mich nicht irre, erscheint sogar das Icon Deines Programmes dann als Icon der entsprechenden Datei.

Holger
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 13.03.05 10:56 
Hallo,
schau mal dort: [url=www.delphi-forum.de/...highlight=extension]
TFileTypeRegistration (Dateityp registrieren)[/url]
MfG Lannes
Calyptus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 386

Win Xp Prof
D3, D6 Pers, D7 Ent
BeitragVerfasst: So 13.03.05 11:08 
Ich hab das jetzt alles gemacht aber dann wird nur mein Programm gestartet. Aber woher weiß ich über welche datei das Programm aufgerufen wurde? Ich weiß ja immernoch nicht welche Datei ich im Programm laden soll. Ich hoffe mal ihr wüsst was ich mein...

_________________
Luft- und Raumfahrtechnik an der Uni Stuttgart
Holgerwa
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 325

WIN XP Pro, Vista Business
Delphi 7 Pro, BDS 2006 Pro
BeitragVerfasst: So 13.03.05 11:20 
Hallo Calyptus,

Wenn der Dateityp mit Deinem Programm verbunden ist, muß Dein Programm auch die Kommandozeilenparameter abfragen.
Es wird ja durch den Doppelklick so gestartet:
DeinProgramm.exe Datei.abc

Jetzt mußt Du in Deinem Programm den Kommandozeilenparameter abfragen, und bekommst damit den Dateinamen, den Du öffnen mußt.
Sowas wie:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  if ParamCount > 0 then // es ist mindestens ein Parameter vorhanden
    begin
      DeineOeffnenFunktion (ParamStr (1)); // ParamStr (1) ist der erste Parameter
    end;

Ist es das, was Du gemeint hast?

Holger
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 13.03.05 11:40 
Hallo,

dort wird es ausführlich beschrieben:
...die übergebenen Parameter auslesen?

MfG Lannes
Calyptus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 386

Win Xp Prof
D3, D6 Pers, D7 Ent
BeitragVerfasst: So 13.03.05 11:46 
Danke genau nach dem hab ich gesucht!

_________________
Luft- und Raumfahrtechnik an der Uni Stuttgart