Beranda > Delphi > Check if Word, Excel, Access, Outlook, Powerpoint is running

Check if Word, Excel, Access, Outlook, Powerpoint is running

uses
ComObj, ActiveX;

function IsObjectActive(ClassName: string): Boolean;
var
ClassID: TCLSID;
Unknown: IUnknown;
begin
try
ClassID := ProgIDToClassID(ClassName);
Result  := GetActiveObject(ClassID, nil, Unknown) = S_OK;
except
Result := False;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if IsObjectActive(‘Word.Application’) then ShowMessage(‘Word is running !’);
if IsObjectActive(‘Excel.Application’) then ShowMessage(‘Excel is running !’);
if IsObjectActive(‘Outlook.Application’) then ShowMessage(‘Outlook is running !’);
if IsObjectActive(‘Access.Application’) then ShowMessage(‘Access is running !’);
if IsObjectActive(‘Powerpoint.Application’) then ShowMessage(‘Powerpoint is running !’);
end;

<!–
google_ad_client = “pub-9220693264852746”;
google_alternate_color = “FFFFFF”;
google_ad_width = 468;
google_ad_height = 15;
google_ad_format = “468x15_0ads_al_s”;
google_ad_channel =”4714912977″;
google_color_border = “FFFFFF”;
google_color_bg = “FFFFFF”;
google_color_link = “D56767”;
google_color_url = “D56767”;
google_color_text = “000000”;
//–>

Iklan
Kategori:Delphi
  1. Belum ada komentar.
  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: