Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Fistandantilus

Help from Win32 Gurus

This topic is 5883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello jedi Masters of the Win32 API, I need your help in something . It is my mission to create a program that when you click in its executable , a small creature starts running throught the screen. Similar to the Word Inteligent Agent. The problem is , I have no idea of how to draw the creature without the window in the back. Anyone has any idea of how can this be done? If anyone can point me to a particular tutorial ,or example program ,I would be most thankfull.

Share this post


Link to post
Share on other sites
Advertisement
I''m fairly sure you could use DirectDraw to do something like this, but it might be overkill.


I''d imagine you''d use some kind of transparent brush for the background in the class style for the window.

And create it with really basic window styles.

Share this post


Link to post
Share on other sites
If you''re targetting Windows 2000 or newer, you can have a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/layerwin.asp. This is how MS Agent gets their characters "out of the box" in win2k and XP. Otherwise, look at http://www.flipcode.com/articles/article_win32skins.shtml for information on Window regions (yes, the article is about skinning an application, but you should be able to take the given information on window regions and apply it to what you''re doing).

Share this post


Link to post
Share on other sites
In a Visual C++ book I checked out from the library about a year ago, there was a way to draw directly to the desktop, by getting the DC of the desktop and writing to it. I don''t remember exactly how it said to get the desktop DC, but if I find it again, I''ll be sure to post it.

-AJ

C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

-Comic Book Store Guy''s t-shirt that I saw on the Simpsons, although it didn''t actually come from the Simpsons.

http://vdsoft.netfirms.com/home.html

Share this post


Link to post
Share on other sites
Fuund it. You can do it one of two ways. This is from "Win32 Programming", not the Peltzold version:

The first way is to do this:

Create a device context with this call:

HDC hdc = CreateDC(_T("Display"), NULL, NULL, NULL);

and just use that as what you write to.

The other way is to do this:

HWND hwnd = GetDesktopWindow();
HDC hdc = GetDC(hwnd);

Then you can draw what you need to to the screen.

The latter method is the one more traditionally used, according to the book. Hope that helps ya out.

-AJ

C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

-Comic Book Store Guy''s t-shirt that I saw on the Simpsons, although it didn''t actually come from the Simpsons.

http://vdsoft.netfirms.com/home.html

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!