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.

Dark GDK / Fixing Window Sizes (Stoping window resize)

Author
Message
waka324
16
Years of Service
User Offline
Joined: 31st Mar 2008
Location:
Posted: 17th May 2008 11:22
First off, I would like to thank everyone who has helped me on this forum.



On to the question.

As the title says, I would like to fix the window so that it cannot be resized by the player, as it would skew all my nice sprites into obcurity, and most likely frustrate the player. I read everything in the DarkGDK library help file, and could not find any mention of such a function. I would rather not mess arround with windows functions, but I am guessing someone here will tell me I must.

Again, thanks for all the help.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 17th May 2008 17:32
I'd hate to work through the Windows API too, especially in an environment that hides the implementation. The only thing I can think of is to use the dbScreenWidth() and dbScreenHeight() functions to determine if the screen size has been changed. Grab the screen size at startup and check every few cycles to see if the any of it has changed. If so, use dbSetWindowSize() to reset it.

I'm, of course, assuming that screen size is different from display size.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th May 2008 19:33
There are a lot of DBPro Examples that use the WinAPI user dll or something... your DarkGDK implementation shouldn't be to hard to figure out with little bit of goggle fodder... You might not need to include the dll itself, and the windows.h might handle it for you but....

...Hang on... here's a db pro snippet:


jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 17th May 2008 21:06 Edited at: 17th May 2008 21:08
You need to eliminate the maximize button, modify the system menu and hook the window procedure to trap sizing messages.

Ordinarily, you eliminate the maximize button in the code that registers the window class, which is not currently visible to you. The second part is only slighly more straightforward, but it requires that you understand callbacks, and are fairly proficient in C programming and know a bit about Windows in the first place.

The code I am proposing would allow you to do much more than just control the size of the window. It would also allow you to trap keystrokes, too, and it is also a fine way to implement sockets without depending on a third party.

If you are game, I will help you sort it out.
waka324
16
Years of Service
User Offline
Joined: 31st Mar 2008
Location:
Posted: 18th May 2008 06:42
Ok. It looks like it was MUCH simpler than I had originally thought. For those who would like to know, the DB library command,

dbSetWindowLayout(0, 1, 1);

removes the minimize, max, and escape buttons on the window, and prevents the user from changing window size.

I seem to like this DB library more and more each day. I am just happy I don't have to mess with API commands.

Thanks Again to all who responded.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th May 2008 19:19
The nice thing is if you need to go into the API - its easier in DarkGDK! LOL

Login to post a reply

Server time is: 2024-09-29 21:33:21
Your offset time is: 2024-09-29 21:33:21