View Single Post
Old 02-19-2004, 02:10 PM  
Mouton
Posse Member
 
Join Date: Dec 2002
Posts: 1,956
Default

the part of code i use which is probably from dark's example(s)...
which is also the code for ioBmonitor i posted lower in this forum...

Code:
while (nPos != -1 && Users < 1000 ) {
    // Initial setup for DC_GET_ONLINEDATA
    lpMessage->dwIdentifier    = DC_GET_ONLINEDATA;
    LPDC_ONLINEDATA pOnlineData = (LPDC_ONLINEDATA)lpMessage->lpContext;
    pOnlineData->iOffset = nPos;
    pOnlineData->dwSharedMemorySize = sizeof(DC_MESSAGE) + sizeof(DC_ONLINEDATA) + (_MAX_PATH + 1) * 2;

    // Send Message
    SendMessage(hIoFTPD, WM_SHMEM, NULL, (LPARAM)hMemory);

    // Wait until processed (5 secs)
    if (WaitForSingleObject(hEvent, 2000) == WAIT_TIMEOUT) break;
    if (!lpMessage->dwReturn) {
        nPos = pOnlineData->iOffset;
        if (iPos>=nPos || nPos == 1024)
            break;

        ...

        int UserId = pOnlineData->OnlineData.Uid;
        if (UserId==-1) continue;

        ...

        Users++;
        iPos = nPos;
    }
    if (lpMessage->dwReturn == (DWORD)-1)
        break;
    pOnlineData->iOffset++;
}
Mouton is offline