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 / Customizing DarkGDK Window Style

Author
Message
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 26th Jul 2009 20:15 Edited at: 26th Jul 2009 20:18
Hello there,

Is it possible to set the window style for my gdk window? You know, WS_MODAL, WS_DLGFRAME, etc. in WINAPI.

I've read this post by IanM: http://forum.thegamecreators.com/?m=forum_view&t=144462&b=22

But I can't get this code to work:

The window style doesn't seem to change at all.

Help me?
Also please if anybody knows the correct style to show ONLY the close button on the control box (upper-right screen), mean no minimize and maximize button, and make the window unresizable?


Any kind of help would be appreciated

Thanks.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 27th Jul 2009 01:46
dbSetWindowLayout is a command from inside GDK that will set some of your window styles... Im not 100% sure which ones it will set or what flags do what... I generally use the Windows API when I want to effect a window...

You can get a handle to the Main program window with : g_pGlob->hWnd after including "globstuct.h" in your program. Although you cannot create your own window and put GDK into it easily, it can be done.

If it ain't broke.... DONT FIX IT !!!
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 27th Jul 2009 06:01 Edited at: 27th Jul 2009 06:02
I believe you could use SetWindowLong to change the layout



I don't know the exact parameters you need to only show the close button, but that should be how you do it
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 29th Jul 2009 15:57
Sorry for the late reply.

But It doesn't work
No errors/warnings
Just the window doesn't seem to change at all.

My code for now:


Any idea?
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 29th Jul 2009 16:31
WS_MAXIMIZE is to tell the window that you want it to maximize when its created.

WS_MAXIMIZEBOX is the style that will tell it to display a maximize box, keep in mind though, that you method is retrieving the styles that the window already has, and is then adding to them, the ones that you are passing(telling it to maximize itself)

Here is a list of Window Styles(not EX styles) :



If it ain't broke.... DONT FIX IT !!!
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 29th Jul 2009 17:08
I also tried:

to prove that it really does not work.

In fact, I still can interact with the window.
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 29th Jul 2009 17:11
I don't usually do this kind of window modification, however this should set it up the way you wanted.



This code simply subtracts the WS_MAXIMIZEBOX and WS_MINIMIZE box parameters from the style and then updates the window.
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 29th Jul 2009 17:28
Wow! It works now
Thanks a lot, Ian G.

But, there's one thing..
I also need to call dbSetDisplayMode (and dbSetWindowPosition, if this function messes it too?), but it causes the maximize and minimize box to appear again..

What I gonna do?
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 29th Jul 2009 17:35
Try putting your SetLong call after your dbSetDisplayMode call ?

You could always just check and replace the styles everytime you need to manipulate the display in a way that causes them tobe reset by GDK I guess.

If it ain't broke.... DONT FIX IT !!!
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 29th Jul 2009 17:40 Edited at: 29th Jul 2009 17:44
of course

Thanks for telling me that..now it works..

But there's one last thing

How to make the window unresizable?

EDIT: Nevermind.. I solved it..
simply subtract WS_THICKBOX in the 3rd param of SetWindowLong..

Alright then, Thanks for helping!

Login to post a reply

Server time is: 2024-10-01 08:36:03
Your offset time is: 2024-10-01 08:36:03