0

I am working on a program built in MFC.

I have this weird situation when I shake my CFormView. The first time everything is minimised correctly, but when I shake it the second time while all of the windows are restored, one of my CDialog's inside the CFormView are going to the back, but it should be on front.

How can I catch the event of the second shake? What message does it send to my CDialog?

Is it something I can declare on my message map?

I couldn't find anything about it in the internet.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
eladyanai
  • 1,063
  • 2
  • 15
  • 34
  • My guess is that your CDialog does not set the CFormView as its hwndOwner. If the two windows are not related by an owner/owned relationship, then there is no requirement that one appear above the other. To enforce ordering among the windows, use the owner chain. – Raymond Chen Aug 22 '11 at 16:04

1 Answers1

0

i have found my solution.

i didn't find any message that i could put my finger on, but on my function of "MoveDialog"

I used: SetWindowPos(&wndNoTopMost,x,y,cx,cy,SWP_NOSIZE|SWP_SHOWWINDOW);

The &wndNoTopMost by MSDN is:

wndNoTopMost Repositions the window to the top of all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.

and this is how i have solved my problem!

Thank you!

eladyanai
  • 1,063
  • 2
  • 15
  • 34