Skip to content

Commit

Permalink
Merge pull request #458 from ollydev/getprocesses-widestring
Browse files Browse the repository at this point in the history
Change TSysProc.Title variable to WideString
  • Loading branch information
MerlijnWajer authored Nov 8, 2018
2 parents ac0f218 + 73653e9 commit e0eeb97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ procedure Register_TIOManager_Abstract(Compiler: TLapeCompiler);
addClass('TIOManager_Abstract');

addGlobalType('record func1, func2, func3, func4, func5, func6, func7, func8, func9, func10, func11, func12, func13, func14, func15, func16: Pointer; end', 'TTarget_Exported');
addGlobalType('record Title: String; Handle: PtrUInt; PID: UInt32; Width, Height: Int32; end', 'TSysProc');
addGlobalType('record Title: WideString; Handle: UInt32; PID: UInt32; Width, Height: Int32; end', 'TSysProc');
addGlobalType('array of TSysProc', 'TSysProcArr');

addGlobalFunc('function TIOManager_Abstract.GetError(): String; constref;', @TIOManager_Abstract_GetError);
Expand Down
6 changes: 3 additions & 3 deletions Units/MMLCore/mufasatypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ TBox = record
end;

TSysProc = record
Title: string;
Handle: integer;
Pid: integer;
Title: WideString;
Handle: UInt32;
PID: UInt32;
Width, Height: integer;
end;
TSysProcArr = array of TSysProc;
Expand Down
4 changes: 2 additions & 2 deletions Units/MMLCore/os_windows.pas
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ function EnumProcess(Handle: HWND; Param: LPARAM): WINBOOL; stdcall;
SetLength(ProcArr, I + 1);
ProcArr[I].Handle := Handle;
SetLength(ProcArr[I].Title, 255);
SetLength(ProcArr[I].Title, GetWindowText(Handle, PChar(ProcArr[I].Title), Length(ProcArr[I].Title)));
SetLength(ProcArr[I].Title, GetWindowTextW(Handle, PWideChar(ProcArr[I].Title), Length(ProcArr[I].Title)));
GetWindowSize(Handle, ProcArr[I].Width, ProcArr[I].Height);
GetWindowThreadProcessId(Handle, pPid);
ProcArr[I].Pid := pPid;
Expand Down Expand Up @@ -628,4 +628,4 @@ function TDesktopWindow.WindowRect(out Rect : TRect) : Boolean;
Result := true;
end;

end.
end.

0 comments on commit e0eeb97

Please sign in to comment.