O
oer_2001
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TMessageThread.Execute;
begin
inherited;
while not Terminateddo
try
case MsgWaitForMultipleObjects(1, Event, False, 5*1000, QS_ALLEVENTS) of
WAIT_OBJECT_0:
form2.Edit2.Text := '123';
WAIT_OBJECT_0 + 1:
while PeekMessage(msg, 0, 0, 0, PM_REMOVE)do
IF Msg.message = WM_USER+1 then
begin
form2.Edit2.Text := 'WMUser';
end
else
DispatchMessage(msg);
end;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
PostthreadMessage(MessageThread.ThreadID, WM_User + 1, 0, 0);
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
MessageThread := TMessageThread.Create(False);
end;
都没有什么响应啊?这个函数怎么用啊?
begin
inherited;
while not Terminateddo
try
case MsgWaitForMultipleObjects(1, Event, False, 5*1000, QS_ALLEVENTS) of
WAIT_OBJECT_0:
form2.Edit2.Text := '123';
WAIT_OBJECT_0 + 1:
while PeekMessage(msg, 0, 0, 0, PM_REMOVE)do
IF Msg.message = WM_USER+1 then
begin
form2.Edit2.Text := 'WMUser';
end
else
DispatchMessage(msg);
end;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
PostthreadMessage(MessageThread.ThreadID, WM_User + 1, 0, 0);
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
MessageThread := TMessageThread.Create(False);
end;
都没有什么响应啊?这个函数怎么用啊?