Solved

desktop sprite

Posted on 1998-06-12
3
330 Views
Last Modified: 2008-02-01
how would one move a graphical object (drawing/ sprite)  across the desktop?

it's not just a transparent createwindow() is it?
if some-one can tell me how/ where to draw it... I'll figure out how to move it...
I'm currently using Visual C++ v.5...or MASM.... thanks tons...

jack
0
Comment
Question by:hjack
  • 2
3 Comments
 
LVL 6

Expert Comment

by:WxW
ID: 1165717
You can get the desktop handle by using GetDesktopWindow() .
I am not sure , but I believe you can get a DC of the desktop ( GetDC(GetDesktopWindow()) ) , and you are able to draw using the HDC functions .
Feel free to ask me if you want something about the HDC functions , but I do not know how to move a drawn object - you have to find the algorithms yourself
0
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 1165718
answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165719
You can draw in the desktop just as WxW suggested.  but that is likely to have problems.  You may draw on top of icons and then you have to get the icons repainted that sort of thing.  It might be necessarry to go with that approach, but I would try something different first.

I would try to create a window that you can draw in and move that window.  Now this approach might be too slow.  But if not, it is probably the best solution.  (It is less likely to lead to nasty problems now or in the future,.)  

What you should do is create a borderless window and use SetWindowRgn to set the window to the shape of th sprite.  Then you just draw the sprite inside the window durring the WM_PAINT event.  You move the sprite using MoveWindow() or SetWindowPos().

That's just a sketch to the approach I would take.  If you have questions, ask.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now