Changeset 89 for trunk/gotcha.cpp


Ignore:
Timestamp:
Aug 24, 2020, 11:57:26 PM (5 years ago)
Author:
Gregg Young
Message:

Remove snapshot window stuff from Gotcha Quiet. Add strings and adjust code so the error caused by trying to open GQ twice can be translated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gotcha.cpp

    r65 r89  
    114114    HMQ hmq = WinCreateMsgQueue (hab, 0);
    115115
     116    // Load settings move up here so the string table is available for the already running error
     117    pset = new SETTINGS;
    116118    //DisplayError("DEBUG", "%d", Version());
    117119#ifdef _QUIET_
     
    127129    int rc;
    128130    HMTX    hmtx     = NULLHANDLE;
    129     // running multiple instances orphans all but the first closed hook unloaded
     131    // running multiple instances orphans all but the first hook unloaded
    130132    rc = DosOpenMutexSem("\\SEM32\\GOTCHA", &hmtx);
    131133    if (!rc) {
    132         DisplayError("GOTCHA QUIET Already running",
    133                      "Another instance of Gotcha Quiet is running. You can "
    134                      "open Gotcha Quiet's settings using the Alt+PrintScreen "
    135                      "key combination");
     134        DisplayError(RSTR (IDS_ERROR_ALREADYRUNNING),
     135                     RSTR (IDS_ERROR_ALREADYRUNNINGMSG));
    136136        exit (0);
    137137    }
     
    147147    WinRegisterClass (hab, "thth.wc.gotcha.main", WindowProcedure, 0L,
    148148                      sizeof (ULONG)*2L);
     149#ifndef _QUIET_
    149150    WinRegisterClass (hab, "thth.wc.gotcha.snapshot", wpSnapshot,
    150151                      CS_SIZEREDRAW, sizeof (ULONG)*2L);
    151 
     152#endif
    152153    // load the settings
    153     pset = new SETTINGS;
     154    //pset = new SETTINGS;
    154155
    155156    pset->idleSetInIni = pset->QueryFlag(SEI_IDLEPRIORITY);
     
    175176    // create the windows
    176177    hwndFrame = CreateMainWindow ();
     178#ifndef _QUIET_
    177179    hwndSnapshot = CreateSnapshotWindow ();
    178 
     180#endif
    179181    SWP swp;
    180182    USHORT us[7];
     
    196198    StartInputHook ();
    197199#endif
    198 
     200#ifndef _QUIET_
    199201    // position snapshot window
    200202    pset->QueryWindowData (&swp, us);
     
    207209    else
    208210        WinShowWindow (hwndSnapshot, TRUE);
    209 
     211#endif
    210212    WinSetWindowPos (hwndFrame, NULLHANDLE, 0,0, 0,0, SWP_SHOW);
    211213    WinSetWindowPos (WinWindowFromID (hwndFrame, FID_CLIENT), NULLHANDLE,
     
    231233        pset->SetNumSaveDir (pset->pNumSaveDir);
    232234    }
     235#ifndef _QUIET_
    233236    // save size, etc. of snapshot window
    234237    WinQueryWindowPos (hwndSnapshot, &swp);
    235238    pset->SetWindowData (&swp);
    236 
     239#endif
    237240    // save size, etc. of main window
    238241    WinQueryWindowPos (hwndFrame, &swp);
     
    240243
    241244    // goodbye windows!
     245#ifndef _QUIET_
    242246    WinDestroyWindow (hwndSnapshot);
     247#endif
    243248    WinDestroyWindow (hwndFrame);
    244249
Note: See TracChangeset for help on using the changeset viewer.