如何在c ++中检查Microsoft Outlook是否已打开? [英] How to check whether Microsoft outlook is opened or not in c++?
问题描述
我想根据outlook是否打开在我的应用程序中执行特定操作。
任何人都可以告诉我们如何检查"Outlook"是否"是否在c ++中打开。
我尝试了这段代码,但这总是返回false。
CLSID clsid;
HRESULT hr = CLSIDFromProgID(_T(" Outlook.Application"),& clsid);
如果(hr!= S_OK)返回false;
IUnknown * pUnknown = NULL;
hr = GetActiveObject(clsid,0,& pUnknown);
return(hr == S_OK);
任何帮助都将不胜感激。
问候,
Siva
0 下来 投票 收藏夹 解决方案
Hi, I want to perform a specific action in my application based on whether outlook is opened or not. Could anyone please let me know how do we check whether "Outlook" is opened or not in c++. I tried this piece of code but this is always returning false. CLSID clsid; HRESULT hr = CLSIDFromProgID(_T("Outlook.Application"), &clsid); if (hr != S_OK) return false; IUnknown *pUnknown = NULL; hr = GetActiveObject(clsid, 0, &pUnknown); return (hr == S_OK);
Any help would be greatly appreciated. Regards, Siva
|