Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/127.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 检索Skype最近的聊天记录_C++ - Fatal编程技术网

C++ 检索Skype最近的聊天记录

C++ 检索Skype最近的聊天记录,c++,C++,我正试图拉出最近Skype消息窗口的内容,该窗口包含在TChatContentControl窗口类(TConversationForm的子类,而TshatContentControl窗口又是TskManiff的子类)下。我用C++ +< /P> 我试图使用WM_GETTEXT SendMessage方法,但没有成功。 我进一步尝试使用AccessibleObjectFromEvent方法,检索IAccessible接口的值/名称,但没有成功 我还期望Skype将这些数据存储为html,并使用WM

我正试图拉出最近Skype消息窗口的内容,该窗口包含在TChatContentControl窗口类(TConversationForm的子类,而TshatContentControl窗口又是TskManiff的子类)下。我用C++ +< /P> 我试图使用WM_GETTEXT SendMessage方法,但没有成功。 我进一步尝试使用AccessibleObjectFromEvent方法,检索IAccessible接口的值/名称,但没有成功

我还期望Skype将这些数据存储为html,并使用WM_html_GETOBJECT消息来解释IHTMlement结构(与Yahoo Messenger完美配合),但仍然没有成功

有谁有过更丰富的经验,知道Skype是如何存储这些数据的,以及解决方法是什么

非常感谢您的支持

为了让这个线程重新焕发活力,让我与您分享一段简化的代码 使用雅虎Messenger将实现我试图通过Skype实现的目标:

#include <Windows.h>
#include <Oleacc.h>
#include <atlbase.h>
#include <mshtml.h>    

#pragma comment (lib, "Oleacc.lib")

void CALLBACK WinEventProc(HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) 
{
    char className[50];
    GetClassName(hwnd, className, 50);

    if (strcmp(className, "CTabbedIMHost") == 0)
    {
        HWND wndbase = FindWindowEx(hwnd, 0, "CConvWndBase", NULL);
        HWND container = FindWindowEx(wndbase, 0, "YHTMLContainer", NULL);
        HWND exp = FindWindowEx(container, 0, "Internet Explorer_Server", NULL);

        if (NULL != exp)
        {
            CComPtr<IHTMLDocument2> ieDoc;
            LRESULT lRes;

            UINT uMsg = RegisterWindowMessage(_T("WM_HTML_GETOBJECT"));
            SendMessageTimeout(exp, uMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, (DWORD*)&lRes);

            HRESULT hRes = ObjectFromLresult(lRes, IID_IHTMLDocument2, 0, (void**)&ieDoc);

            if (SUCCEEDED(hRes))
            {
                CComPtr<IHTMLElement> pHTMLElement;
                hRes = ieDoc->get_body(&pHTMLElement);
                BSTR bstrBodyText;
                pHTMLElement->get_innerText(&bstrBodyText);

                // MessageBoxW(NULL, bstrBodyText, L"Yahoo Messenger", MB_OK | MB_ICONASTERISK);
            }
        }
    }
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdParam, int iCmdShow)
{
    MSG msg;

    CoInitializeEx(NULL, COINIT_MULTITHREADED);
    HWINEVENTHOOK LHook = SetWinEventHook(EVENT_OBJECT_FOCUS, EVENT_OBJECT_VALUECHANGE, 0, WinEventProc, 0, 0, WINEVENT_SKIPOWNPROCESS);

    while (GetMessage(&msg, NULL, 0, 0) != 0)
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    UnhookWinEvent(LHook);
    CoUninitialize();

    return 0;
}
#包括
#包括
#包括
#包括
#pragma注释(lib,“Oleacc.lib”)
无效回调WinEventProc(HwineThook HwineThook,DWORD事件,HWND HWND,LONG idObject,LONG idChild,DWORD dwEventThread,DWORD dwmsEventTime)
{
字符类名称[50];
GetClassName(hwnd,className,50);
if(strcmp(类名,“CTabbedIMHost”)==0)
{
HWND wndbase=FindWindowEx(HWND,0,“CConvWndBase”,NULL);
HWND container=FindWindowEx(wndbase,0,“YHTMLContainer”,NULL);
HWND exp=FindWindowEx(容器,0,“Internet Explorer\u服务器”,NULL);
if(NULL!=exp)
{
CComPtr ieDoc;
LRESULT lRes;
UINT uMsg=RegisterWindowMessage(_T(“WM_HTML_GETOBJECT”);
SendMessageTimeout(exp、uMsg、0L、0L、SMTO_、1000、(DWORD*)和lRes);
HRESULT hRes=ObjectFromLresult(lRes,IID_IHTMLDocument2,0,(void**)和ieDoc);
如果(成功(hRes))
{
采购许可证;
hRes=ieDoc->get_body(&phtmlement);
BSTR BSTROBYTEXT;
phtmlement->get_innerText(&bstrBodyText);
//MessageBoxW(NULL,bstrBodyText,L“Yahoo Messenger”,MB|u OK | MB|u ICONASTERISK);
}
}
}
}
int WINAPI WinMain(HINSTANCE HINSTANCE、HINSTANCE hPrevInstance、PSTR szCmdParam、int iCmdShow)
{
味精;
CoInitializeX(空,Conit_多线程);
HWINEVENTHOOK LHook=SetWinEventHook(事件对象焦点、事件对象值更改、0、WinEventProc、0、0、WINEVENT\u SKIPOWNPROCESS);
while(GetMessage(&msg,NULL,0,0)!=0)
{
翻译信息(&msg);
发送消息(&msg);
}
脱钩事件(LHook);
coninitialize();
返回0;
}