GetDC(NULL) fails on Vista
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: GetDC(NULL) fails on Vista

  1. #1
    Join Date
    Dec 2003
    Location
    Spain
    Posts
    52

    GetDC(NULL) fails on Vista

    GetDC(NULL) seems is not Vista compatible anymore, in order to retrieve desktop screen.
    What could i use instead ? Thanks

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,611

    Re: GetDC(NULL) fails on Vista

    Define "not Vista compatible". Do you get some errors / error messages? Which ones? Where and how?
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2003
    Location
    Spain
    Posts
    52

    Re: GetDC(NULL) fails on Vista

    I have a form to magnify screen while the user moves the cursor. This code works well on xp but it flickers non-stop on vista. It seems that getdc(null) behaves in a different way on this OS and leads to flicker. Please look at
    http://bit.ly/fBf9nh

  4. #4
    Join Date
    Dec 2003
    Location
    Spain
    Posts
    52

    Re: GetDC(NULL) fails on Vista

    Quote Originally Posted by chals1 View Post
    I have a form to magnify screen while the user moves the cursor. This code works well on xp but it flickers non-stop on vista. It seems that getdc(null) behaves in a different way on this OS and leads to flicker. Please look at
    http://bit.ly/fBf9nh
    I don't have a solution yet so let's try to elaborate more.
    I have a form to magnify desktop on real time, with WS_EX_LAYERED extended style. Then I call SetLayeredWindowAttributes to set the opacity to full opacity. Well this worked right in xp but in vista it remains grey. Could this be due to getdc(null) ? I've read that this way of retrieving dc screen is problematic in vista and w7.

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,611

    Re: GetDC(NULL) fails on Vista

    Victor Nijegorodov

  6. #6
    Join Date
    Dec 2003
    Location
    Spain
    Posts
    52

    Re: GetDC(NULL) fails on Vista

    Quote Originally Posted by VictorN View Post
    Thanks!! So i'll try to place a translucent form on top of the screen, with alphaBlend equal to one.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center