Changeset 41 for trunk/mainwin.cpp


Ignore:
Timestamp:
Mar 17, 2018, 11:00:45 PM (7 years ago)
Author:
Gregg Young
Message:

Fix hang on non-full screen capture of window with a menu open; Fix failure of widow to come to the top when program set as always on top are running. Add part of window title to auto file names; Major overhaul of settings dialog for Gotcha Quiet. More _QUIET_ ifdefs added to split code where Gotcha and Gotcha Quiet differ.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mainwin.cpp

    r39 r41  
    3131#endif
    3232    OldFrameWP = WinSubclassWindow (hwndFrame, FrameProcedure);
    33 
     33#ifndef _QUIET_
    3434    // attach the icon
    3535    if (HPOINTER hicon = WinLoadPointer (HWND_DESKTOP, GETMODULE, 1))
     
    3939    if (HACCEL haccel = WinLoadAccelTable (hab, GETMODULE, 1))
    4040        WinSetAccelTable (hab, haccel, hwndFrame);
     41#endif
    4142
    4243    // add extensions to system menu
    43     static MENUITEM MenuAbout = { MIT_END, MIS_TEXT, 0, WID_PB_ABOUT, 0, 0 };
     44/*    static MENUITEM MenuAbout = { MIT_END, MIS_TEXT, 0, WID_PB_ABOUT, 0, 0 };
    4445    static MENUITEM MenuSettings = { MIT_END, MIS_TEXT, 0, WID_PB_SETTINGS, 0, 0 };
    4546    static MENUITEM MenuGeneralHelp = { MIT_END, MIS_TEXT, 0, HM_GENERAL_HELP, 0, 0 };
     
    4950    AddSysMenuItem (hwndFrame, &MenuSettings, RSTR(IDS_SETTINGS));
    5051    AddSysMenuItem (hwndFrame, &MenuGeneralHelp, RSTR(IDS_GENERALHELP));
    51     AddSysMenuItem (hwndFrame, &MenuAbout, RSTR(IDS_PRODUCTINFORMATION));
     52    AddSysMenuItem (hwndFrame, &MenuAbout, RSTR(IDS_PRODUCTINFORMATION));*/
    5253
    5354    HWND   hwnd = WinWindowFromID (hwndFrame, FID_CLIENT);
     
    248249            return MRESULT (FALSE);
    249250        }
     251#ifndef _QUIET_
    250252        else
    251253            // FIXME pretty yukki to do it this way I guess ...
    252254            WinSendMsg (hwnd, UM_ADJUSTSETTINGS, 0,0);
    253 
     255#endif         
    254256        switch (SHORT1FROMMP (mp1))
    255257        {
     
    281283        case WID_PB_SETCAPTURETYPE:
    282284            //int capType;
     285            if (LONGFROMMP(mp2) == 1) {
     286                pset->SetSaveStyle (SAVESTYLE_CLIPBOARD);
     287            }
    283288
    284289            switch (pset->QuerySSWCaptureType ())
     
    357362    case UM_PREPARECAPTURE:
    358363        WinSendMsg (hwndSnapshot, UM_STARTCAPTURE, 0,0);
    359 
    360364        usState = STATE_WAITFORHIDE;
    361365
     
    367371#endif
    368372        }
     373        else {
     374            SWP     swp;
     375            CHAR    ach[32] = {0};
     376
     377            WinQueryClassName (WinQueryFocus(HWND_DESKTOP), sizeof (ach), ach);
     378            if (stricmp (ach, "#4") == 0) {
     379                WinSendMsg (hwnd, UM_ABORT, 0,0);
     380                if (usCap == CAP_WINDOW)
     381                    WinSendMsg (hwndFrame, WM_COMMAND,
     382                                MPFROM2SHORT (WID_PB_WINDOW,0), 0);
     383                else
     384                    WinSendMsg (hwndFrame, WM_COMMAND,
     385                                MPFROM2SHORT (WID_PB_WINDOWINTERIOR,0), 0);
     386                return MRESULT (FALSE);
     387            }
     388        }
    369389#ifndef _QUIET_
    370 //#if 0
    371         if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW))
     390        if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW)) {
    372391            WinShowWindow (WinQueryWindow (hwnd, QW_PARENT), FALSE);
     392        }
    373393        else
    374394#endif
    375             WinSendMsg (hwnd, UM_WINDOWHIDDEN, 0,0);
     395            WinPostMsg (hwnd, UM_WINDOWHIDDEN, 0,0);
    376396        return MRESULT (FALSE);
    377397
     
    444464            POINTL   ptl;
    445465            WinQueryPointerPos (HWND_DESKTOP, &ptl);
    446 
    447466            HWND   hwndCapture =
    448467                WinWindowFromPoint (HWND_DESKTOP, &ptl, FALSE);
Note: See TracChangeset for help on using the changeset viewer.