-
October 11th, 2006, 11:10 AM
#16
Re: Technology of moving window
Originally Posted by Hobson
And I am really pissed when some app ignores my settings and behaves other way (vide Winamp). Probably developers think that their app looks sooo coooool that it should be visible all the time. I wonder when they will start to set 'Always on top' style.
Fully agree! :yellow handshoe:
-
October 12th, 2006, 03:49 AM
#17
Re: Technology of moving window
Originally Posted by zerver
This is an OS setting: Display properties --> Effects --> "Show window contents while dragging".
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:
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 upped
-
October 12th, 2006, 04:03 AM
#18
Re: Technology of moving window
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
-
October 12th, 2006, 05:30 AM
#19
Re: Technology of moving window
Originally Posted by blacksource
why the function of IsWindowVisible always return zero?
How can we know, without seeing your code? Perhaps because that window is invisible?
Originally Posted by blacksource
That is a dialog create by MFC AppWizard
Hm... Sounds suspiciously like the modal main dialog of a "dialog-based" project... So where are you calling IsWindowVisible()?
-
October 12th, 2006, 06:45 AM
#20
Re: Technology of moving window
i call the function on CDockWndDlg::OnMove(int x, int y)
-
October 12th, 2006, 07:12 AM
#21
Re: Technology of moving window
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.
-
October 12th, 2006, 07:48 AM
#22
Re: Technology of moving window
sorry, i call the function here
Code:
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 );
}
if i call m_dlgDock.MoveWindow( &rect ) direct without checking there will be an error when the initial of dialog
-
October 12th, 2006, 07:59 AM
#23
Re: Technology of moving window
Originally Posted by blacksource
if i call m_dlgDock.MoveWindow( &rect ) direct without checking there will be an error when the initial of dialog
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.
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.
-
October 12th, 2006, 08:43 AM
#24
Re: Technology of moving window
yeah.....
thanks gstercken
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|