Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.
Posted
Updated 31-Jul-11 15:45pm
v2

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).
 
Share this answer
 
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;
  }
}

Regards.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900