Giriş
Visual Studio Debug penceresinden çıktı görebilmeyi sağlar. Çıktıya çift tıklayınca kaynak koda gidebiliriz.
Visual Studio Debug penceresinden çıktı görebilmeyi sağlar. Çıktıya çift tıklayınca kaynak koda gidebiliriz.
RECT windowsize; // get the height and width of the screen
GetClientRect(hwnd, &windowsize);
you can use a dedicated compatible DC for something like background bitmap manipulation and later using it as a blt-src to dump to window or client dcÖrnek
HDC hDC = ...
Şöyle yaparız.HDC hdcMem = CreateCompatibleDC(hDC);
// everything
DeleteDC(hdcMem)
DWORD get_process_id_by_process_name(const char* process_name_){
PROCESSENTRY32 process_entry = { sizeof(PROCESSENTRY32) };
HANDLE processes_snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
// loop through all process to find one that matches the process_name_
if (Process32First(processes_snapshot, &process_entry)){
do{
if (strcmp(process_entry.szExeFile, process_name_) == 0){
CloseHandle(processes_snapshot);
return process_entry.th32ProcessID;
}
} while (Process32Next(processes_snapshot, &process_entry));
}
CloseHandle(processes_snapshot);
return NULL;
}
Örnek
HANDLE hSnapshot;
PROCESSENTRY32 hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
proc32.dwSize = sizeof(PROCESSENTRY32);
if(Process32First(hSnapshot, &proc32))
{
cout << proc32.szExeFile << endl;
while(Process32Next(hSnapshot, &proc32))
cout << proc32.szExeFile << endl;
}