da ich noch n kleiner anfänger bin und mir bei google die buchstaben langsam ausgehen
wie bekomm ich zuverlässig die Prozess ID ausgelesen?
{
cout << "moin" << endl;
getchar();
int x = 1;
while (x == 1)
{
DWORD procid;
HWND hWnd;
LPCWSTR clas;
LPCWSTR name;
clas = TEXT("D3D Window");
name = TEXT("CABAL");
hWnd = FindWindow(0,name);
if(hWnd != 0)
{
GetWindowThreadProcessId(hWnd,&procid);
cout << "yes" << endl << "ID ist: " << procid << endl << "ende: 0 oder weiter:1" << endl;
cin >> x;
}
else
{
cout << "ende: 0 oder weiter:1" << endl;
cin >> x;
}
CloseHandle(hWnd);
getchar();
}
return 0;
}
so klappt es nur "teilweise"







