W
wenqy
Unregistered / Unconfirmed
GUEST, unregistred user!
应该是遍历,为所有的Button1加上caption,但却只加最后一个,其caption不断的累加,且不能停止,请指点procedure TForm1.SpeedButton1Click(Sender: TObject);var FormHandle , PanelHanlde , ButtonHandle: THandle; I : Integer;begin FormHandle := FindWindow(nil, PChar('Form1' I := 0; if FormHandle <> 0 then begin ButtonHandle := FindWindowEx(FormHandle, 0, PChar('TButton'), nil); repeat Inc(I); SendMessage(ButtonHandle, WM_SETTEXT, 0, Integer(pchar(IntToStr(I)))); ButtonHandle := FindWindowEx(FormHandle, 0, PChar('TButton'), nil); until ButtonHandle=0; end;end;