range check Error?

绿林好汉 2009-04-05 11:13:53
function EnumWindowsProc(Handle: HWND; List: TStrings):boolean;stdcall;
var
WinStyles : DWord;
WinText:Array[0..100] of Char;
WinClsName:Array[0..100] of Char;
strTmp:string;
aIcon:HICON;
AI:TWinInfo;
begin
Result := true;
WinStyles := GetWindowLong(Handle, GWL_STYLE);
If ((WinStyles and WS_VISIBLE) > 0) then
begin
GetClassName(Handle,WinClsName,100);
GetWindowText(Handle,WinText,100);
strTmp := WinText;
If Trim(strTmp)<>'' then
begin
AI := TWinInfo.Create;
AI.FIcon := GetClassLong(Handle,GCL_HICON);
AI.FCaption := strTmp;
AI.FClsName := WinClsName;
AI.FHandle := Handle;
List.AddObject(IntToStr(Handle),AI);
end;
end;
end;
procedure GetAllWindow(List:TStrings);stdcall;
begin
EnumWindows(@EnumWindowsProc,integer(List));
end;
end.
运行到红色那一句时出现“raised exception class ERangeError with message 'Range check error',请问问题出在哪里?我的系统是XP,用的delphi7。
...全文
1019 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jadeluo 2009-04-06
  • 打赏
  • 举报
回复
测试了一下, 没发现LZ所说的问题啊。
绿林好汉 2009-04-06
  • 打赏
  • 举报
回复
我以前运行都没问题,有就中了一次毒后,就会出现这个错误,一直不知道是什么原因

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧