Latest: Download Free Desktop Wallpapers of Chef Loony! | Series: AuthorRank? | Download MBT eBooks!

MessageBox With TimeOut

1 komentar
Ada fungsi API tersembunyi nih yang bisa kita gunakan untuk menampilkan dialog pesan dalam interval waktu tertentu, dengan fungsi API tersembunyi ini kita bisa menampilkan sebuah pesan kemudian akan tertutup sendiri dalam interval waktu yg udah kita tentuin
 
Nama fungsi API tersebut : 
- MessageBoxTimeOutA         <--  (Untuk Ansi String)
- MessageBoxTimeOutW        <-- (Untuk Unicode / WideString)
 
Untuk menggunakan kedua fungsi API tersembunyi tersebut :
- letakan fungsi dibawah ini pada awal source kt, tepatnya dibawah Implementation
---------------------------------------------------------------------------------
implementation
{$R *.dfm}
 
function MessageBoxTimeOutA(hWnd: HWND; lpText: PChar; lpCaption: PChar;uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; Stdcall; external user32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutW(hWnd: HWND; lpText: PWideChar; lpCaption: PWideChar;uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; Stdcall; external user32 name 'MessageBoxTimeoutW';
----------------------------------------------------------------------------------
 
Untuk menggunakan nya : 
MessageBoxTimeOutA(Application.Handle, 'Hai Delphier.. Pesan ini akan tertutup dlm 5 detik', 'Komunitas Penggemar Delphi Indonesia', MB_ICONINFORMATION, 0, 5000);
 
 
Contoh Project :
=====================================
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
{$R *.dfm}
 
function MessageBoxTimeOutA(hWnd: HWND; lpText: PChar; lpCaption: PChar;uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; Stdcall; external user32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutW(hWnd: HWND; lpText: PWideChar; lpCaption: PWideChar;uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; Stdcall; external user32 name 'MessageBoxTimeoutW';
 
 
procedure TForm1.FormCreate(Sender: TObject);
begin
 
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
       MessageBoxTimeOutA(Application.Handle, 'Hai.. Pesan ini akan tertutup dlm 5 detik', 'Komunitas Penggemar Delphi Indonesia', MB_ICONINFORMATION, 0, 5000);
end;
 
end.
=====================================

1 komentar:

  1. Bet365 Casino Mobile App - JTM Hub
    If 강원도 출장샵 you 강원도 출장마사지 are a new user, 계룡 출장마사지 you can check 제주 출장샵 your account, get a bonus code or even use it to access your casino account. This is a great 군포 출장마사지 way to

    BalasHapus

  • MBT Icons and buttons

    Icons and Buttons

    Our resources have been successfully downloaded over 10K times and found almost every where. Get yours!

  • choosing webhost for a blog

    Why HostGator?

    Learn Why we chose HostGator as our Web Host and find discount coupons to kick start your blog today!

  • SEO Settings for blogger

    ALL IN ONE SEO PACK 2012

    Learn every single SEO tip that will boost your blog's ranking and organic traffic. We got them all!

  • Blogger widgets and plugins

    Visit MBT's Blogger LAB

    Why not take a tour of all great Blogger widgets published so far? You Name it we have it!

  • become a six figure blogger!

    Become a SIX FIGURE BLOGGER

    Learn what it takes to become a successful entrepreneur and build a living online!