读书人

请问如和判断字符串数组

发布时间: 2013-08-14 14:27:55 作者: rapoo

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


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;

读书人网 >.NET

热点推荐