首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

请问,如和判断字符串数组

2013-08-14 
请教,如和判断字符串数组诚心请教各位大虾,function EnumChildWndProc(AhWnd:LongIntAlParam:lParam):boo

请教,如和判断字符串数组
诚心请教各位大虾,


function EnumChildWndProc(AhWnd:LongInt;
AlParam:lParam):boolean;stdcall;
var
WndClassName: array[0..254] of Char;
WndCaption: array[0..254] of Char;
begin
GetClassName(AhWnd,wndClassName,254);
GetWindowText(aHwnd,WndCaption,254);
                                              //请问在这里如何判断类名为,假如是ComboBox类的
with form1.memo1 do
begin
.........
end;
result:=true;
end;


[解决办法]
function EnumChildWndProc(AhWnd: LongInt; AlParam: lParam): boolean; stdcall;
var
  WndClassName: string;
  WndCaption: string;
begin
  SetLength(WndClassName, 256);
  GetClassName(AhWnd, PChar(WndClassName), Length(WndClassName));
  WndClassName := StrPas(PChar(WndClassName));

  SetLength(WndCaption, 256);
  GetWindowText(AhWnd, PChar(WndCaption), Length(WndCaption));
  WndCaption := StrPas(PChar(WndCaption));
  // 比较字符串总会吧
  //...
  result := true;
end;

热点排行