Hello Jeremy,
Thanks, some of the system information below does not come through due to
parsing so URLEncode would probably sort it tksvm.

Here is what is 'almost done' if anyone want to use it:

procedure TMainform.BugReport1Click(Sender: TObject);
var
   RegIni  : TRegIniFile;
 SI      : TSystemInfo;
 OS      : TOSVersionInfo;
 MemStat : TMemoryStatus;
 di      : longint;
 PathArray : array [0..255] of char;
Mailstring, SystemS: string;
begin
  if msgbox('Please read the helpfile thoroughly before sending email' + #13 +
    '        as most information is within' + #13 +
    '     Do you still want to send an email?', 'Bug Report', true, MB_YESNO)
    = IDNO then exit;
 RegIni := TRegIniFile.Create('');
 with RegIni do
  begin
   RootKey := HKEY_LOCAL_MACHINE;
   LazyWrite := True;
   OpenKey('\SOFTWARE\Microsoft\Windows',False);
   OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion',False);
   Free;
  end;
 GetSystemInfo(SI);
 case Si.dwProcessorType of
  386 : SystemS := 'Intel 386';
  486 : SystemS := 'Intel 486';
  586 : SystemS := 'Intel Pentium';
 end;
 SystemS:=SystemS+'%0A'; //Add a LF to it.
 OS.dwOSVersionInfoSize := sizeof(TOSVERSIONINFO);
 GetVersionEx(OS);
 case OS.dwPlatformId of
  VER_PLATFORM_WIN32s        : SystemS:=SystemS+ 'Windows 3.1x/32s';
  VER_PLATFORM_WIN32_WINDOWS : SystemS:=SystemS+ 'Windows 95';
  VER_PLATFORM_WIN32_NT      : SystemS:=SystemS+'Windows NT';
 end;
  SystemS:=SystemS+'%0A';
 with OS do
  begin
   SystemS:=SystemS+'Major/MinorVer:'+format ('%d.%d', 
[dwMajorVersion,dwMinorVersion])+'%0A';
   SystemS:=SystemS+'Build: '+format('%d', [LOWORD(dwBuildNumber)])+'%0A';
  end;
 MemStat.dwLength := sizeof(TMemoryStatus);
 GlobalMemoryStatus(MemStat);
 with MemStat do
 begin
  SystemS:=SystemS+'MemTotal:'+Format('%d KB',[Trunc(dwTotalPhys/1024)])+'%0A';
  SystemS:=SystemS+'MemAvailable:'+Format('%d KB',[Trunc(dwAvailPhys/1024)])+'%0A';
  SystemS:=SystemS+'MemUsage:'+ Format('%d 
Pct',[trunc(dwAvailPhys/dwTotalPhys*100)])+'%0A';
  SystemS:=SystemS+'SwapFileSetting:'+ Format('%d 
KB',[Trunc(dwTotalPageFile/1024)])+'%0A';
  SystemS:=SystemS+'SwapFileSize:'+ Format('%d 
KB',[Trunc((dwTotalPageFile-dwAvailPageFile)/1024)])+'%0A';
  SystemS:=SystemS+'SwapFileUsage:'+ Format('%d 
Pct',[100-trunc(dwAvailPageFile/dwTotalPageFile*100)])+'%0A';
 end;
 di := DiskSize(3);
 if di <> -1 then
  SystemS:=SystemS+'FreeDriveC:'+ Format('%d MB', [di div 1048576])+'%0A';
 FillChar(PathArray, SizeOf(PathArray), #0);
 GetWindowsDirectory(PathArray,255);
 SystemS:=SystemS+'WinPath:'+Format('%s',[PathArray])+'%0A';
 FillChar(PathArray, SizeOf(PathArray), #0);
 ExpandEnvironmentStrings('%TEMP%', PathArray, 255);
 SystemS:=SystemS+'WinTempPath:'+ Format('%s',[PathArray])+'%0A';
  Mailstring := 'mailto:' + '[EMAIL PROTECTED]';
  MailString := MailString + '?Subject=' + 'Back4WinXP) Bug Report';
  MailString := MailString + '&Body=' + 'System Information:'+'%0A' + SystemS;
  MailString := StringReplace(MailString, ' ', '%20', [rfReplaceAll]);
  ShellExecute(Application.Handle, nil, pchar(Mailstring), nil, nil, 
SW_SHOWNOACTIVATE);
end;

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to