Chào mừng đến với Diễn đàn lập trình - Cộng đồng lập trình.
Kết quả 1 đến 3 của 3
  1. #1
    Ngày tham gia
    Sep 2015
    Bài viết
    0

    Cách làm chương trình " xem các chương trình đang chạy "

    Em mới học hook , API, DLL , em đang tìm hiểu để viết chương trình xem các chương trình đang chạy trên win [IMG]images/smilies/thinking.gif[/IMG] .

    Nhưng không biết bắt đầu học , viết từ đâu , nghe ông anh nói C++ làm việc với hệ thống qua socket gì đó nhưng không hiểu cho lắm . [IMG]images/smilies/Cry.gif[/IMG] .
    Tiện thể nếu đc các anh cho em cái Ebook gì đó học hook ,API cơ bản .
    Mong các Pro cho em lời khuyên . Em cảm ơn .

  2. #2
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Sao lại là qua socket nhỉ?

    Bạn có thể xem các đề tài sau xem:
    Chương trình liệt kê các process của windows
    CreateToolhelp32Snapshot, Liệt kê toàn bộ Process

    Hoặc tham khảo code từ MSDN xem:


    Mã:
    #include "psapi.h"void main(){   // Get the list of process identifiers.     DWORD aProcesses[1024], cbNeeded, cProcesses;   unsigned int i;     //This returns a list of handles to processes running on the system as an array.   if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )      return;     // Calculate how many process identifiers were returned.     cProcesses = cbNeeded / sizeof(DWORD);     // Display the name and process identifier for each process.     for ( i = 0; i < cProcesses; i++ )      if( aProcesses[i] != 0 )         DisplayProcessNameAndID( aProcesses[i] );  }void DisplayProcessNameAndID( DWORD processID ){   TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>");     // Get a handle to the process.     HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |      PROCESS_VM_READ,      FALSE, processID );     // Get the process name.     if (NULL != hProcess )   {      HMODULE hMod;      DWORD cbNeeded;           //Given a handle to a process, this returns all the modules running within the process.      //The first module is the executable running the process,      //and subsequent handles describe DLLs loaded into the process.      if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod), &cbNeeded) )      {         //This function returns the short name for a module,         //typically the file name portion of the EXE or DLL         GetModuleBaseName( hProcess, hMod, szProcessName,            sizeof(szProcessName)/sizeof(TCHAR) );      }   }     // Display the process name and identifier.   CString str;   str.Format("Text:%s, PID : %u", szProcessName, processID );   AfxMessageBox(str);     //close the process handle   CloseHandle( hProcess );}

  3. #3
    Anh có thể cho em mấy cái tài liệu học về cái này không anh .
    Em không biết mấy cái lệnh ..
    em cảm ơn

 

 

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •