Attach "File Menu" to "Main window" ?

BlitzPlus Forums/BlitzPlus Beginners Area/Attach "File Menu" to "Main window" ?

Guy Fawkes(Posted 2014) [#1]
Hi all. As the title says, how do I grab the window handle of the main window created by Graphics(800, 600, 0, 2) and attach a file menu to it?

I need it for a program I'm making. :)

Thank You!


degac(Posted 2014) [#2]
Hi
I have no BlitzPlus... but I suspect that if you open a Graphics screen you can't have a 'window with menu bar' on it (or you need to create your own GUI).
I think you need to use CreateWindow and then CreateMenu (this is what we do in BlitzMax+MaxGUI)


Guy Fawkes(Posted 2014) [#3]
... Well there IS a way, but I need to know how to make the "CreateWindow()" move with the Graphics() window when dragging the Graphics() window.


Pakz(Posted 2014) [#4]
I remember that for a screen to have a menu you must use the gui commands. Use a canvas to draw the game graphics on. I think you then need to work with the interuptions codes.

I never had the graphics command work with the gui menu commands.


Guy Fawkes(Posted 2014) [#5]
There actually IS a way using the win32 api. But I'm not sure exactly which command grabs the main window handle.

I use api_GetActiveWindow() which is close, but that only grabs the currently active window. It doesn't grab the actual main window handle.


Matty(Posted 2014) [#6]
Why not use a canvas?


Guy Fawkes(Posted 2014) [#7]
Because unfortunately a canvas won't work for blitz+ hardwired. What I'm essentially trying to do is get the main window's handle so I can use WinBlitz3D to create the file menu, and the original gadgets in Blitzplus to create the GUI basically. If you need me to, I can try to explain a bit more in-depth.

Thanks ALOT for the help as usual! :)

Sincerely,

~GF


Dan60(Posted 2014) [#8]
There is a "game menu" in the Code Archives section. I can't remember the exact name.
I tried the demo, and it works good, and will work in graphics mode and it will have the games menu feel to it. I Will probably use it in my game. Looks like it's very well written code too. IT doesn't have the File menu built in, but I plan on adding that to his code.


Guy Fawkes(Posted 2014) [#9]
Great! Can you show me an example when you finish it? Thanks alot! :)


Dan60(Posted 2014) [#10]
You can find an example if you click help>samples>windowedgame

It uses createwindow() and createcanvas()


Guy Fawkes(Posted 2014) [#11]
Hey, thanks alot Dan! :)