如题?
http://expert.csdn.net/Expert/topic/2854/2854042.xml?temp=.8935968
加此贴,解决者共150分!

解决方案 »

  1.   

    在创建窗口的时候!!
    会有一个 模式参数大概是cs
    吧,你修改cs的参数,就可以了!!
    我找找,
      

  2.   

    我在主窗口框架创建了一个工具栏
    在子窗口也创建了,但是如果他们指定的toolbar资源一样,没问题
    但是不一样,就会发生主窗口和子窗口显示的东西都是乱的图!
      

  3.   

    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
    return -1;

    if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
    | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
    !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
    {
    TRACE0("Failed to create toolbar\n");
    return -1;      // fail to create
    } if (!m_wndStatusBar.Create(this) ||
    !m_wndStatusBar.SetIndicators(indicators,
      sizeof(indicators)/sizeof(UINT)))
    {
    TRACE0("Failed to create status bar\n");
    return -1;      // fail to create
    } // TODO: Delete these three lines if you don't want the toolbar to
    //  be dockable
    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_wndToolBar); return 0;
    }
    这里是修改工具条,状态条样式的地方!
      

  4.   

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    if( !CFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs return TRUE;
    }
    cs,是个结构,,注意添加里面的参数!!
      

  5.   

    CREATESTRUCT Structure
    The CREATESTRUCT structure has the following form:typedef struct tagCREATESTRUCT {
       LPVOID    lpCreateParams;
       HANDLE    hInstance;
       HMENU     hMenu;
       HWND      hwndParent;
       int       cy;
       int       cx;
       int       y;
       int       x;
       LONG      style;
       LPCSTR    lpszName;
       LPCSTR    lpszClass;
       DWORD     dwExStyle;
    } CREATESTRUCT;The CREATESTRUCT structure defines the initialization parameters passed to the window procedure of an application. MemberslpCreateParamsPoints to data to be used to create the window.hInstanceIdentifies the module-instance handle of the module that owns the new window.hMenuIdentifies the menu to be used by the new window. If a child window, contains the integer ID.hwndParentIdentifies the window that owns the new window. This member is NULL if the new window is a top-level window.cySpecifies the height of the new window.cxSpecifies the width of the new window.ySpecifies the y-coordinate of the upper-left corner of the new window. Coordinates are relative to the parent window if the new window is a child window; otherwise coordinates are relative to the screen origin.xSpecifies the x-coordinate of the upper-left corner of the new window. Coordinates are relative to the parent window if the new window is a child window; otherwise coordinates are relative to the screen origin.styleSpecifies the new window’s style.lpszNamePoints to a null-terminated string that specifies the new window’s name.lpszClassPoints to a null-terminated string that specifies the new window’s Windows class name (aWNDCLASS structure; for more information, see the Win32 SDK documentation).dwExStyleSpecifies the extended style for the new window. See Also   CWnd::OnCreateMSDN
    Extended Window Styles
    WS_EX_ACCEPTFILES   Specifies that a window created with this style accepts drag-and-drop files. 
    WS_EX_CLIENTEDGE   Specifies that a window has a 3D look — that is, a border with a sunken edge.
    WS_EX_CONTEXTHELP   Includes a question  in the title bar of the window. When the user clicks the question , the cursor changes to a question  with a pointer. If the user then clicks a child window, the child receives a WM_HELP message.
    WS_EX_CONTROLPARENT   Allows the user to navigate among the child windows of the window by using the TAB key.
    WS_EX_DLGMODALFRAME   Designates a window with a double border that may (optionally) be created with a title bar when you specify the WS_CAPTION style flag in the dwStyle parameter. 
    WS_EX_LEFT   Gives window generic left-aligned properties. This is the default.
    WS_EX_LEFTSCROLLBAR   Places a  vertical scroll bar to the left of the client area.
    WS_EX_LTRREADING   Displays the window text using left-to-right reading order properties. This is the default.
    WS_EX_MDICHILD   Creates an MDI child window.
    WS_EX_NOPARENTNOTIFY   Specifies that a child window created with this style will not send the WM_PARENTNOTIFY message to its parent window when the child window is created or destroyed. 
    WS_EX_OVERLAPPEDWINDOW   Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles
    WS_EX_PALETTEWINDOW   Combines the WS_EX_WINDOWEDGE and WS_EX_TOPMOST styles.
    WS_EX_RIGHT   Gives a window generic right-aligned properties. This depends on the window class.
    WS_EX_RIGHTSCROLLBAR   Places a vertical scroll bar (if present) to the right of the client area. This is the default.
    WS_EX_RTLREADING   Displays the window text using right-to-left reading order properties.
    WS_EX_STATICEDGE   Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.
    WS_EX_TOOLWINDOW   Creates a tool window, which is a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the task bar or in the window that appears when the user presses ALT+TAB.
    WS_EX_TOPMOST   Specifies that a window created with this style should be placed above all nontopmost windows and stay above them even when the window is deactivated. An application can use the SetWindowPos member function to add or remove this attribute. 
    WS_EX_TRANSPARENT   Specifies that a window created with this style is to be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receives WM_PAINT messages only after all sibling windows beneath it have been updated.
    WS_EX_WINDOWEDGE   Specifies that a window has a border with a raised edge.