Menyimpan Posisi Form


Tips & Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online
unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;

type

TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

uses IniFiles;

procedure TForm1.FormCreate(Sender: TObject);
var
INI: TIniFile;
begin
INI := TIniFile.Create(ChangeFileExt(ParamStr(0), ‘.INI’));
Top  := INI.ReadInteger(ClassName, ‘Top’, 0);
Left := INI.ReadInteger(ClassName, ‘Left’, 0);
INI.Free;
end;

procedure TForm1.FormDestroy(Sender: TObject);
var
INI: TIniFile;
begin
INI := TIniFile.Create(ChangeFileExt(ParamStr(0), ‘.INI’));
INI.WriteInteger(ClassName, ‘Top’, Top);
INI.WriteInteger(ClassName, ‘Left’, Left);
INI.Free;
end;

end.

TransCODE Software

Kirim Email dengan delphi


Tips & Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online
unit callMail;

 

 

interface

uses

Windows, Mengesang, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,StdCtrls,ShellApi;  type

TForm1 = class(TForm)

Button1: TButton;

Label1: TLabel;

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.DFM}

procedure
TForm1.Button1Click(Sender: TObject);

var

strTujuan, strSubject, strIsi,Param : String;

begin

strTujuan := ‘iklanwaluyo@Gmail.com‘;

strSubject := ‘Subject‘;

strIsi := ‘Isi Text‘;

Param :=’mailto:’ + strTujuan + ‘?subject=’ + strSubject +’&Body=’ +    strIsi;

ShellExecute(Form1.handle,’open’,PChar(Param),nil,nil,SW_SHOWNORMAL);

end;

end.

TransCODE Software