SetWindowPos in CFormView

Nob

Mitglied
Hallo zusammen

Ich habe ein MFC Multiple documents von CFormView abgeleitet.
Nun möchte ich die Position und Grösse der Documente ändern. Ausserdem soll der Border und das Systemmenü (Minimize, Maximize, Schliessen) verschwinden.

Mit SetWindowPos hat das ganze nicht geklappt..
SetWindowPos(NULL, 10,20,50,100,NULL);

Dann habe ich versucht in der PreCreateWindow Funktion die CREATESTRUCT zu manipulieren leider auch ohne Erfolg....

Hat jemand einen Vorschlag/Lösung?
Besten Danke
 
Aber da bist du genau richtig:
Code:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 
{ 
    // Create a window without min/max buttons or sizable border 
    cs.style = WS_OVERLAPPED | WS_SYSMENU | WS_BORDER;

    // Size the window to 1/3 screen size and center it 
    cs.cy = ::GetSystemMetrics(SM_CYSCREEN) / 3; 
    cs.cx = ::GetSystemMetrics(SM_CXSCREEN) / 3; 
    cs.y = ((cs.cy * 3) - cs.cy) / 2; 
    cs.x = ((cs.cx * 3) - cs.cx) / 2;

    // Call the base-class version
    return CFrameWnd::PreCreateWindow(cs); 
}

weiteres in der msdn
mfg
 
Zurück