C # get data from another standalone application?

How can I let my C # program get data from another application?

Suppose the application is, for example, “yahoo messenger” and someone says “hi there” in the chat ...

Now, I want my C # program to read / receive this data or information from the “Yahoo Messenger chat window” in a printout of it in my application? is it possible?

+5
source share
3 answers

To understand the win32 api stream, you will need to use the visual name of the SPY ++ studio tool.

After that refer to this link

Get text from another application .

http://www.dreamincode.net/forums/topic/66140-scraping-the-text-from-another-application-with-win32-api/

, , ,

+4

, (, Yahoo) (: COM) .

, Windows API, , .

- , ?

EDIT: Yahoo. - , , , , : http://answers.yahoo.com/question/index?qid=20081126161509AAhr6Dz

Yahoo :

libpurple. Yahoo. , , Pidgin IM.

, libpurple - ++, .

+2

" " (, Yahoo Messenger), winapi:

    LPSECURITY_ATTRIBUTES lpAtt=NULL;

    HANDLE INVALID_FILE_HANDLE=(HANDLE)0xFFFFFFFF; //Memory handle
    hMapFile=::CreateFileMapping(INVALID_FILE_HANDLE,
    lpAtt,PAGE_READWRITE, 0,nSize, SharedMemName);
    if (hMapFile == NULL) 
    { 
        ShowSomeMessageBox("Could not create shared memory");
        return NULL;
    }

    LPTSTR pBuf = (LPTSTR) MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS,0,0,nSize);
    if(NULL==pBuf) 
    {
        ShowSomeMessageBox("Could not create mapped view of theshared memory");
        return NULL;
}

, , CopyMemory api.

# InterOp (P-invoke) WinAPI:

:     OpenFileMapping(), MapViewOfFile() ..,

:     Marshal.ReadInt32(), Marshal.StructureToPtr() .., #.

+1
source

All Articles