Making the Blitz window a child?

Blitz3D Forums/Blitz3D Programming/Making the Blitz window a child?

Picklesworth(Posted 2005) [#1]
Now that I sort of have an idea of how all this crazy Win32 stuff works, would it be possible to make the Blitz3d runtime window a child entity of another window? Perhaps of a window used by a Java applet? Could this be done via Blitz?



(I'm frantically seeking a way to do something, because I accidentally... uhm... sent an email that I wasn't meant to send until I actually am sure that all this stuff is sorted out. Which it is not.)


jfk EO-11110(Posted 2005) [#2]
Have a look at WinBlitz3D, it's shows how to do it. It's using an api call named SetParent (surprise :) ) Although it creates a new Window and then parents the Blitz Window to it, it may be exactly the same with a parent window that already exists. Of course you need to know the class name of that Window. I found it pretty hard to find the name of several App Classes, eg. the MSIE. "Greatis Windowse" is a great Tool for reading out such things.


Picklesworth(Posted 2005) [#3]
Oh man.
I just figured out my own method, only to hear of one that's twice as easy from you :D

Anyways, sorry for any artifacts from my previous version of this reply: I changed my mind and used api_setparent() about halfway through writing this and just changed a few words to make it seem proper :D This message is also ridiculously out of order and redundant because it was written over about an hour.
The SetParent method is definietly better than my method, but I'm still happy that I figured out the win32 stuff to the extent that I could do that.

The advantage to this is that I can create a child window of another window, hopefully regardless of what it is made with, with only a tiny bit of work in that language.
Some problems still, including the SelfEmbedder process not ending, causing a fairly big slowdown, and I don't actually know if it completely works. The reason why I'm not ending the embedder process via the main program, which I could do easily, is because I want to have as little work in the non-blitz end as possible.
So far, in theory, it's all good other than that :D I have a spinning cube inside of a disabled window with a title bar (which I want) and it's practically all being done via the embedded program - the program doing the calling just gets its window handle and execfiles the embedder with its own handle as the commandline.
Next comes the big crash: Running through a C program :D

Does anyone know where I can find some kind of documentation for the Win32 stuff? I would really like to know what some of those constants do.



Finally I see why an OS beyond DOS is a good thing!!


Trixx(Posted 2005) [#4]
Does anyone know where I can find some kind of documentation for the Win32 stuff? I would really like to know what some of those constants do

Take a look at, and download API-Guide at http://www.allapi.net . That may help...


Picklesworth(Posted 2005) [#5]
Wow :)))

Now to force somebody to write me a 2 line (2 lines of any kind of thinking, anyhow) Java Applet or other kind of browser applet. Sadly, it seems that even the simplest things can require hours of my time with this apparent necessity to get a phony signature on my applet which would do nothing other than grab its window handle and execute my program with that in the command line, according to some value stored somewhere.
I may be able to bypass this with some crazy thing in the User32 dll and php or javascript or such, which do not make simple tasks seem impossible. I hope.

Oh, and BTW, I fixed the problem with the embedded window not removing itself :D Anyone who ever dares to speak ill of Windows now will recive a very powerful finger down the throat (that's about the most powerful attack I can muster).


Picklesworth(Posted 2005) [#6]
Uhm... Don't ask why, but my compiler is a pile of ancient stoneage garbage that doesn't even support spaces in file names (let alone the clipboard or decent hotkey standards), and the header files are all 10 years old at least, and I'm too lazy to replace them.

Anyways, can somebody please write me a quick program in another programming language other than b3d, that does nothing but what the following does?:
MyAppTile$ = "Blitz as a Child Test - Main Window"
Include "Consts_Win32.bb"

Graphics 800,600,0,2
AppTitle MyAppTile$

Global hWnd = GetActiveWindow()
;NOTE: Now covered by self-embedder
;style=GetWindowLong(hWnd ,GWL_STYLE)
;style = style Xor WS_CLIPCHILDREN 
;SetWindowLong hwnd,GWL_STYLE,style

ExecFile "SelfEmbedder.exe " + hWnd

; First parameter is the scancode to fake, the second is the window name
InstallCloseHandler(222, MyAppTile$)

exfg = 0
While (Not KeyHit(1))
	If KeyHit(222) Then exfg = 1 ;for clicking on [X]

	If exfg = 1 Then Exit
Wend

UnInstallCloseHandler()
End

Basically, use GetActiveWindow() to get the handle of the window, execute the exe file called "SelfEmbedder.exe" with the window handle as the command line, and go into a main loop exited in some way (or you could probably just stop the program in some way).
ShellExecute(), I think, is the way to execute a program via C++, just in case you need to look it up (you can tell so easily that I'm a c++ n00b).

Please email the .exe and, if you want, the source, to dillpickle79@... or DylanMcCall@... (however, gmail may give you trouble with attachments).
If you want to make a Java applet I will pay you. I'm not saying what with - it doesn't have to be money or a program or even any material things, but you will be payed... Maybe I'll finish something finally so that the community here gets something from my incessant questioning, because this project will be ignorable for a bit.
Now that I've layed out the rules - I'll actually probably pay you in that way no matter what you give me so long as it should work.



Also, the compiler giving me heck is true, but it's mostly to cover for my own present inability to code in a complex programming language.



PS: Consts_Win32.bb is here if you want them: http://www.blitzbasic.com/codearcs/codearcs.php?code=589