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 / get hWnd?

Author
Message
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 2nd Jan 2009 22:24
I need to get GDK's hWNd. I found this in headers:
void dbOverrideHWND ( HWND hWnd );
but I've no idea what to do with it. Is it possible to use winmain and set up GDK manually?
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 2nd Jan 2009 23:58
If you want to get the window handle, include windows.h and globstruct.h. The handle is then available as g_pGlob->hWnd.



However, I don't think that function does what you want it to do.


My site, for various stuff that I make.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 00:20
hmm... interesting - can you use that to make the DirectX device render to another window?

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 3rd Jan 2009 18:36
That's what I was assuming it did. Think of the possibilities with that! Let's say you're writing a level editor, using window's forms. You could embed the GDK in a control and use the window's API for everything else! A pretty powerful option, I would say. I'll tinker with this a bit...


My site, for various stuff that I make.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 19:00
Please report back - I want to know - I'd check myself but I'm (LOL) Actually working on my DarkGDK OOP Lib's GUI... turning the Button control into a hybrid button+image box+picture button combo and then on to a list box

--Jason

jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 3rd Jan 2009 19:16
If you could do that, how would you position the DarkGDK bit within the new window?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Jan 2009 21:04 Edited at: 3rd Jan 2009 21:11
Get the handle of a panel.

System::Windows::Forms:anel::Handle
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 5th Jan 2009 22:15 Edited at: 5th Jan 2009 22:24
After a bit of testing, I've found that it reports any window other than the GDK window to be invalid. Kind of squashes that dream of integration. A quick bit of browsing revealed this:

From what I can tell, this creates the window. If this function were called at the start of the program by the programmer instead of the engine, there would be a great deal more flexibility.


My site, for various stuff that I make.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 5th Jan 2009 22:23
I dunno - ApexNow got it to work - and I saw some post a ways back - not sure if it was abut .Net or C++ version - but some guy who wasn't using DarkGDK for games - got it to display stuff in a Windows Form as a "panel" ... I think he said something about it being setup as a picturebox or something.

Perhaps he was rendering "offscreeen" some render target, and making image from it and pasting it or something... I'm sure its possible one way or another though.

--Jason

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 5th Jan 2009 22:26 Edited at: 6th Jan 2009 03:22
Perhaps he did, I'll have to see how. I was trying to transplant the GDK into another window, just as a proof of concept, not necessarily a form element just yet.

EDIT: I've investigated dbInitDisplay() a bit. Used in the following manner, I had some interesting results, all followed by a crash.


For this experiment dwDisplayType is the variable.

Values and results:
0 - No change
1 - Resizes as expected
2 - A message, "Display mode not supported."
3 - Program is apparently trying to run full screen. Nothing draws except the normal window, but when the window has focus all control is lost. No crash, just a halt.
4 - Window maximizes
5 and on - No change

Take what you will from this test. Perhaps it would be possible, in the future, to set up the GDK on our own, which would allow you to fully customize display options.


My site, for various stuff that I make.

Login to post a reply

Server time is: 2024-09-30 15:20:03
Your offset time is: 2024-09-30 15:20:03