Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. about SetWindowText() and change window default style

about SetWindowText() and change window default style

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vividtang
    wrote on last edited by
    #1

    (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

    A D V 3 Replies Last reply
    0
    • V vividtang

      (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

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Try CChildFrame* pFrame = (CChildFrame*)GetParentFrame(); if(pFrame) { pFrame->MDIMaximize(); pFrame-> SetWindowText (_T ("MDI Child Frame new title")); } and put it into OnInitialUpdate

      1 Reply Last reply
      0
      • V vividtang

        (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

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        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 Reply Last reply
        0
        • V vividtang

          (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

          V Offline
          V Offline
          vividtang
          wrote on last edited by
          #4

          if i use the method of that mr anonymous,when run,the program will maximize,although i want to cancel maximize,but the caption of the child frame view is still not been changed.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups