From 73653e9175e5f1dc53be85a682305e7a53b2a512 Mon Sep 17 00:00:00 2001 From: ollydev Date: Tue, 6 Nov 2018 19:08:18 +0000 Subject: [PATCH] Change title variable to widestring --- .../MMLAddon/Imports/classes/MML/lptiomanager_abstract.pas | 2 +- Units/MMLCore/mufasatypes.pas | 6 +++--- Units/MMLCore/os_windows.pas | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Units/MMLAddon/Imports/classes/MML/lptiomanager_abstract.pas b/Units/MMLAddon/Imports/classes/MML/lptiomanager_abstract.pas index 1c6281121..9f81292d6 100644 --- a/Units/MMLAddon/Imports/classes/MML/lptiomanager_abstract.pas +++ b/Units/MMLAddon/Imports/classes/MML/lptiomanager_abstract.pas @@ -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); diff --git a/Units/MMLCore/mufasatypes.pas b/Units/MMLCore/mufasatypes.pas index 017e9329b..d00dc8f24 100644 --- a/Units/MMLCore/mufasatypes.pas +++ b/Units/MMLCore/mufasatypes.pas @@ -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; diff --git a/Units/MMLCore/os_windows.pas b/Units/MMLCore/os_windows.pas index 40e6fead7..9c9da815c 100644 --- a/Units/MMLCore/os_windows.pas +++ b/Units/MMLCore/os_windows.pas @@ -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; @@ -628,4 +628,4 @@ function TDesktopWindow.WindowRect(out Rect : TRect) : Boolean; Result := true; end; -end. \ No newline at end of file +end.