Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. PrintWindow

PrintWindow

Scheduled Pinned Locked Moved C / C++ / MFC
c++
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Soumyadipta
    wrote on last edited by
    #1

    I want to capture client area of a window. I am using vc++ and vs2005.

    C E 2 Replies Last reply
    0
    • S Soumyadipta

      I want to capture client area of a window. I am using vc++ and vs2005.

      C Offline
      C Offline
      Cranky
      wrote on last edited by
      #2

      Be prepared for long stakeout. The client areas only come out at certain hours during the night and tend to be sensitive to noise and light. It takes a lot of skill to capture them.

      S 1 Reply Last reply
      0
      • C Cranky

        Be prepared for long stakeout. The client areas only come out at certain hours during the night and tend to be sensitive to noise and light. It takes a lot of skill to capture them.

        S Offline
        S Offline
        Soumyadipta
        wrote on last edited by
        #3

        Nice joke, I am able to capture a window and also able to solve this image into a file but the problem is i can't print only the client area. I have also use the flag PW_CLIENTAREA. Please help to solve this

        1 Reply Last reply
        0
        • S Soumyadipta

          I want to capture client area of a window. I am using vc++ and vs2005.

          E Offline
          E Offline
          Ernest Laurentin
          wrote on last edited by
          #4

          I assume you wanted to do this in MFC...

          bool CaptureWindow(CWnd* pWnd, CBitmap* pBitmap)
          {
          CRect rc;
          pWnd->GetClientRect( rc );
          CClientDC dc(pWnd);
          if ( pBitmap->CreateCompatibleBitmap(&dc, rc.Width(), rc.Height()))
          {
          CDC memdc;
          memdc.CreateCompatibleDC( &dc );
          CBitmap* pOldBitmap = (CBitmap*) memdc.SelectObject( pBitmap );
          memdc.BitBlt(0, 0, rc.Width(), rc.Height(), &dc, 0, 0, SRCCOPY);
          memdc.SelectObject( pOldBitmap );
          memdc.DeleteDC();
          return true;
          }
          return false;
          }

          God bless, Ernest Laurentin

          S 1 Reply Last reply
          0
          • E Ernest Laurentin

            I assume you wanted to do this in MFC...

            bool CaptureWindow(CWnd* pWnd, CBitmap* pBitmap)
            {
            CRect rc;
            pWnd->GetClientRect( rc );
            CClientDC dc(pWnd);
            if ( pBitmap->CreateCompatibleBitmap(&dc, rc.Width(), rc.Height()))
            {
            CDC memdc;
            memdc.CreateCompatibleDC( &dc );
            CBitmap* pOldBitmap = (CBitmap*) memdc.SelectObject( pBitmap );
            memdc.BitBlt(0, 0, rc.Width(), rc.Height(), &dc, 0, 0, SRCCOPY);
            memdc.SelectObject( pOldBitmap );
            memdc.DeleteDC();
            return true;
            }
            return false;
            }

            God bless, Ernest Laurentin

            S Offline
            S Offline
            Soumyadipta
            wrote on last edited by
            #5

            is it possible to do this using printwindow?

            S E 2 Replies Last reply
            0
            • S Soumyadipta

              is it possible to do this using printwindow?

              S Offline
              S Offline
              Soumyadipta
              wrote on last edited by
              #6

              I want to capture client area of a transparent layered window

              1 Reply Last reply
              0
              • S Soumyadipta

                is it possible to do this using printwindow?

                E Offline
                E Offline
                Ernest Laurentin
                wrote on last edited by
                #7

                I've never used that API (PrintWindow) (or WM_PRINTCLIENT message) but I would believe that should do the trick. Not sure about the layered window though.

                God bless, Ernest Laurentin

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups