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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to put the desktop into a device-context ?

How to put the desktop into a device-context ?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 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.
  • A Offline
    A Offline
    adara
    wrote on last edited by
    #1

    How to put the desktop into a device-context ??:rose::rose:

    T M 2 Replies Last reply
    0
    • A adara

      How to put the desktop into a device-context ??:rose::rose:

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Try PaintDestkop function. However, it will not work with memory DCs on 2K/XP. Tomasz Sowinski -- http://www.shooltz.com

      - It's for protection
      - Protection from what? Zee Germans?

      A 1 Reply Last reply
      0
      • T Tomasz Sowinski

        Try PaintDestkop function. However, it will not work with memory DCs on 2K/XP. Tomasz Sowinski -- http://www.shooltz.com

        - It's for protection
        - Protection from what? Zee Germans?

        A Offline
        A Offline
        adara
        wrote on last edited by
        #3

        Well , i need it to w2k and above .. why it will not work ? any other ideas? thanx

        T 1 Reply Last reply
        0
        • A adara

          Well , i need it to w2k and above .. why it will not work ? any other ideas? thanx

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          adara wrote: why it will not work ? I have no idea. It works on 2K/XP when you pass client (not memory) DC to PaintDesktop. Maybe they've decided that this will be some security hole :) You may try GetDesktopWindow and WM_PRINT instead. Tomasz Sowinski -- http://www.shooltz.com

          - It's for protection
          - Protection from what? Zee Germans?

          1 Reply Last reply
          0
          • A adara

            How to put the desktop into a device-context ??:rose::rose:

            M Offline
            M Offline
            Mike Nordell
            wrote on last edited by
            #5

            Straight from the SDK sample Switcher:

            if (hdc = CreateDC (TEXT("DISPLAY"), NULL, NULL, NULL))
            {
            // Copy the desktop to a memory DC
            int xSize = GetSystemMetrics(SM_CXSCREEN);
            int ySize = GetSystemMetrics(SM_CYSCREEN);
            StretchBlt(memDC, 0, 0, destW, destH,
            hdc, 0, 0, xSize, ySize, SRCCOPY);
            DeleteDC(hdc);
            }

            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