我用enumchildwindows尋找窗體上所有句柄,但在combobox卻顯示出7個一樣的數字(3471),請問是什麼問題,源碼如下,謝謝.
function proc(h:hwnd;l:lparam):bool;
begin
form1.combobox1.items.add(inttostr(h));
result:=true;
end;procedure form1.button1click(sender:tobject);
begin
enumchildwindows(handle,@proc,0);
end;
function proc(h:hwnd;l:lparam):bool;
begin
form1.combobox1.items.add(inttostr(h));
result:=true;
end;procedure form1.button1click(sender:tobject);
begin
enumchildwindows(handle,@proc,0);
end;
如
function OnEnumWindows(AHandle: THandle; AParam: Cardinal): Bool; stdcall;
begin
Form1.Memo1.Lines.Add(IntToStr(AHandle));
Result := True;
end;
var
s: string;
begin
SetLength(s, 255);
GetWindowText(h, PChar(s), 256);
s := PChar(s);
Form1.ComboBox1.Items.Add(s);
result:=true;
end;procedure TForm1.button1click(sender:tobject);
begin
enumchildwindows(handle,@proc,0);
//enumwindows(@proc,0);
end;
想知道stdcall的作用是什麼??
另外bool & boolean是同樣的類型嗎??