CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Location
    Bangalore, INDIA
    Posts
    20

    How to prevent Modeless Dialog box on the Task Bar

    Hai all,

    I use a modeless dialog box in my application.
    But, the window for the modeless dialog in the task bar is also seen.

    How can i prevent it?

    Also, when I resize the application window, I can not change the position of the modeless dialog box, correspondingly.

    Simply, I am trying to make the Modeless Dialog box to be a part of my application window.

    Please help me,

    With Thanks and Rgds,
    Arun

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354
    May be you want to make the modeless dialog a child of the application window.

  3. #3
    Join Date
    Apr 2004
    Location
    Bangalore, INDIA
    Posts
    20

    Re:How to prevent Modeless Dialog box on the Task Bar

    Yes kirant,

    I want the modeless dalog to be a child of application window.

    how can it be done?

    With thanks,
    Arun

  4. #4
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354
    Just to give you an idea:

    1. Create a sample SDI MFC app.
    2. Compile.
    3. Now, add a dialog resource , say IDD_DIALOG1
    4. Drop an edit box , for e.g.
    5. Select the dialog properties, in the styles tab, select style as child, and border as None
    6. Save the resource
    7. Go to class wizard and add a new class for this dialog, say CMyModelessDlg.
    8. open the view class' header file and include the CMyModelessDlg.h
    9. Add a member variable to the view class
    CMyModelessDlg m_oDlg;
    10. Go to class wizard of the View class and add a WM_CREATE handler.
    11. In the OnCreate add this:
    Code:
    int CSampviewView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
    {
    	if (CView::OnCreate(lpCreateStruct) == -1)
    		return -1;
    	
    	// TODO: Add your specialized creation code here
    	m_oDlg.Create(IDD_DIALOG1,this);
      m_oDlg.ShowWindow(SW_SHOW);
    	return 0;
    }
    Hope this helps..

  5. #5
    Join Date
    Apr 2004
    Location
    Bangalore, INDIA
    Posts
    20
    Thanks Kirant.
    Its work.

    With thanks,
    Arun

  6. #6
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917
    To clarify:
    If you call Create to cerate modeless dialog and pass pointer to a window, dialog becomes a child of that window only if WS_CHILD style is set.

    Otherwise window becomes an owner of a dialog, not a parent.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

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