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.
=====================================
Bet365 Casino Mobile App - JTM Hub
BalasHapusIf 강원도 출장샵 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