Changeset 38


Ignore:
Timestamp:
Mar 14, 2018, 8:51:47 PM (7 years ago)
Author:
Gregg Young
Message:

Remove -q command line switch and associated code. Clean up code to prevent the other command line switches from changing the saved settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/gotcha.cpp

    r36 r38  
    3434PFNWP       OldFrameWP, wpOldButton;
    3535PSETTINGS   pset;
    36 BOOL        g_fQuiet = FALSE, g_fIdle = FALSE, g_fSetPathName = FALSE;
     36BOOL        g_fIdle = FALSE, g_fSetPathName = FALSE;
    3737HWND        g_hwndMenuSSW;
    3838HMODULE     g_hmod = NULLHANDLE;
     
    5252    for (USHORT i = 1; i < argc; i++)
    5353    {
    54         // quiet or batch mode
    55         if ((stricmp (argv[i], "-q") == 0) || (stricmp (argv[i], "-a") == 0))
     54        // batch mode
     55        if ((stricmp (argv[i], "-a") == 0))
    5656        {
    5757            if (pset->QuerySaveStyle () != FSS_FORCEFILE)
    5858                pset->SetFileSaveStyle (FSS_NUMFILES);
    59 
    60             if (stricmp (argv[i], "-q") == 0)
    61             {
    62                 pset->SerialCapture (FALSE);
    63                 g_fQuiet = TRUE;
    64             }
    65             else
    6659                fAuto = TRUE;
    6760
     
    7265                    pset->SetFileSaveStyle (FSS_NUMFILES);
    7366                    pset->SetNumSaveDir (argv[i]);
    74                     g_fSetPathName = TRUE;
    7567                }
    7668        }
     
    117109    if ((Version() < 1))
    118110    {
    119         DisplayError("GOTCHDLL.DLL TO OLD",
     111        DisplayError("GOTCHDLL.DLL TOO OLD",
    120112                     "The file gotchdll.dll is to old for this version of "
    121113                     "Gotcha! Quiet As you should have received a sufficiently "
     
    162154        CaptureWindow (HWND_DESKTOP, HWND_DESKTOP, NULL, TRUE);
    163155        pset->SetFileSaveStyle(pset->saveStyle);
     156        pset->SetNumSaveDir (pset->pNumSaveDir);
    164157        delete pset;
    165158        WinDestroyMsgQueue (hmq);
     
    182175                     SWP_SHOW | SWP_MOVE);
    183176
    184     // init the quiet mode
    185     //if (g_fQuiet)
    186     //{
     177   
    187178#ifdef _QUIET_
    188 //#if 1
    189     DebugHereIAm();
    190179        InitDLL (hab, hwndFrame);
    191180        StartInputHook ();
    192181#endif
    193 
    194         //CHAR ach[61];
    195         //WinQueryWindowText (hwndFrame, sizeof (ach), ach);
    196         //strcat (ach, RSTR (IDS_QUIETMODE));
    197         //WinSetWindowText (hwndFrame, ach);
    198         //WinSetWindowPos (hwndFrame, NULLHANDLE, 0,0, 0,0, SWP_MINIMIZE);
    199         //HSWITCH hswitch = WinQuerySwitchHandle(hwndFrame, 0);
    200         //WinRemoveSwitchEntry(hswitch);
    201     //}
    202182
    203183    // position snapshot window
     
    226206
    227207    // Set priorty to unless user set regular since running -q sets it to idle in the ini
    228     if (g_fIdle || g_fQuiet) {
     208    if (g_fIdle) {
    229209        pset->SetFlag (SEI_IDLEPRIORITY, pset->idleSetInIni);
    230         if (g_fQuiet) {
    231             pset->SetFileSaveStyle (pset->saveStyle); // changed with -q
    232             pset->SerialCapture (pset->bSerialCapture); // changed with -q
    233         }
    234210    }
    235211    // Don't change the ini stored paths if the paths were set from the command line
     
    252228
    253229#ifdef _QUIET_
    254 //#if 1
    255230    if (fPrtScr || !rc) {
    256231        PrfWriteProfileData(HINI_USERPROFILE, "PM_ControlPanel", "PrintScreen",
    257232                            &fPrtScr, sizeof(bool));
    258233    }
    259     //if (g_fQuiet)
    260         StopInputHook ();
     234    StopInputHook ();
    261235#endif
    262236
     
    290264}
    291265
     266// saymsg2 was adapted from code in FM/2
    292267APIRET saymsg2(int DefaultButton, HWND hwnd,  PCSZ pszTitle, PCSZ pszFmt, ...)
    293268{
Note: See TracChangeset for help on using the changeset viewer.