|  |  | 
|  | 
|  | 
|  | | 
 Description:
 
 ExpandEnvironmentStrings supplant in a Textausdruck any Enviroment-Variables through your expandierten values. If from the Registry Paths read go, should these first to the Weiterverarbeitung through these function skillful go.
 
 
 
 
 Deklaration:
 
 DEF @ExpandEnvironmentStrings(3)!kernel32,ExpandEnvironmentStringsA
 
 
 
 
 Parameter:
 
 
  1.Parameter: address one Strings or Memory-Variable with a String, the Enviroment-Variables contains. 
  2.Parameter: Memory-Variable, The whom expandierten String aufnimmt. 
  3.Parameter: Size the Memory-Variable from Parameter 2 in Bytes as LongInt. 
 
 
 Return Value:
 
 0 with failure. otherwise The Number of letters in the Rückgabestring. is Parameter 2 To small dimensioniert, can so over these function too The benötigte Size of Parameter 2 find out.
 
 Examples:
 
 CompileMarkSeparation
 DEF @ExpandEnvironmentStrings(3)!kernel32,ExpandEnvironmentStringsA
Declare Fehler&,ENVErgebnis#,Button&
Declare ENVERGEBNIS$
PROC VariableErsetzenInString
    Parameters ZuValidierenderText$
    der interne Puffer muß das gesamte Environment abdecken können
    sonst gibt es einen Fehler bezüglich der Bereichsgrenze
    Dim ENVErgebnis#,261
    LET ENVERGEBNIS$=
    LET FEHLER&=@ExpandEnvironmentStrings(@addr(ZuValidierenderText$),ENVErgebnis#,261)
    Let ENVERGEBNIS$= @String$(ENVErgebnis#,0)
    Dispose ENVErgebnis#
    RETURN ENVERGEBNIS$
endproc
Windowstyle 31
Windowtitle Umgebungsvariablen ersetzen
Window 0,0-640,440
Let Button&=@CreateButton(%HWND,Variable eingeben,20,300,200,30)
While 0=0
    Waitinput
    IF @Getfocus(Button&)
        VariableErsetzenInString @input$(Umgebungsvariable eingeben:,Ersetzen,%WINDIR%)
        Print @$(0)
    endif
wend
 | 
 | 
|  | 
|  |  | 
|  | 
| 
 
 
 |