//Windows System menu
//By : Zephio
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//Minimize 1
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_MINIMIZE, 0);
end;
//Minimize 2
procedure TForm1.Button2Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_Minimize, 1);
end;
//Minimize 3
procedure TForm1.Button3Click(Sender: TObject);
begin
Application.Minimize;
end;
//Restore 1
procedure TForm1.Button4Click(Sender: TObject);
begin
Application.Restore;
end;
//Restore 2
procedure TForm1.Button5Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_RESTORE, 0);
end;
//Restore 3
procedure TForm1.Button6Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_RESTORE, 1);
end;
//Maximize 1
procedure TForm1.Button7Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_ZOOM, 0);
end;
//Maximize 2
procedure TForm1.Button8Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_ZOOM, 1);
end;
//Maximize 3
procedure TForm1.Button9Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
//or: SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MAXIMIZE, 1);
end;
//Close 1
procedure TForm1.Button10Click(Sender: TObject);
begin
Close;
//Atau gaya BCB: Close();
end;
//Close 2
procedure TForm1.Button11Click(Sender: TObject);
begin
Application.Terminate;
end;
//Close 3
procedure TForm1.Button12Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_CLOSE, 0);
end;
//Close 4
procedure TForm1.Button13Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_CLOSE, 1);
end;
//Klik Start menu
procedure TForm1.Button14Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_TASKLIST, 1);
end;
//Sembunyikan Apps pada Task Bar
procedure TForm1.Button15Click(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_HIDE);
end;
//Tampilkan Apps pada Task Bar
procedure TForm1.Button16Click(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_SHOWNORMAL);
end;
//ScreenSaver Mode
procedure TForm1.Button17Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 1);
end;
end.
//By : Zephio
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//Minimize 1
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_MINIMIZE, 0);
end;
//Minimize 2
procedure TForm1.Button2Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_Minimize, 1);
end;
//Minimize 3
procedure TForm1.Button3Click(Sender: TObject);
begin
Application.Minimize;
end;
//Restore 1
procedure TForm1.Button4Click(Sender: TObject);
begin
Application.Restore;
end;
//Restore 2
procedure TForm1.Button5Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_RESTORE, 0);
end;
//Restore 3
procedure TForm1.Button6Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_RESTORE, 1);
end;
//Maximize 1
procedure TForm1.Button7Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_ZOOM, 0);
end;
//Maximize 2
procedure TForm1.Button8Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_ZOOM, 1);
end;
//Maximize 3
procedure TForm1.Button9Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
//or: SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MAXIMIZE, 1);
end;
//Close 1
procedure TForm1.Button10Click(Sender: TObject);
begin
Close;
//Atau gaya BCB: Close();
end;
//Close 2
procedure TForm1.Button11Click(Sender: TObject);
begin
Application.Terminate;
end;
//Close 3
procedure TForm1.Button12Click(Sender: TObject);
begin
Form1.Perform(WM_SYSCOMMAND, SC_CLOSE, 0);
end;
//Close 4
procedure TForm1.Button13Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_CLOSE, 1);
end;
//Klik Start menu
procedure TForm1.Button14Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_TASKLIST, 1);
end;
//Sembunyikan Apps pada Task Bar
procedure TForm1.Button15Click(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_HIDE);
end;
//Tampilkan Apps pada Task Bar
procedure TForm1.Button16Click(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_SHOWNORMAL);
end;
//ScreenSaver Mode
procedure TForm1.Button17Click(Sender: TObject);
begin
SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 1);
end;
end.
No comments:
Post a Comment