CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    64

    Modeless Dialog problem

    Hi,
    I am using VC++6.0, MFC.
    I am working on a MDI application, and got stuch place.
    I ahave created a Modeless dialog, and attached it with the main frame.

    when I move the FRAME WINDOW , this dialog should move along with the frame, and it is happening(here DIALOG BOX is a seprate window,displaying seprately on the desktop, attached with the frame)), and as per the app. needs, it should.

    Now If I move dialog window , than it is moving, and detaches from MainFrame.
    Now my objective is that, this dialog window should not move at al(WHEN I try to move DIALOG WINDOW NOT MAINFRAME WINDOW))l,so ithat it will not detach from Main Frame.

    Which message Map handler I should use.Can u pl. suggest some solution in this regard.

    Regs

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Modeless Dialog problem

    One solution is to handle WM_NCHITTEST
    Code:
    UINT CMyDialog::OnNcHitTest(CPoint point) 
    {
       UINT nRet = CDialog::OnNcHitTest(point);
       if(HTCAPTION == nRet)
       {
          nRet = HTNOWHERE;
       }
       return nRet;
    }
    Another one is to create a dialog with no caption.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Feb 2005
    Posts
    64

    Re: Modeless Dialog problem

    Hi,
    Thanks for your reply. Now the problem has been solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured