在var
szText:array[0..255] of char;
sLeft: string;
ForegroundWindowHwnd: HWnd;
begin
 ForegroundWindowHwnd := GetForegroundWindow;
   y:=GetWindowTextLength(ForegroundWindowHwnd);
   l := GetWindowText(ForegroundWindowHwnd, @szText, y+1);
   sLeft:=string(@szText);
   If sLeft = '金山词霸 2002' Then
    EnumChildWindows(ForegroundWindowHwnd,@EnumChildWndProc,0);
end;
中得到的sLeft总不是我想要的, sLeft会在后面加上许多不需要的字符,请问怎么截取我想要的金山词霸 2002之类的?