about SetWindowText() and change window default style
-
(1)set the caption for toolbar int CMainFrame : : OnCreate (LPCREATESTRUCT lpCreateStruct ) {// Set the caption of the toolbar . m_wndToolBar.SetWindowText (_T "Standdard"); } question:why not respond when running i cant see the caption (2)Set title for View's MDI child frame window . in CMyChildFrame::PreCreateWindow() or in CMyViw::PreCreateWindow write : GetParentFrame( )-> SetWindowText (_T ("MDI Child Frame new title")); no error when compile but once run terminate,why? (3)i want to change default window style BOOL CMainFrame:: PreCreateWindow (CREATESTRUCT &cs) { cs.style &=~WS_MAXIMIZE; cs.x=cs.y=0; cs.cx=GetSystemMetrics(SM_CXSCREEN/2); cs.cy=GetSystemMetrics(SM_CYSCREEN/2); return CMDIFramewnd ::PreCreateWindow(cs) } but when i run ,why the maxsize still has on the window
-
(1)set the caption for toolbar int CMainFrame : : OnCreate (LPCREATESTRUCT lpCreateStruct ) {// Set the caption of the toolbar . m_wndToolBar.SetWindowText (_T "Standdard"); } question:why not respond when running i cant see the caption (2)Set title for View's MDI child frame window . in CMyChildFrame::PreCreateWindow() or in CMyViw::PreCreateWindow write : GetParentFrame( )-> SetWindowText (_T ("MDI Child Frame new title")); no error when compile but once run terminate,why? (3)i want to change default window style BOOL CMainFrame:: PreCreateWindow (CREATESTRUCT &cs) { cs.style &=~WS_MAXIMIZE; cs.x=cs.y=0; cs.cx=GetSystemMetrics(SM_CXSCREEN/2); cs.cy=GetSystemMetrics(SM_CYSCREEN/2); return CMDIFramewnd ::PreCreateWindow(cs) } but when i run ,why the maxsize still has on the window
-
(1)set the caption for toolbar int CMainFrame : : OnCreate (LPCREATESTRUCT lpCreateStruct ) {// Set the caption of the toolbar . m_wndToolBar.SetWindowText (_T "Standdard"); } question:why not respond when running i cant see the caption (2)Set title for View's MDI child frame window . in CMyChildFrame::PreCreateWindow() or in CMyViw::PreCreateWindow write : GetParentFrame( )-> SetWindowText (_T ("MDI Child Frame new title")); no error when compile but once run terminate,why? (3)i want to change default window style BOOL CMainFrame:: PreCreateWindow (CREATESTRUCT &cs) { cs.style &=~WS_MAXIMIZE; cs.x=cs.y=0; cs.cx=GetSystemMetrics(SM_CXSCREEN/2); cs.cy=GetSystemMetrics(SM_CYSCREEN/2); return CMDIFramewnd ::PreCreateWindow(cs) } but when i run ,why the maxsize still has on the window
vividtang wrote: cs.style &=~WS_MAXIMIZE; This should be:
cs.style &= ~WS_MAXIMIZEBOX;
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
(1)set the caption for toolbar int CMainFrame : : OnCreate (LPCREATESTRUCT lpCreateStruct ) {// Set the caption of the toolbar . m_wndToolBar.SetWindowText (_T "Standdard"); } question:why not respond when running i cant see the caption (2)Set title for View's MDI child frame window . in CMyChildFrame::PreCreateWindow() or in CMyViw::PreCreateWindow write : GetParentFrame( )-> SetWindowText (_T ("MDI Child Frame new title")); no error when compile but once run terminate,why? (3)i want to change default window style BOOL CMainFrame:: PreCreateWindow (CREATESTRUCT &cs) { cs.style &=~WS_MAXIMIZE; cs.x=cs.y=0; cs.cx=GetSystemMetrics(SM_CXSCREEN/2); cs.cy=GetSystemMetrics(SM_CYSCREEN/2); return CMDIFramewnd ::PreCreateWindow(cs) } but when i run ,why the maxsize still has on the window