Menghitung jumlah hari dengan Pemograman Delphi

<=”” b=”” code =”” download=”” source=””>
Silahkan klik gambar di bawah ini untuk mendonwload soucecode nya:

unit UnitJumHari;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Memo1: TMemo;
    Label3: TLabel;
    Label4: TLabel;
    Shape1: TShape;
    Bevel1: TBevel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
    Function DaysPerMonth(YearIn, MonthIn: Integer): Integer;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}
Function TForm1.DaysPerMonth(YearIn, MonthIn: Integer): Integer;
Const
  DaysInMonth: array[1..12] of integer =
            (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
begin
    Result := DaysInMonth[MonthIn];
    If (MonthIn = 2) and IsLeapYear(YearIn) then
        Inc(Result);
End;

procedure TForm1.Button1Click(Sender: TObject);
Var
s1,s2:Integer;
Begin
  s1:=strToint(edit1.text);
  s2:=StrToInt(edit2.text);
  Memo1.Lines.Clear;
  Memo1.Lines.Add(IntToStr(DaysPerMonth(s1,s2)));
  Memo1.Lines.Add(‘Hari’);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
halt;
end;
end.

Silahkan klik gambar di bawah ini untuk mendonwload soucecode nya:

<=”” b=”” code =”” download=”” source=””> Read More……

unit Unit1;

interface

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

type
TForm1 = class(TForm)
Button1: TButton;
edtSubject: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
edtNamaPengirim: TEdit;
edtEmailPengirim: TEdit;
Label4: TLabel;
edtNamaPenerima: TEdit;
edtEmailPenerima: TEdit;
Label5: TLabel;
MemoMessage: TMemo;
Label6: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

uses MAPI;

{$R *.dfm}

function SendMail(const Subject, Body, FileName,
SenderName, SenderEMail,
RecipientName, RecipientEMail: string): Integer;

var
Message: TMapiMessage;
lpSender, lpRecipient: TMapiRecipDesc;
FileAttach: TMapiFileDesc;
SM: TFNMapiSendMail;
MAPIModule: HModule;
begin
FillChar(Message, SizeOf(Message), 0);
with Message do
begin
if (Subject <> ”) then
lpszSubject := PChar(Subject);
if (Body <> ”) then
lpszNoteText := PChar(Body);
if (SenderEmail <> ”) then
begin
lpSender.ulRecipClass := MAPI_ORIG;
if (SenderName = ”) then
lpSender.lpszName := PChar(SenderEMail)
else
lpSender.lpszName := PChar(SenderName);
lpSender.lpszAddress := PChar(SenderEmail);
lpSender.ulReserved := 0;
lpSender.ulEIDSize := 0;
lpSender.lpEntryID := nil;
lpOriginator := @lpSender;
end;
if (RecipientEmail <> ”) then
begin
lpRecipient.ulRecipClass := MAPI_TO;
if (RecipientName = ”) then
lpRecipient.lpszName := PChar(RecipientEMail)
else
lpRecipient.lpszName := PChar(RecipientName);
lpRecipient.lpszAddress := PChar(RecipientEmail);
lpRecipient.ulReserved := 0;
lpRecipient.ulEIDSize := 0;
lpRecipient.lpEntryID := nil;
nRecipCount := 1;
lpRecips := @lpRecipient;
end
else lpRecips := nil;
if (FileName = ”) then
begin
nFileCount := 0;
lpFiles := nil;
end
else
begin
FillChar(FileAttach, SizeOf(FileAttach), 0);
FileAttach.nPosition := Cardinal($FFFFFFFF);
FileAttach.lpszPathName := PChar(FileName);
nFileCount := 1;
lpFiles := @FileAttach;
end;
end;
MAPIModule := LoadLibrary(PChar(MAPIDLL));
if MAPIModule = 0 then
Result := -1
else
try
@SM := GetProcAddress(MAPIModule, ‘MAPISendMail’);
if @SM <> nil then
begin
Result := SM(0, Application.Handle, Message, MAPI_DIALOG or MAPI_LOGON_UI, 0);
end
else
Result := 1;
finally
FreeLibrary(MAPIModule);
end;
if Result <> 0 then
MessageDlg(‘Gagal mengirim email (‘ + IntToStr(Result) + ‘).’, mtError, [mbOK], 0);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
SendMail(edtSubject.Text,
MemoMessage.Text,
”,
edtNamaPengirim.Text, edtEmailPengirim.Text,
edtNamaPenerima.Text, edtEmailPenerima.Text);
end;

end.

Read More……

 

Mendisable menu close

Posted by @MINS

unit Unit1;

interface

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

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

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
hMenuHandle : HMENU;
begin
hMenuHandle := GetSystemMenu(Form1.Handle, FALSE);
if (hMenuHandle <> 0) then DeleteMenu(hMenuHandle, SC_CLOSE, MF_BYCOMMAND);
end;

end.

Read More……

 

Password Screen Saver

Posted by @MINS

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Forms, StdCtrls, Registry, Classes, Controls,
ExtCtrls;

type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Panel2: TPanel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
reg: TRegistry;
const xorwert: array[1..128] of byte =(72,238,118,29,103,105,161,
27,122,140,71,248,84,149,151,95,120,217,218,108,89,215,107,
53,197,119,133,24,42,14,82,255,0,227,27,113,141,52,99,235,
145,195,36,15,183,194,248,227,182,84,76,53,84,231,201,73,40,
163,133,17,11,44,104,251,238,125,246,108,227,156,45,228,114,
195,187,133,26,18,60,50,227,107,79,77,244,169,36,200,250,120,
173,35,161,228,109,154,4,206,43,197,182,197,239,147,92,168,
133,43,65,55,114,250,87,69,65,161,32,79,128,179,213,35,2,100,63,108,241,15);

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
buf: Array[0..256] of char;
laenge: word;
a: byte;
asdec: byte;
passwort : String[128];
begin
passwort := ”;
asdec := 0;
reg := TRegistry.Create;
reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey(‘\Control Panel\Desktop’,FALSE);
if reg.ValueExists (‘ScreenSave_Data’)= true then
Reg.ReadBinaryData(‘ScreenSave_Data’, buf, sizeof(buf));
laenge := (Reg.GetDataSize(‘ScreenSave_Data’) – 1) shr 1;
if reg.ValueExists (‘ScreenSaveUsePassword’)= true then
begin
if Reg.ReadBool(‘ScreenSaveUsePassword’) then
For a := 1 to laenge do
begin
asdec := strtoint(‘$’ + buf[(a shl 1)-2] + buf[(a shl 1)-1]);
passwort := concat(passwort, Chr(asdec xor xorwert[a]));
Edit1.Color := $FFFFFF;
end
else
begin
passwort := ‘– screen saver tidak pakai password –‘;
Edit1.Color := $0000FF;
end;
reg.free;
Edit1.Text := passwort;
end

else begin
Edit1.Text := ‘– screen saver tidak pakai password –‘;
Edit1.Color := $006C6CFF;
end;
//Edit1.SelectAll;
//Edit1.CopyToClipboard;
end;

end.

Read More……

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ImgList, StdCtrls;

type
TForm1 = class(TForm)
ImageList1: TImageList;
ComboBox1: TComboBox;
procedure ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
procedure ComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: