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 / Howto: black window on start

Author
Message
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 31st May 2014 08:50
Hi, I recall solving this a long time ago but I don't remember how

When I run my GDK program, the first thing to appear is a black window. Then it takes the correct size and position but I want to get rid of the damn black window. Any ideas?

May the 3d force B with U
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 31st May 2014 16:24
Check out the post, just above your first post on this thread.
The Tall Man
10
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 31st May 2014 18:44
DarkSDK.cpp is where that code is that creates the initial window.

Judging what we see is the greatest blinder and self-limiter in the universe.

What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 1st Jun 2014 20:05
Thank you! will check it today.

May the 3d force B with U
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 2nd Jun 2014 00:09 Edited at: 2nd Jun 2014 00:16
OK, that solution works only partially, at least for me.

If you modify the initial screen position of the window with dbSetWindowPosition, it starts in the middle, with the black screen, and some milliseconds after, it goes to your desired initial position.

My solution was to open the core.lib source, and in DBDLLCore.cpp, changed the initial startup position to be outside of the visible screen. In the app, then I have to position the window wherever I need it. So its first visible position is the X,Y coordinates I code instead of the center.

In the indicated cpp source, go to about line 1680, comment the original coordinates and place the new ones.
Then, compile core.lib and place it on your development lib folder.

It works as charm now. It is a solution for window mode, not tested in other modes.

Warning> In the app startup you MUST add a dbSetWindowPosition with coordinates, or the window will always be offscreen.



May the 3d force B with U
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 5th Jun 2014 07:24 Edited at: 5th Jun 2014 09:45
Sorry, guess I didn’t get the full question. However, this can be achieved without modifying the source. If you look about 132 lines above where you edit the source, you will see by setting the width and height at 1 and 2, will set the “bOverrideWindowCenteringToSupportActiveXFraming” flag. Effectively producing the same result, building a 640x480 off-screen window. You can then size the window using “dbSetDisplayMode” and then position the window. See attached download for proof of concept.

Attachments

Login to view attachments
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 9th Jun 2014 23:14
Thanks WickedX

May the 3d force B with U

Login to post a reply

Server time is: 2024-04-19 17:21:34
Your offset time is: 2024-04-19 17:21:34