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 / Override HWND issues

Author
Message
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 1st Dec 2009 21:47 Edited at: 2nd Dec 2009 04:44
So, I have been working on getting GDK into a child window of a program using dbOverrideHWND(), and have gotten that to work. The issue now is that the window GDK use to own is still being affected by some GDK commands, like dbSetDisplayMode() is still resizing the parent window, when I don't want it to. Also, when gdk is moved into the child window, I am left with a parent window with no content/background, and it just shows what is behind it instead(see attached pic). Is there a way to make GDK relinquish control over the parent window so that I can add more content to it, because right now it is not letting any other child windows appear inside the parent.

EDIT: Also wondering how to make it so that GDK only reads mouse position/click when it is inside the GDK viewport. Right now, when I click a button in another window(another child of the main window) it registers in the GDK window, and when I print the position, it reads as if it is running from the main window but reads correctly inside the viewport. I am guessing I have to mess with the DirectX controls(or whatever they are called), but am unsure what to actually do.

-H

Attachments

Login to view attachments
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 2nd Dec 2009 05:06
for the see through window, you neeed to use SetClassLong and set the background color. it was set to zero because they never expected anyone to see it. use COLOR_WINDOW+1(it has to be +1) for a white background.

I'm not sure about the input. I know that DirectX is linked to a Window handle and it might have something to do with relatives of that window.

New Site! Check it out \/
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 2nd Dec 2009 07:20
Thanks Caleb, that fixed the transparent window issue.

As for the input, I have figured out a basic work-around using this simple code:


one final thing I want to try to "fix" is the initial background. It starts off with the first black screen render from creating the window, but I want to clear that. The only way I have found to fix it so far is to just resize the window to almost nil, and then bring it back, or to minimize and then maximize it. Both of those would look unprofessional(in my book) with a full application.
So, now I just have to figure out how to make it erase the first render without messing with the window size(I have tried RedrawWindow() to no avail).

As a seperate(but somewhat on topic) note, I am thinking of throwing together either 1)a tutorial on how to add windows/embed GDK or 2)a library that adds windows/buttons/menus/embed's GDK/etc. But, I would like to know if people would be interested in either before spending a lot of time on it. I have seen a few boards/tuts for this kind of stuff, but they didn't really tell the whole process or required you to have a resource editor(pro version of VC++ now) to do.

-H

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 3rd Dec 2009 20:19
instead of resizing window, try using 2 dbSync() commands at the very start to see if the black screen goes away.

i would be interested in your tutorial or library functions!
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 3rd Dec 2009 21:11
Well, I just tried dbSync(), dbCLS(), setting the display mode, and some other commands. I can change the color of the "black screen of death"(I am now lovingly dubbing it) with dbCLS(DWORD RGBBackColor), but I am unsure as how exactly to remove the color entirely(like clear to transparent or something). I am gonna mess with the CLS command and some other db commands to see if I can't get it cleared to transparent. That, or I'll just make it clear to the color that the window's background is.

After I get this figured out, I'll definitely write up a tutorial then.

-H

Login to post a reply

Server time is: 2024-10-01 18:36:15
Your offset time is: 2024-10-01 18:36:15