怎样确认某个窗子口是否已创建,怎样查找某个特定的窗口,多谢各位帮助,
procedure TMainForm.N1Click(Sender: TObject);
begin
if self.FindComponent(FrmOperator)<>nil then
begin
FrmOperator.BringToFront;
beep;
exit;
end else
begin
FrmOperator :=TFrmOperator.Create(Self);
FrmOperator.show;
end;
end;
if not Assigned(Form1) then //判別是否已創建
function TMainForm.ExistsForm(MDIFormCaption:String):boolean;
var
i:byte;
begin
result:=true;
for i:=0 to MDIChildCount-1 do
begin
if MDIChildren[i].Caption=MDIFormCaption
then result:=false;
end;
end;
用FindWindow
一个工程没有两个窗口Name是一样的吧?