OldSchoolHack

Register / Login English

FindWindow() Funktion

icon Thread: [Question] FindWindow() Funktion

Join Date: May 2011

Posts: 419

User-Rating:

199 positive
8 negative
TEXT Code:
  1. Arma 3 "D:\Steam\steamapps\common\Arma 3\arma3.exe" -window -name=Wirbelwind -nosplash "-mod="
" muss auch escaped werden...

... Aber hol dir die ProcessID vom Spiel bitte anders:

CPP Code:
  1. #include <tchar.h>
  2. #include <TlHelp32.h>
  3.  
  4. DWORD GetPIdByProcessName(const TCHAR* Name)
  5. {
  6. PROCESSENTRY32 ProcessEntry;
  7. ProcessEntry.dwSize = sizeof(PROCESSENTRY32);
  8.  
  9. DWORD ProcessID = 0;
  10. HANDLE Snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
  11.  
  12. if (Process32First(Snapshot, &ProcessEntry) == TRUE)
  13. {
  14. while (Process32Next(Snapshot, &ProcessEntry) == TRUE)
  15. {
  16. if (_tcscmp(ProcessEntry.szExeFile, Name) == 0)
  17. {
  18. ProcessID = ProcessEntry.th32ProcessID;
  19. }
  20. }
  21. }
  22.  
  23. CloseHandle(Snapshot);
  24.  
  25. return ProcessID;
  26. }
  27.  
  28. DWORD GamePId = GetPIdByProcessName(TEXT("arma3.exe"));

ergibt mehr sinn oder ?

__________________

http://abload.de/img/signaturmitoshlogos2ufb.jpg
http://abload.de/img/pfeila4uzk.png Da unten ist ein Like-Button, benutze ihn doch
1 positive
0 negative
This post has been rated by:
Wirbelwind94 (Thu 14. May 2015, 22:32)