Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Umgebungs Variabeln (https://www.delphipraxis.net/14905-umgebungs-variabeln.html)

MasterC 17. Jan 2004 20:16


Umgebungs Variabeln
 
Hi,

Wie lassen sich in Delphi Umgebungs Variabeln setzten?

CalganX 17. Jan 2004 20:23

Re: Umgebungs Variabeln
 
Hi,
wennn du die JVCL installiert hast findest du in der Unit JclSysInfo die Funktion
Aus der Delphi-JVCL-Hilfe
Code:
[b]function[/b] SetEnvironmentVar([b]const[/b] Name: [b]string[/b]; [b]const[/b] Value: [b]string[/b]): Boolean;


Chris

MasterC 18. Jan 2004 11:09

Re: Umgebungs Variabeln
 
Hm, das geht doch auch bestimmt ohne JVCL, oder?

Mirilin 18. Jan 2004 13:41

Re: Umgebungs Variabeln
 
:hi:

könntest ja schauen, wie es in der JCL gemacth wird :wink:

mfg Tobias

CalganX 18. Jan 2004 13:46

Re: Umgebungs Variabeln
 
Hi,
wie ich bereits vermutet hatte gibt es die Funktion SetEnvironmentVariable in der Unit Windows.
Was mich allerdings wundert ist, dass weder im PSDK, noch in der Delphi-Hilfe davon irgendwas erwähnt ist... :gruebel:

Chris

Mirilin 18. Jan 2004 13:59

Re: Umgebungs Variabeln
 
:hi:

:gruebel: in meiner PSDK steht was :
Die PSDK sagt
SetEnvironmentVariable

The SetEnvironmentVariable function sets the contents of the specified environment variable for the current process.

Code:
BOOL SetEnvironmentVariable(
  LPCTSTR lpName,
  LPCTSTR lpValue
);
Parameters
lpName
[in] Pointer to a null-terminated string that specifies the name of the environment variable. The operating system creates the environment variable if it does not exist and lpValue is not NULL.
lpValue
[in] Pointer to a null-terminated string that specifies the contents of the environment variable. An environment variable has a maximum size limit of 32,767 bytes, including the trailing null terminator.
If this parameter is NULL, the variable is deleted from the current process's environment.

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
This function has no effect on the system environment variables or the environment variables of other processes. For more information, see Environment Variables.

Windows 95/98/Me: SetEnvironmentVariableW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.


mfg Tobias

CalganX 18. Jan 2004 14:01

Re: Umgebungs Variabeln
 
Hi,
na super... :( Naja, dann hoffe ich mal, dass es nur ein Fehler in der Installation ist und nicht mein Download kaputt ist. :(

Chris

MasterC 20. Jan 2004 16:43

Re: Umgebungs Variabeln
 
JVCL braucht man nun wirklich nicht dafür...http://www.delphi-treff.de/content/e...ex.php4?id=513

Habs selber gefunden. :)

MathiasSimmack 20. Jan 2004 17:23

Re: Umgebungs Variabeln
 
Hab auch noch ein paar Links ins DF, damit ich auf meinen 1100. Beitrag komme ;):

...systemweit Umgebungsvariablen setzen/lesen?
...Umgebungsvariable in einem String auflösen?


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:17 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