Fully agree! :yellow handshoe: :)Quote:
Originally Posted by Hobson
Printable View
Fully agree! :yellow handshoe: :)Quote:
Originally Posted by Hobson
Quote:
Originally Posted by zerver
This is an OS setting: Display properties --> Effects --> "Show window contents while dragging".
if you cancel the effect of "Show window contents while dragging", you will find that when you are dragging the window the WM_MOVING does not happen only the LMB is uppedQuote:
Originally Posted by Hobson
I.e. Winamp draws whole window when dragging. This can be done in a few ways I guess, the one I found out is to create WM_MOVING message handler in following way:
i have an another question now.
why the function of IsWindowVisible always return zero?
That is a dialog create by MFC AppWizard
what should i do
How can we know, without seeing your code? Perhaps because that window is invisible? http://forums.codeguru.com/images/ie.../2006/06/1.gifQuote:
Originally Posted by blacksource
Hm... Sounds suspiciously like the modal main dialog of a "dialog-based" project... So where are you calling IsWindowVisible()?Quote:
Originally Posted by blacksource
i call the function on CDockWndDlg::OnMove(int x, int y)
Hm... and that's all your code? I don't see any IsWindowVisible() call there.Quote:
Originally Posted by blacksource
sorry, i call the function here
if i call m_dlgDock.MoveWindow( &rect ) direct without checking there will be an error when the initial of dialogCode:
void CDockWndDlg::OnMove(int x, int y)
{
CDialog::OnMove(x, y);
// TODO: Add your message handler code here
RECT rect, rectMain;
// Get the rectangle of Docking Window
rect = (RECT)m_dlgDock.GetRect();
// Get the rectangle of Main Window
GetWindowRect( &rectMain );
// If Main Window is visible....beginning Docking
if( IsWindowVisible() )
{
// Check the station of docking
if( m_dlgDock.m_bDocked )
{
CRect rect;
// remember the rectangle position of Docking Window
rect = m_dlgDock.GetRect();
rect.OffsetRect(m_rectMain.left - x, m_rectMain.top - y );
// Move the Docking Window to Main Window
// m_dlgDock.MoveWindow( &rect );
}
}
GetWindowRect( &m_rectMain );
}
Okay, now I see what you are trying to do. The problem is that your OnMove() handler will be called once at the beginning during the window creation process - at that time, the window won't be created yet, and most of those calls will fail.Quote:
Originally Posted by blacksource
The correct way to handle this is not to test whether the window is visible, but whether it has a valid HWND attached to it - this is best done by testing m_hWnd against NULL.
yeah.....
thanks gstercken