home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 11
/
Freelog011.iso
/
BestOf
/
PhoenixMail
/
Source
/
phoenix
/
FMSpellCheck.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-02-05
|
3KB
|
113 lines
{*****************************************************************************
*
* FMSpellCheck.pas - Check the spell of e-mails (12-September-1998)
*
* Copyright (c) 1998-99 Michael Haller
*
* Author: Michael Haller
* E-mail: michael@discountdrive.com
* Homepage: http://www.discountdrive.com/sunrise
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
*----------------------------------------------------------------------------
*
* Revision history:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
*
*****************************************************************************}
unit FMSpellCheck;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, PXStuff, ShellAPI;
type
TSpellCheckForm = class(TForm)
Panel1: TPanel;
Timer1: TTimer;
Label1: TLabel;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
procedure WndProc(var Message: TMessage); override;
public
{ Public declarations }
Ready: Boolean;
procedure SpellCheck;
end;
var
SpellCheckForm: TSpellCheckForm;
implementation
{$R *.DFM}
uses
Main;
procedure TSpellCheckForm.SpellCheck;
begin
Ready := False;
MainForm.RichEdit1.Lines.SaveToFile(sTempSpellCheckFile);
ShellExecute(Handle, 'open', PChar(sSpellCheckerFile), PChar('"'+sTempSpellCheckFile+'" '+IntToStr(Handle)), PChar(ExtractFilePath(sTempSpellCheckFile)), SW_SHOWNORMAL);
repeat
Application.HandleMessage;
until Ready;
if FileExists(sTempSpellCheckFile) then
MainForm.RichEdit1.Lines.LoadFromFile(sTempSpellCheckFile);
end;
procedure TSpellCheckForm.WndProc(var Message: TMessage);
begin
if Message.Msg = WM_SPELLCHECKFINISHED then begin
Ready := True;
end else
inherited WndProc(Message);
end;
procedure TSpellCheckForm.FormCreate(Sender: TObject);
begin
ClientWidth := Panel1.Width;
ClientHeight := Panel1.Height;
if bOfficeFonts then Font.Name := sOfficeFontName;
end;
procedure TSpellCheckForm.Timer1Timer(Sender: TObject);
begin
if not Visible then Exit;
Timer1.Enabled := False;
try
SpellCheck;
except end;
DeleteFile(sTempSpellCheckFile);
Close;
end;
procedure TSpellCheckForm.FormShow(Sender: TObject);
begin
Timer1.Enabled := True;
end;
end.