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. i want make an mfc applicatio for screen capturing

i want make an mfc applicatio for screen capturing

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
2 Posts 2 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.
  • D Offline
    D Offline
    Dhiraj kumar Saini
    wrote on last edited by
    #1

    Hello, I want to make a very small application capable of screen capturing. Plaese help me with some example. Thanks & Regards. Dhiraj

    C 1 Reply Last reply
    0
    • D Dhiraj kumar Saini

      Hello, I want to make a very small application capable of screen capturing. Plaese help me with some example. Thanks & Regards. Dhiraj

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      You could try something like this, don't know if this actually works or not, didn't try it, but it can be a starting point for you, good luck:

      CDC ScreenDC;
      ScreenDC.Attach(::GetDC(NULL));

      CBitmap Capture;
      CSize Dimensions(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
      Capture.CreateCompatibleBitmap(&ScreenDC, Dimensions.cx, Dimensions.cy);

      CDC MemDC;
      MemDC.CreateCompatibleDC(&ScreenDC);

      CBitmap *OldBitmap = MemDC.SelectObject(&Capture);

      MemDC.BitBlt(0, 0, Dimensions.cx, Dimensions.cy, &ScreenDC, 0, 0, SRCCOPY);

      MemDC.SelectObject(OldBitmap);
      MemDC.DeleteDC();

      ::ReleaseDC(NULL, ScreenDC.Detach());
      //At this point the bitmap 'Capture' should contain an image of the desktop

      > The problem with computers is that they do what you tell them to do and not what you want them to do. <

      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