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 / [DBC] Add a Win32 API Status Window

Author
Message
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Dec 2008 23:41
Here's some code for adding an MS Window's status window to a Full Screen DBC app. The status window in this example has 5 boxes. Each box has different text and one of the boxes is regularly updated with the time.

I put a 3d cube and the screen fps just to prove 3d and 2d still work and to test the FPS. I get about 432 fps:



Enjoy your day.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Dec 2008 11:22
Latch what does the output look like, been trying to make it run in DBPro, had to change | to || to make it run.

Dark Physics makes any hot drink go cold.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Dec 2008 07:00
@HowDo

It's a blue screen with a cube in the middle of it. On the bottom is a status window divided into 5 sections. The status window is the focus of the snippet. Attached is a screenie:

Enjoy your day.

Attachments

Login to view attachments
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 15th Dec 2008 19:55
cheers, now I wonder where its being shown as onthing like your image is showing.
Just hoping I would have be able to make work, so don't wait for me.

if anyone else thinks they know what to do, please do show.

Dark Physics makes any hot drink go cold.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Dec 2008 21:02 Edited at: 15th Dec 2008 21:12
@HowDo

Hmmmm... The original problem I had with adding any windows to DBC (not sure if it applies to DBPro) is the render area of DB can cover up the window. That is why I have one of the flags set to WS_POPUP.

Try setting the mode to windowed mode but keep the rendering area smaller than the window size. Using windowed mode, you can remove WS_POPUP. I don't know if DBPro behaves the same way as DBC in this regard but try this code (change the | to ||):



Also with this set of commands:



the value being written to the memblock is the the right border position of the boxes after box 1 : 2=400 3=500 4=600
But for box 5, I want the border to be to the end of the window so I have to write the value of -1 to memblock position 16. However, DBC only writes unsigned longs as DWORDs do I have to write 4 bytes to positions 16,17,18, and 19 that equal -1. Maybe it will make a difference if you just write a DWORD of -1 to position 16 and not the 4 bytes.

Enjoy your day.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 16th Dec 2008 19:58
The above new code works just fine, all it needs it the borders and stuff and you would'nt know it was DBC or DBPro.

Ps will need to add and extra | .

Dark Physics makes any hot drink go cold.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 3rd Jan 2009 04:21
ok the windowed mode works but full mode doesn't and i use dbc any idea why?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th Jan 2009 01:16
Only thing I can think of is you are using the windowed version I posted a couple of posts up and not the version at the top of the thread. For full screen, there is a line that should read:



That WS_POPUP needs to be in there for full screen.

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jan 2009 23:07
This is cool!!!

...

All I see is a spinning cube... am I doing something wrong? Could you post a screenshot of what it should look like?

TheComet

Peachy, and the Chaos of the Gems

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Jan 2009 08:41
Quote: "Could you post a screenshot of what it should look like?"


Read the 3rd post from the top.

Also, make sure you are running the code from the first post for full screen mode in DBC.

Enjoy your day.

Login to post a reply

Server time is: 2024-11-22 07:58:54
Your offset time is: 2024-11-22 07:58:54