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. SDI Main Frame positioning?

SDI Main Frame positioning?

Scheduled Pinned Locked Moved C / C++ / MFC
helpwpfquestion
1 Posts 1 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.
  • K Offline
    K Offline
    kriaz
    wrote on last edited by
    #1

    I want my SDI application to have always the same size and position on screen. Resizing and Moving is disabled by the code below; which is inserted in OnCreate of main frame CMenu* pTopMenu = GetSystemMenu(FALSE); if(pTopMenu != NULL) { pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //No ReSize pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //No Move } for Resize and move above code works fine! BUT for size let us look at PreCreatewindow of Mainframe BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style &= ~FWS_ADDTOTITLE; cs.x = 0; cs.y = 77; cs.cx = 1000; cs.cy = 500; return TRUE; } the above code didn't work; if i change one value in the structure the other is automatically changed/ignored, gives unexpected positioning. May be some sort of aspect ratio problem which windows might be maintaining internally. Another soloution is to use Move in the initinstance but i want to avoid it since it first shows main frame at the 0,0 position and then moves it to required postion, with a slight but observable delay. Please help to solve the above problem.

    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