home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi 4 Bible
/
Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso
/
source
/
COLORDLL
/
MAIN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-05-12
|
1KB
|
47 lines
unit Main;
interface
uses
// ShareMem, { Not required by this example }
Windows, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TMainForm = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.DFM}
{- Declare external function in the Colorlib.Dll }
function FBGetColors(var FColor, BColor: TColor): WordBool; far;
external 'Colorlib.dll';
{- Activate color dialog in the Colorlib.Dll }
procedure TMainForm.Button1Click(Sender: TObject);
var
FColor, BColor: TColor;
begin
FColor := Font.Color; { Form's text color }
BColor := Color; { Window background color }
if FBGetColors(FColor, BColor) then { Call DLL ! }
begin
Memo1.Color := BColor; { Assign window color }
Memo1.Font.Color := FColor; { Assign text color }
end;
end;
end.