onwindowposchanging()的问题帮助〜 [英] the problem of onwindowposchanging() help~

查看:136
本文介绍了onwindowposchanging()的问题帮助〜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图隐藏对话框时,我使用了onwindowposchanging()函数,该函数隐藏了对话框,但是在隐藏对话框之后,我需要一个messagebox()来显示该过程已完成,但是在添加MesasageBox()之后函数并执行了该函数,发生了一件奇怪的事情,MessageBox()显示了几次,当我单击时,它以正常的速度关闭的速度要慢得多.........我不知道这是什么问题 .有人帮我吗?

when I tried to hide the dialog I used the onwindowposchanging() function ,which hide the dialog , but after hide the dialog i need a messagebox()to show that the process is finished ,but after i add the MesasageBox() funtion and executed the funtion ,there is a strange thing happaped ,the MessageBox() show for several times and when i clicked , it closed much more slow the the normal.........i don''t what is the problem . anyone an help me ? thanks.

推荐答案

您可能需要发布一些代码,以查看为什么它会多次打开然后关闭的速度很慢,但是作为最初的猜测,您可能将MessageBox()放置在一段代码中,该代码被重复调用,并且对话框需要很长时间关闭的原因可能是因为应用程序未正常关闭(可能崩溃而不是关闭).
You probably need to post some code to see why it would get opened several times and then be slow to close, but as an initial guess, you probably placed the MessageBox() in a piece of code that gets called repeatedly and the reason the dialog takes a long time to close is probably because the application is not closing normally (probably crashing down instead of closing).


ShowWindow 函数也发送一条WM_WINDOWPOSCHANGING消息.如果调用ShowWindow函数,则必须阻止重新进入消息处理程序.
即:
The ShowWindow function sends a WM_WINDOWPOSCHANGING message too. You have to block reentering your message handler if you call the ShowWindow function.
i.e.:
void myclass::onwindowposchanging()
{
  static int block = 0;
  if(0==block)
  {
    block=1;
    ShowWindow(SW_HIDE);
    MessageBox(0,__TEXT(""),__TEXT(""),0);
    block=0;
  }
}


问候.


这篇关于onwindowposchanging()的问题帮助〜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆