?
Solved

HWND for the desktop?

Posted on 2003-03-15
5
Medium Priority
?
963 Views
Last Modified: 2013-11-20
Anyone know a way to retreive the desktops hwnd? I want to be able to draw a calendar in the bottom right corner. So I guess I really need a cdc for it, but I can just get that thru the hwnd.

I've been looking everywhere and I cant find any info on it. I found a program (Z-Matrix) which edits the desktop so I know its possible..

Any help would be MUCH appreciated.
0
Comment
Question by:DigitalQ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Accepted Solution

by:
MrNoName earned 75 total points
ID: 8144496
Hi DigitalQ,

You can obtain a device context to the desktop like this:

CWindowDC dc (0);
0
 

Author Comment

by:DigitalQ
ID: 8144510
Thx, I honestly dont know why I didnt think of that.. I'm sure I've used CWindowsDC before..

I appreciate a quick response
0
 
LVL 1

Expert Comment

by:vadik
ID: 8144622
HWND GetDesktopWindow();

0
 

Author Comment

by:DigitalQ
ID: 8144695
Yes but it seems like any dc I try to make from that doesnt allow me to do anything. Maybe the background picture is always painted last? Anyway around that?
0
 

Expert Comment

by:FrenchFries
ID: 8152417
>>Maybe the background picture is always painted last
Try with LockWindowUpdate().
Inside Charles Petzold book ( Window programming ) there 's a scramble example using desktop dc
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month8 days, 16 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question