procedure TMyThread.Execute;
var
Msg: TMsg;
begin
FreeOnTerminate := True;
Form1.Caption := 'a';
//SendMessage(Application.Handle, WM_CLOSE, 0, 0);
while GetMessage(Msg, 0, 0, 0) do
begin
Form1.Caption := 'b';
if FindWin = True then
Form1.Panel1.Caption := '找到了窗体';
end;
end;我想知道为什么线程里面的消息循环不能运行,谢谢
var
Msg: TMsg;
begin
FreeOnTerminate := True;
Form1.Caption := 'a';
//SendMessage(Application.Handle, WM_CLOSE, 0, 0);
while GetMessage(Msg, 0, 0, 0) do
begin
Form1.Caption := 'b';
if FindWin = True then
Form1.Panel1.Caption := '找到了窗体';
end;
end;我想知道为什么线程里面的消息循环不能运行,谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货