Thread: Hdc

  1. #1
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584

    Hdc

    I'm not sure if I'm understanding this handle type (device context handle). The description left me a little blank. Here is what I got out of it:

    The HDC handles GDI responses such returned from BeginPaint.

    Then, I got lost there. Is that all the handle does. Is that even what it does? Thanks.

    --Garfield
    1978 Silver Anniversary Corvette

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    HDC is a handle to the device context.
    but what does that even mean?

    ok, In Windows(or any modern OS) you do not need to know what hardware your computer has in order to use it.
    windows handles that for you, so what you have instead is a "Handle" to the supposed device to which you send your command,
    which in turn windows translates and sends properly to your hardware in a form it understands,
    this prevents hardware specific code so that a windows program will run on any windows machine.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Thanks for the description no-one! Just what I needed.

    --Garfield
    1978 Silver Anniversary Corvette

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    A device context is kind of like a "canvas" that you can draw on. With many DCs, like window DCs, client DCs, paint DCs, etc. when you draw on this "canvas", the screen is changed. So as I am typing this message, the edit box is using its paint DC to draw text, which I see appear on my screen.

    DCs have other uses (printing, and back-buffered images) but the primary use is they are ultimately how all screen drawing happens.

  5. #5
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    > DCs have other uses (printing, and back-buffered images) but the primary use is they are ultimately how all screen drawing happens.

    Thanks for the explanation! Just what I needed.

    --Garfield the Great
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My progress.. thnx to Cprogramming forumites
    By csonx_p in forum Windows Programming
    Replies: 6
    Last Post: 05-21-2008, 01:17 AM
  2. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  3. My first "real" windows app
    By JoshR in forum Windows Programming
    Replies: 2
    Last Post: 07-28-2005, 07:40 AM
  4. destroywindow() problem
    By algi in forum Windows Programming
    Replies: 6
    Last Post: 03-27-2005, 11:40 PM
  5. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 07:48 PM