F
faiqi
Unregistered / Unconfirmed
GUEST, unregistred user!
我想做个简单的屏保试试,可我现在碰到这个问题,就是“预览”窗体一闪而过。我是这样做的。(我是用BCB的,不过大侠帮我看看原理吧)
Project中如下:
PreviewForm->showmodal();
在previewform中定义了如下消息处理函数:
void __fastcall TPreviewForm::HandleMessage(TMessage &Msg)
{
switch(Msg.Msg)
{case WM_ACTIVATE: if(Msg.WParamLo==WA_INACTIVE)
Close();
break;
case WM_MOUSEMOVE: {int XDis=abs(Msg.LParamLo-OldMouseX);
int YDis=abs(Msg.LParamHi-OldMouseY);
if(XDis>10&&YDis>10) //如果确实鼠标是移动了
Close();
}
break;
case WM_LBUTTONDOWN:Close();
break;
case WM_MBUTTONDOWN: Close();
break;
case WM_RBUTTONDOWN: Close();
break;
case WM_KEYDOWN: Close();
break;
}
}
但我发现预览时,这个窗体一闪而过,应该怎么处理,大侠帮个!
Project中如下:
PreviewForm->showmodal();
在previewform中定义了如下消息处理函数:
void __fastcall TPreviewForm::HandleMessage(TMessage &Msg)
{
switch(Msg.Msg)
{case WM_ACTIVATE: if(Msg.WParamLo==WA_INACTIVE)
Close();
break;
case WM_MOUSEMOVE: {int XDis=abs(Msg.LParamLo-OldMouseX);
int YDis=abs(Msg.LParamHi-OldMouseY);
if(XDis>10&&YDis>10) //如果确实鼠标是移动了
Close();
}
break;
case WM_LBUTTONDOWN:Close();
break;
case WM_MBUTTONDOWN: Close();
break;
case WM_RBUTTONDOWN: Close();
break;
case WM_KEYDOWN: Close();
break;
}
}
但我发现预览时,这个窗体一闪而过,应该怎么处理,大侠帮个!