Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mainwin.cpp

    r10 r30  
    1818 ***/
    1919
    20 // ** CreateMainWindow **************************************************** /*fold00*/
     20// ** CreateMainWindow **************************************************** /*FOLD00*/
    2121
    2222HWND CreateMainWindow (VOID)
    2323{
     24#ifdef _QUIET_
     25//#if 1
     26    hwndFrame = WinLoadDlg (HWND_OBJECT, NULLHANDLE, NULL, GETMODULE,
     27                            ID_DLG_MAIN, NULL);
     28#else
    2429    hwndFrame = WinLoadDlg (HWND_DESKTOP, NULLHANDLE, NULL, GETMODULE,
    2530                            ID_DLG_MAIN, NULL);
     31#endif
    2632    OldFrameWP = WinSubclassWindow (hwndFrame, FrameProcedure);
    2733
     
    7076}
    7177
    72 // ** Drag **************************************************************** /*fold00*/
     78// ** Drag **************************************************************** /*FOLD00*/
    7379
    7480VOID Drag (HWND hwnd)
     
    110116}
    111117
    112 // ** FrameProcedure ****************************************************** /*fold00*/
     118// ** FrameProcedure ****************************************************** /*FOLD00*/
    113119
    114120MRESULT EXPENTRY FrameProcedure (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     
    273279            break;
    274280
     281        case WID_PB_SETCAPTURETYPE:
     282            //int capType;
     283
     284            switch (pset->QuerySSWCaptureType ())
     285            {
     286            case CAP_WINDOWINT:
     287                WinSendMsg (hwndFrame, WM_COMMAND,
     288                            MPFROM2SHORT (WID_PB_WINDOWINTERIOR,0), 0);
     289            case CAP_SCREENREGION:
     290                WinSendMsg (hwndFrame, WM_COMMAND,
     291                            MPFROM2SHORT (WID_PB_SCREENREGION,0), 0);
     292            case CAP_WINDOW:
     293                WinSendMsg (hwndFrame, WM_COMMAND,
     294                            MPFROM2SHORT (WID_PB_WINDOW,0), 0);
     295            default:
     296               WinSendMsg (hwndFrame, WM_COMMAND,
     297                            MPFROM2SHORT (WID_PB_SCREEN,0), 0);
     298            }
     299            break;
     300
    275301        case WID_PB_SCREEN:
    276302            usCap = CAP_SCREEN;
     303#ifdef _QUIET_
     304//#if 1
     305            WinShowWindow (g_hwndSettingsDialog, FALSE);
     306            // WinSendMsg (g_hwndSettingsDialog, WM_CLOSE, 0,0); //Needs to go to the setting dialog
     307            // Replace current global with pset->GetSettingDialogHwnd () or such
     308            // Need for all 4 cases;
     309#endif
    277310            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    278311            break;
     
    280313        case WID_PB_SCREENREGION:
    281314            usCap = CAP_SCREENREGION;
     315#ifdef _QUIET_
     316//#if 1
     317            WinShowWindow (g_hwndSettingsDialog, FALSE);
     318#endif
    282319            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    283320            break;
     
    285322        case WID_PB_WINDOWINTERIOR:
    286323            usCap = CAP_WINDOWINT;
     324#ifdef _QUIET_
     325//#if 1
     326            WinShowWindow (g_hwndSettingsDialog, FALSE);
     327#endif
    287328            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    288329            break;
     
    290331        case WID_PB_WINDOW:
    291332            usCap = CAP_WINDOW;
     333#ifdef _QUIET_
     334//#if 1
     335            WinShowWindow (g_hwndSettingsDialog, FALSE);
     336#endif
    292337            WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
    293338            break;
     
    314359
    315360        usState = STATE_WAITFORHIDE;
     361
     362        if (usCap == CAP_SCREENREGION || usCap == CAP_SCREEN) {
     363#ifdef _QUIET_
     364            hwndParent = WinQueryFocus(HWND_DESKTOP);
     365#else
     366            hwndParent = WinQueryWindow(hwndFrame, QW_NEXTTOP );
     367#endif
     368        }
     369#ifndef _QUIET_
     370//#if 0
    316371        if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW))
    317372            WinShowWindow (WinQueryWindow (hwnd, QW_PARENT), FALSE);
    318373        else
     374#endif
    319375            WinSendMsg (hwnd, UM_WINDOWHIDDEN, 0,0);
    320376        return MRESULT (FALSE);
     
    346402            {
    347403                usState = STATE_WINDOWSELECTED;
    348                 WinPostMsg (hwnd, UM_WINDOWSELECTED,
    349                             MPFROMHWND (HWND_DESKTOP),
    350                             MPFROMHWND (HWND_DESKTOP));
     404                int rc = saymsg2(1, hwnd,  "Capture", "Do you wish to continue?");
     405               
     406                if (rc == 1)
     407                    WinPostMsg (hwnd, UM_WINDOWSELECTED,
     408                                MPFROMHWND (HWND_DESKTOP),
     409                                MPFROMHWND (HWND_DESKTOP));
     410                if (rc == 2)
     411                    WinSendMsg (hwnd, UM_ABORT, 0,0);
     412                if (rc == 3) {
     413                    pset->Dialog ();
     414                    WinPostMsg (hwnd, UM_WINDOWSELECTED,
     415                                MPFROMHWND (HWND_DESKTOP),
     416                                MPFROMHWND (HWND_DESKTOP));
     417                }
    351418            }
    352419            else
     
    417484                                                             FALSE));
    418485            hwndCap = HWND (mp1);
    419             hwndParent = HWND (mp2);
     486            if (usCap != CAP_SCREENREGION && usCap != CAP_SCREEN)
     487                hwndParent = HWND (mp2);
    420488            if (pset->SerialCapture ())
    421489            {
     
    478546            // capture the window to a bitmap and save this
    479547            if (usCap == CAP_SCREENREGION)
    480                 hbm = CaptureWindow (hwndCap, hwndParent, &rcl, TRUE);
     548                hbm = CaptureWindow (hwndCap, hwndParent, &rcl, FALSE);
     549            else if (usCap == CAP_SCREEN)
     550                hbm = CaptureWindow (hwndCap, hwndParent, NULL, FALSE);
    481551            else
    482552                hbm = CaptureWindow (hwndCap, hwndParent, NULL, TRUE);
     
    512582            WinSetCapture (HWND_DESKTOP, NULLHANDLE);
    513583
     584        pset->Load ();
     585
    514586        WinSendMsg (hwndSnapshot, UM_STOPCAPTURE, 0,0);
    515587        WinStopTimer (hab, hwnd, ulTimer);
    516 
     588#ifdef _QUIET_
     589//#if 1
     590        // ? FIXME to give option to reshow window.
     591        if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW))
     592            WinSendMsg (g_hwndSettingsDialog, WM_CLOSE, 0,0);
     593        else if (WinIsWindow ( hab, g_hwndSettingsDialog) &&
     594            ! WinIsWindowVisible (g_hwndSettingsDialog))
     595            WinShowWindow (g_hwndSettingsDialog, TRUE);
     596        pset->HideWindow (TRUE);
     597#else
    517598        // re-show the windows if they are hidden
    518599        // FIXME using global hwndFrame is pretty yukki
     
    521602        if (! WinIsWindowVisible (hwndSnapshot) && pset->SnapshotWindow ())
    522603            WinShowWindow (hwndSnapshot, TRUE);
    523 
     604#endif
    524605        WinEnableWindow (hwnd, TRUE);
    525606        WinSetActiveWindow (HWND_DESKTOP, hwnd);
Note: See TracChangeset for help on using the changeset viewer.