28 Aralık 2018 Cuma

FindWindow metodu

Örnek
Şöyle yaparız.
HWND hwnd = FindWindowA(NULL, "C:\\Example\\App.exe");
Örnek
Şöyle yaparız.
DWORD get_process_id_by_window_title(const char* window_title_){
  // get a handle to window using the window name
  HWND window_handle = FindWindow(NULL, window_title_);
  if (window_handle == NULL){
    return NULL;
  }

  // return the process id of the window handle we found
  DWORD process_id;
  GetWindowThreadProcessId(window_handle, &process_id);
  return process_id;
}