getExePath method

String? getExePath()

Returns executable path of a window using its hWnd and updates current Window instance. Returns null if process does not exist.

Implementation

String? getExePath() {
  String? result;
  final Pointer<Uint32> pId = calloc<Uint32>();
  GetWindowThreadProcessId(hWnd, pId);
  final int processID = pId.value;
  free(pId);
  result = _getProcessExePath(processID);
  if (result != null) copyWith(exePath: result);
  return result;
}