Changeset 27 for trunk/bitmap.cpp


Ignore:
Timestamp:
Mar 13, 2018, 6:34:46 PM (7 years ago)
Author:
Gregg Young
Message:

Remove mmio code; Ticet #5 Get gotcha "quiet" version working Tickets #1 #7 #9 Dialog changes related to both "quiet" and regular modes ( dialogs still need to be split in order to build both; only "quite can be bult from this) See Ticket #9 for a more complete list of changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bitmap.cpp

    r11 r27  
    1919
    2020// ** CaptureWindow ******************************************************* /*FOLD00*/
    21 
     21#include <ctype.h>
    2222#define MAX_WAIT   15
    2323
     
    3636
    3737    // wait for the selected window to rise to the surface
    38     if ((hwndParent != HWND_DESKTOP) &&  f)
     38    if (f)
    3939    {
    4040        WinSetWindowPos (hwndParent, HWND_TOP, 0,0, 0,0, SWP_ZORDER);
     
    149149               sizeof (aptl) / sizeof (POINTL), /* Number of points in aptl */
    150150               aptl, ROP_SRCCOPY, BBO_IGNORE);
    151     SaveBitmap (hbm, hpsMem, sWidth, sHeight, bmp.cBitCount);
     151
     152    SWCNTRL  swctl;
     153    PID      pid;
     154    TID      tid;
     155    BOOL screen = FALSE, region = FALSE;
     156    CHAR title[11];
     157
     158    if (!f) {
     159        //hwndParent = WinQueryFocus(HWND_DESKTOP);
     160        if (hwndParent == hwndFrame) {
     161            DebugHereIAm();
     162            hwndParent = WinQueryWindow(hwndFrame, QW_NEXTTOP );
     163        }
     164        screen = TRUE;
     165        if (prcl)
     166            region = TRUE;
     167    }
     168
     169    int rc = WinQueryWindowProcess(hwndParent, &pid, &tid);
     170    if (WinQuerySwitchEntry(WinQuerySwitchHandle(hwndParent, pid),
     171                            &swctl))
     172        WinQuerySwitchEntry(WinQuerySwitchHandle(NULLHANDLE, pid),
     173                            &swctl);
     174
     175    char buffer[MAXNAMEL+4];
     176    int length = strlen( swctl.szSwtitle );
     177    strcpy(buffer, swctl.szSwtitle);
     178    char *p;
     179    p = buffer;
     180    for (int i = 0; i < (length < 11 ? length : 11); i++) {
     181        if ( ispunct( *p ) || *p == '\\' || isblank( *p )) {
     182            *p = '_';
     183        }
     184        p++;
     185    }
     186
     187    if (region)
     188        snprintf( title, length < 8 ? length + 3 : 11, "SR%s", buffer);
     189    else if (screen)
     190        snprintf( title, length < 8 ? length + 3 : 11, "SC%s", buffer);
     191    else
     192        snprintf( title, length < 8 ? length + 3 : 11, "WD%s", buffer);
     193
     194    SaveBitmap (hbm, hpsMem, sWidth, sHeight, bmp.cBitCount, title);
    152195
    153196    // re-associate the previous bit map and the memory presentation space
Note: See TracChangeset for help on using the changeset viewer.