Changeset 391 for trunk


Ignore:
Timestamp:
Apr 14, 2010, 7:06:15 PM (11 years ago)
Author:
dmik
Message:

Close Lucide in fullscreen and max view mode with Alt-F4.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/gui/lucide.cpp

    r388 r391  
    177177
    178178
    179 PFNWP pOldSplProc;
     179PFNWP pOldFrameProc = NULL;
     180PFNWP pOldSplProc   = NULL;
    180181
    181182void Lucide::enableCopy( bool enable )
     
    772773    {
    773774        docViewer->setFullscreen( false );
    774         WinSetParent( hWndMenu, hWndFrame, TRUE );
     775        WinSetParent( hWndMenu, hWndFrame, FALSE );
    775776    }
    776777    else if ( fullscreenState == On )
     
    994995}
    995996
     997static MRESULT EXPENTRY frameProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
     998{
     999    switch ( msg )
     1000    {
     1001        case WM_SYSCOMMAND:
     1002        {
     1003            if ( SHORT1FROMMP(mp1) == SC_CLOSE ) {
     1004                // the system menu is disabled in fullscreen/presentation mode
     1005                // but we still want to exit with Alt-F4 so always handle it here
     1006                WinPostMsg( hWndFrame, WM_CLOSE, NULL, NULL );
     1007                return (MRESULT)FALSE;
     1008            }
     1009        }
     1010        break;
     1011    }
     1012
     1013    return pOldFrameProc( hwnd, msg, mp1, mp2 );
     1014}
     1015
    9961016static MRESULT EXPENTRY splProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
    9971017{
     
    12921312    hWndFrame = WinCreateStdWindow( HWND_DESKTOP, 0, &ulFrameFlags, NULL, title,
    12931313                                    WS_SYNCPAINT|WS_VISIBLE, _hmod, IDI_MAIN_ICON, NULL );
     1314    pOldFrameProc = WinSubclassWindow( hWndFrame, frameProc );
     1315
    12941316    hFrameSysmenu  = WinWindowFromID( hWndFrame, FID_SYSMENU );
    12951317    hFrameTitlebar = WinWindowFromID( hWndFrame, FID_TITLEBAR );
Note: See TracChangeset for help on using the changeset viewer.