Puedes ponerla en la sección
Public de tu Form, algo así:
Código Delphi
[-]type
TForm1 = class(TForm)
private
protected
public
function GetWindowsDir:String;
published
end;
y luego la implementas como:
Código Delphi
[-]function TForm1.GetWindowsDir:String;
var r,s:String;
begin
s:=StringOfChar(#0,255);
GetWindowsDirectory(pchar(s),255);
result:=IncludeTrailingBackSlash(Trim(s));
end;