Changeset 27 for trunk/bitmap.cpp
- Timestamp:
- Mar 13, 2018, 6:34:46 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bitmap.cpp
r11 r27 19 19 20 20 // ** CaptureWindow ******************************************************* /*FOLD00*/ 21 21 #include <ctype.h> 22 22 #define MAX_WAIT 15 23 23 … … 36 36 37 37 // wait for the selected window to rise to the surface 38 if ( (hwndParent != HWND_DESKTOP) &&f)38 if (f) 39 39 { 40 40 WinSetWindowPos (hwndParent, HWND_TOP, 0,0, 0,0, SWP_ZORDER); … … 149 149 sizeof (aptl) / sizeof (POINTL), /* Number of points in aptl */ 150 150 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); 152 195 153 196 // re-associate the previous bit map and the memory presentation space
Note:
See TracChangeset
for help on using the changeset viewer.