~ubuntu-branches/debian/jessie/italc/jessie

« back to all changes in this revision

Viewing changes to ica/win32/src/vncDesktop.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2011-02-11 14:50:22 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20110211145022-sn173siax6lywjus
Tags: upstream-1.0.13
ImportĀ upstreamĀ versionĀ 1.0.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
1278
1278
        }
1279
1279
 
1280
1280
        // Set the "this" pointer for the window
1281
 
        SetWindowLong(m_hwnd, GWL_USERDATA, (long)this);
 
1281
        SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this);
1282
1282
 
1283
1283
        // Enable clipboard hooking
1284
1284
        m_hnextviewer = SetClipboardViewer(m_hwnd);
1401
1401
        else    CaptureScreenFromAdapterGeneral(UpdateArea, scrBuff);
1402
1402
}
1403
1403
 
 
1404
 
 
1405
static bool __hasLayeredWindows = false;
 
1406
 
 
1407
static BOOL CALLBACK checkForLayeredWindow( HWND hwnd, LPARAM lParam )
 
1408
{
 
1409
        if( ( GetWindowLongPtr( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED ) &&
 
1410
                        IsWindowVisible( hwnd ) &&
 
1411
                        !IsIconic( hwnd ) )
 
1412
        {
 
1413
                __hasLayeredWindows = true;
 
1414
                return false;
 
1415
        }
 
1416
        return true;
 
1417
}
 
1418
 
 
1419
 
 
1420
static bool useCaptureBlt()
 
1421
{
 
1422
        __hasLayeredWindows = false;
 
1423
        EnumWindows((WNDENUMPROC)checkForLayeredWindow, 0);
 
1424
        return __hasLayeredWindows;
 
1425
}
 
1426
 
 
1427
 
 
1428
 
1404
1429
void vncDesktop::CaptureScreenFromAdapterGeneral(RECT rect, BYTE *scrBuff)
1405
1430
{
1406
1431
// ASSUME rect related to virtual desktop
1428
1453
                rect.bottom - rect.top,
1429
1454
                m_hrootdc,
1430
1455
                rect.left, rect.top,
1431
 
                SRCCOPY);
 
1456
                useCaptureBlt() ? ( SRCCOPY | CAPTUREBLT ) : SRCCOPY );
1432
1457
 
1433
1458
        // Select the old bitmap back into the memory DC
1434
1459
        SelectObject(m_hmemdc, oldbitmap);
1781
1806
{
1782
1807
 
1783
1808
        //For excluding the popup windows
1784
 
        if ((GetWindowLong( hwnd, GWL_STYLE) & WS_POPUP) ==0)
 
1809
        if ((GetWindowLongPtr( hwnd, GWL_STYLE) & WS_POPUP) ==0)
1785
1810
        {
1786
1811
        
1787
1812
                HANDLE prop = GetProp(hwnd, (LPCTSTR) MAKELONG(VNC_WINDOWPOS_ATOM, 0));
1873
1898
LRESULT CALLBACK
1874
1899
DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
1875
1900
{
1876
 
        vncDesktop *_this = (vncDesktop*)GetWindowLong(hwnd, GWL_USERDATA);
 
1901
        vncDesktop *_this = (vncDesktop*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
1877
1902
 
1878
1903
        switch (iMsg)
1879
1904
        {
3084
3109
                "%04u.%02u.%02u-%02u-%02u-%02u-0x%08x.bmp",
3085
3110
                stm.wYear, stm.wMonth, stm.wDay,
3086
3111
                stm.wHour, stm.wMinute, stm.wSecond,
3087
 
                (uint) ptr);
 
3112
                (uint)(intptr_t) ptr);
3088
3113
 
3089
3114
        HANDLE hFile = CreateFile(
3090
3115
                szFileName,