![]() |
Läuft Word, Excel, Outlook, Access oder Powerpoint?
Hallo,
hiermit kann man überprüfen ob eines der Programme gestartet worden ist. Die Units ComObj und ActiveX werden benötigt!
Delphi-Quellcode:
Grüsse, Daniel :hi:
function IsProgActive(sClassName: String): Boolean;
var ClassID: TCLSID; Unknown: IUnknown; begin try ClassID := ProgIDToClassID(sClassName); Result := GetActiveObject(ClassID, nil, Unknown) = S_OK; except Result := False; end; end; procedure TForm1.Button1Click(Sender: TObject); begin if IsProgActive('Word.Application') then ShowMessage('Word läuft'); if IsProgActive('Excel.Application') then ShowMessage('Excel läuft'); if IsProgActive('Outlook.Application') then ShowMessage('Outlook läuft'); if IsProgActive('Access.Application') then ShowMessage('Access läuft'); if IsProgActive('Powerpoint.Application') then ShowMessage('Powerpoint läuft'); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:34 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz