Verschieben einer Dialogbox



  • Folgendes Problem ich habe eine Dialogbox ohne Titelleiste,
    will aber die Dialogbox verschieben können.
    Das Funktioniert auch nur das verschieben ist nicht flüssig, es wird viel zu oft aktualisiert.

    LONG x_abs_ab = 0;
    LONG y_abs_ab = 0;
    
    void CmsIRCDlg::OnLButtonDown(UINT type, CPoint m_point)
    {
    	CRect rect;
        GetWindowRect( &rect );
    
    	x_abs_ab = m_point.x - rect.left;
    	y_abs_ab = m_point.y - rect.top;
    }
    
    void CmsIRCDlg::OnMouseMove(UINT type, CPoint m_point)
    {
    	CRect rect;
        GetWindowRect( &rect );
    
    	if (type == MK_LBUTTON)
    	{
    		rect.MoveToXY(m_point.x - x_abs_ab, m_point.y - y_abs_ab);
    
    		MoveWindow(rect, TRUE);
    		UpdateWindow();
    	}
    }
    

    könnt ihr mir helfen, sodass ich das fenster "normal" verschieben kann



  • Such mal nach NC_HITTEST oder NC_HIT_TEST Ich hab da mal was geschrieben und keine Lust das nochmal zu suchen... 💡


Anmelden zum Antworten