MsgWaitForMultipleObjects用法(50分)

  • 主题发起人 主题发起人 oer_2001
  • 开始时间 开始时间
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;
都没有什么响应啊?这个函数怎么用啊?
 
www.source520.com 站长必进 2万源代码电子经典书狂下载
 

Similar threads

后退
顶部