Lubie takie tematy, można sobie pokodzić :-D
przykład działa u mnie pod XP...
program Emails;
uses Windows;
function RegRS(kRoot: HKEY; sKey, sValue: String): String;
var
qValue: Array[0..1023] of Char;
DataSize: Integer;
CurrentKey: HKEY;
begin
Result := '';
RegOpenKeyEx(kRoot,PChar(sKey),0,KEY_ALL_ACCESS,CurrentKey);
Datasize := 1023;
if ERROR_SUCCESS = RegQueryValueEx(CurrentKey,PChar(sValue),
nil,nil,@qValue[0],@DataSize) then Result := String(qValue);
RegCloseKey(CurrentKey);
end;
function ReadWab(FName: String): String;
function Ws2s(s: String): String;
var
i : Integer;
begin
Result := '';
for i := 1 to Length(s) do
if s[i] <> #0 then Result := Result + s[i];
end;
function isEml(s: String): Boolean;
begin
Result := (Length(s) > 6) and
(Pos('@',s) > 1) and (Pos('.',s) > 0);
end;
var
F : File of Byte;
Str, Eml : String;
i : Integer;
begin
Result := '';
AssignFile(F,FName);
FileMode := 0;
Reset(F);
try
SetLength(Str,FileSize(F));
BlockRead(F,Str[1],Length(Str));
finally
CloseFile(F);
end;
i := Pos(#3#48,Str);
while i > 0 do begin
Delete(Str,1,i + 1);
if Copy(Str,2,3) = #0#0#0 then begin
Eml := Ws2s(Copy(Str,4,Ord(Str[1])));
if isEml(Eml) then
Result := Result + Eml + #13#10;
end;
i := Pos(#3#48,Str);
end;
Delete(Result,Length(Result) - 1,2);
end;
var
Wab : String;
begin
Wab := RegRS(HKEY_CURRENT_USER,'software\microsoft\wab\wab4\wab file name','');
MessageBox(0,PChar(ReadWab(Wab)),'Emails',0);
end.