Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Cool Window Effect - Some people may need this!

Author
Message
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 14th Apr 2008 02:30
Hullo all.
I decided to quickly create a cool window effect for the community. Basically what this does is allow you to alter the window and give it a custom caption - as well as be able to control your window like a widget.
People may find this useful for the following reasons:
* It shows how to use flags
* It shows a "better" way to organize code which utilizes DLLs so that others may use it.
* It shows a cool way to trick windows
* You can port this code directly into your own project with minimal work
* You can use a custom caption / custom minimize, maximize, restore, and close buttons
* You can use a custom window border
* You can even provide the ability to be able to drag the window by clicking anywhere on it

This code is, for the most part complete. What's missing that I probably won't add in is the ability to resize the window by clicking on any border. The only way to resize the window is with the statusbar. Also I didn't make this code use the GDI for 2 reasons, 1: Too much work, 2: DBP isn't natively suited well for the GDI commands I was planning (Plus would probably run into a few bugs).

This code was made quickly, it only took about an hour to make, debug, and test. All the bugs I ran into were mainly visual ones. The code can easily be extended to meat your needs specifically.

ALSO, this code fixes a DBP "problem" where when you drag your window (with a normal caption) you no longer see your sprites or basic 2d renderings. This fixes that. (I assume because when you drag the DBP window, sync is being called rather than presenting the frame again. While there may be a possibility of the entire back-buffer being replaced with garbage when presenting the frame again, this could be avoided by taking a quick "snapshot" of the window and rendering that while moving/resizing the window as to keep the same effect but without the mentioned problem. This is too much work to do in general, but if one wishes to do that, that is how it should be done.)



Cheers,

-naota

My email actually IS "nocannedmeat@gmail.com". Why? I don't know.
Aex.Uni forums
da power pwnerer
18
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 15th Apr 2008 02:39
Nice, thanks

BTW, you forgot the DBP/DBC label. The mods are pretty strict about that.



-Dan


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 15th Apr 2008 08:43
Nice one, menu drop next!

Dark Physics makes any hot drink go cold.
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 16th Apr 2008 03:08
Oh! I forgot about all that.

Tested to work in DBP - should work in DBC with DLL loading.

Thanks for the comments - helps me stay motivated.

Cheers,

-naota

My email actually IS "nocannedmeat@gmail.com". Why? I don't know.
Aex.Uni forums
Coder#05
19
Years of Service
User Offline
Joined: 26th Oct 2005
Location: Denmark
Posted: 16th Apr 2008 17:47
Nice work

Will use probably use this for something.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 16th Apr 2008 23:13
Thanks, hopefully it's beneficial to ya.

My email actually IS "nocannedmeat@gmail.com". Why? I don't know.
Aex.Uni forums
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 20th Apr 2008 02:34
Hmm do you know how i can change the cube to lets say a model of my choice for instance tank1.x because i tried simply putting in load object "media\tank1.x" but it always errors, do you know the proper way to do this?

A Violent Pigeon is a good Pigeon.
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Apr 2008 02:59
That sounds correct. Do you have some source code to show? Make sure it's in the proper directory (etc).

What's the exact error you get?

My email actually IS "nocannedmeat@gmail.com". Why? I don't know.
Aex.Uni forums
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 21st Apr 2008 08:07
The window doesn't draw correctly when offset beyond the left side of the screen.

http://3dfolio.com
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 22nd Apr 2008 03:44
That doesn't make sense since it's DBPro's drawing functions.

I'll have a look.

My email actually IS "nocannedmeat@gmail.com". Why? I don't know.
Aex.Uni forums

Login to post a reply

Server time is: 2024-11-25 02:48:31
Your offset time is: 2024-11-25 02:48:31