Lustiges Verhalten des Mainframe bei cs.style ohne WS_MAXIMIZEBOX - wie korrigiert man das?



  • Hallo!

    Ich habe eine SDI.
    In der CMainFrame::PreCreateWindow habe ich folgende Zeile:

    cs.style = WS_OVERLAPPED | WS_CAPTION | WS_MINIMIZEBOX | WS_MAXIMIZEBOX //| FWS_ADDTOTITLE
    			| WS_SYSMENU;
    

    Ich lasse das Fenster im Vollbild anzeigen mit

    m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
    

    in InitInstance.

    Nun soll der Benutzer das Fenster aber nur minimieren oder schließen dürfen.
    Deswegen habe ich die Zeile geändert auf:

    cs.style = WS_OVERLAPPED | WS_CAPTION | WS_MINIMIZEBOX //| WS_MAXIMIZEBOX //| FWS_ADDTOTITLE
    			| WS_SYSMENU;
    

    Nun ist der Knopf brav grau und alles gut... bis ich auf die Startleiste gucke, die ist nämlich weg. 😮
    Mein Programm ist formatfüllend. Das will ich aber nicht, die Startleiste soll bleiben, wo sie hingehört. 🙄

    Irgendwelche Ideen? 🙂



  • Kann sein, dass du WM_SIZE oder so überschreiben musst. Und dann die Größe der Taskleiste beachten. Hatte auch das Problem und mich erst nicht drum gekümmert. 😃
    Zeitdruck, habe dann mit einer festen Größe gearbeitet.

    Vielleicht kannst du hiermit was anfangen:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowstructures/windowplacement.asp
    Speziell die Remarks hören sich interessant an.

    Oder:

    Maximizing Windows

    Although the user can manually resize a window to its maximum size, the Maximize command optimizes this operation. Include this command on a window's shortcut menu and as the Maximize command button in the title bar of the window.

    Maximizing a window increases the size of the window to its largest, optimum size. The system default setting for the maximum size is as large as the display, excluding the space used by the taskbar (or other application-defined desktop toolbars). However, you can define the size to be less than or, in some cases, more than the default dimensions.

    When the user maximizes a window, replace the Maximize button with a Restore button. Then, disable the Maximize command and enable the Restore command on the shortcut menu for the window.

    Zu finden unter:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch07d.asp



  • Vielleicht kannst du auch die
    MINMAXINFO-Struktur nutzen?


Anmelden zum Antworten