Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi *.ini via Button1 mit Editor öffnen? (https://www.delphipraxis.net/4107-%2A-ini-via-button1-mit-editor-oeffnen.html)

sharkx 15. Apr 2003 15:17


*.ini via Button1 mit Editor öffnen?
 
Hallo!

ich möchte via Button eine *.ini in dem Windows eigenen editor öffnen.

folgendes habe ich probiert ...
Code:
ShellExecute(Application.Handle,'open',PChar(getsystemdir+'\settings.ini');
Leider funktioniert dies aber nicht.
Hat jemand ne andere idee? Wäre super :)

mirage228 15. Apr 2003 15:54

da fehlen doch ein paar Parameter oder?

Delphi-Quellcode:
ShellExecute(Handle, 'open', PChar(getsystemdir+'\settings.ini'), '', '', SW_SHOWNORMAL);
so vielleicht?

sharkx 15. Apr 2003 16:01

Nein leider auch nicht :/

mirage228 15. Apr 2003 16:21

hm... wie sieht die funktion "getsystemdir" aus?

sharkx 15. Apr 2003 16:29

hoffe das dies so richtig ist ...

Code:
VAR sysDirString: STRING;
sysdir: ARRAY[0..Max_path+1] OF CHAR;
BEGIN
GetsystemDirectory(sysDir,MAX_PATH+1);
SysDirString:=StrPas(sysDir);

sharkx 15. Apr 2003 17:36

Ganzes Thema gelöst :)

Code:
procedure TForm1.Configuration1Click(Sender: TObject);
begin
if
ShellExecute(application.handle,Pchar('open'),Pchar('notepad'),Pchar(ExtractFilePath(ParamStr(0))+ 'Settings.ini'),Pchar(''),
sw_ShowNormal) >= 32
  then
    showmessage('Config-File must be reload!.')
      else
        showmessage('Notepad not found!');

end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:44 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz