First try the code I posted in the privious message. Then just to confirm
remove the menu code to see what happens.
stored would no longer be valid. So you will need to store them in client
coordinates.
AliR.
"AliR (VC++ MVP)" wrote -
Again are you calling CDialog::OnInitDialog in your OnInitDialog method?
===
The answer is yes.
===
I don't understand this code here?
you get the windows rect in screen corrdinates
m_cTopBorder.GetWindowRect(&r);
you convert it to client coordinates of the parent window
m_cTopBorder.ScreenToClient(&r);
then you discard variable r all together and call GetWindowRect with
rectArray[0].
m_cTopBorder.GetWindowRect(&rectArray[0]);
So the final thing in rectArray is screen coordinates, which is no good
===
I'll look into this more, because it had been working very well. But I see
your point about it not making complete sense. However, most of this was
suggested from other post a few days ago.
Also, I thought the problem could be with OnNcHitTest( ) section,
because
somehow the code for dragging just stopped working when this code was
placed
in OnInitDialog().
CMenu* pSysMenu = GetSystemMenu(FALSE);
if(pSysMenu != NULL)
{
pSysMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
pSysMenu->RemoveMenu(SC_SIZE, MF_BYCOMMAND);
pSysMenu->RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND);
}
===