CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    170

    Red face Create CWnd problem

    hi.
    i create cwnd derived class.

    Code:
    Create(NULL,_T("Errors"),WS_CHILD|WS_CAPTION|WS_MAXIMIZE|WS_MINIMIZE|WS_OVERLAPPED,CRect(100,100,500,500),&CWnd(GetDesktopWindow()),0);
    In OnCreate of this window i create CListCtrl and button.

    But when i call ShowWindow(SW_SHOW), i see my window icon in task bar,but when i press it,i see window area with copy of my desktop screen,why?

  2. #2
    Join Date
    Apr 2003
    Location
    kathmandu, nepal
    Posts
    1,570

    Re: Create CWnd problem

    i think you need to supply WS_VISIBLE flag to the Create function
    If there is no love sun won't shine

  3. #3
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Create CWnd problem

    Quote Originally Posted by TOMNKZ
    In OnCreate of this window i create CListCtrl and button.

    But when i call ShowWindow(SW_SHOW), i see my window icon in task bar,but when i press it,i see window area with copy of my desktop screen,why?
    I do not see what are you creating (calling Create member of what class)?
    Does your code compile? I have doubt: &CWnd(GetDesktopWindow())
    Is your code snippet verbatim?
    You also create window that is a child of the desktop window. It is also created without background brush since Windows is using default window class. You should register your own.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  4. #4
    Join Date
    Jun 2004
    Posts
    170

    Re: Create CWnd problem

    I find solution for my problem.

    I create window in dll,so it lead to problems. Solution was to create not modal dialog, which parent can be NULL.

    Thank you for interest.

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