All pastes #974257 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-04-06 18:05 UTC
rendered paste body
    HANDLE hSnapshot;
    PROCESSENTRY32 pe32;
    
    hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPALL | TH32CS_SNAPPROCESS, 0);
    if (hSnapshot != INVALID_HANDLE_VALUE)
    {
        if ( Process32First(hSnapshot, &pe32) )
        {
            do
            {
                if ( !lstrcmpi(pe32.szExeFile, _T("MapleStoryServer.exe")) )
                {
                    // stuff here
                    break;
                }
            } while ( Process32Next(hSnapshot, &pe32) );
        }
        CloseHandle(hSnapshot);
    }