关于截取消息的问题,请大家帮忙
function login:boolean ;
var
msg:tmsg;
begin
Application.CreateForm(Tfm_login, fm_login);
fm_login.ShowModal;
while peekmessage(msg,0,0,0,pm_remove) do
begin
if msg.message=wm_usercon then
begin
if msg.wParam=wm_quit then
begin
showmessage('Quit');
result:=false
end ;
if msg.wParam=wm_login then
begin
showmessage('login');
result:=true
end;
end
else
begin
translatemessage(msg);
dispatchmessage(msg);
;
end;
end;
end;
procedure Tfm_login.btn_exitClick(Sender: TObject);
begin
postmessage(0,wm_usercon,wm_quit,0);
end;
login接受到btn_exitClick发出的消息并返回一个布尔值,但现在没有任何响应