Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,097 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Windows Forms and ToolBox in A8 #378330
07/22/11 14:54
07/22/11 14:54
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
Hi.
i want use WindowsForms whit Tools(Button,ListBox,ComboBox,PictureBox and...) inside my game like this:

but i dont want use AcknexWrapper or any.Because i want run my game with A8 no other compiler.
how?
thanks.

Re: Windows Forms and ToolBox in A8 [Re: Giti] #378338
07/22/11 16:52
07/22/11 16:52
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
This may help:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=317762

The second code I posted there creates an other window and the third creates an other window with a button on it. You can create all those controls using the WINAPI on those windows.
This may have some issues though. I think the main window will be updated less frequently, so it seems like frames are skipped.

This method only uses the naked WINAPI. You can't use .net classes or MFC or something like that without a wrapper.


For a GUI for Gamestudio that is better than normal panel buttons, etc. click the "LBGUI" link in my signature.

Re: Windows Forms and ToolBox in A8 [Re: Lukas] #378366
07/22/11 23:01
07/22/11 23:01
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
thanks man.
its really good.

Thank You.

Re: Windows Forms and ToolBox in A8 [Re: Giti] #378378
07/23/11 07:22
07/23/11 07:22
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
can i use Engine , by Child in inside form?
like this:

or this:

How?

Last edited by Giti; 07/23/11 07:23.
Re: Windows Forms and ToolBox in A8 [Re: Giti] #378379
07/23/11 07:34
07/23/11 07:34
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Option 1) Use the 'hWndTarget' variable to re-direct the renderer to another window. All you need is the HWND (handle) of the window (or control) that you want to render into. More in the manual about this.

Option 2) Use the WinAPI functions SetWindowLong, SetParent, etc to physically embed the child window into another. Might have some problems with threading and input between the two, so you can find functions such as AttachThreadInput, overriding the wndProc, etc to help fix these problems.

If you don't know what a HWND is or whatever, then I suggest you look at a few basic WIN32 tutorials to get an idea just how nasty this stuff is laugh

You'd be far better off with the C# wrapper though laugh

Last edited by DJBMASTER; 07/23/11 07:37.
Re: Windows Forms and ToolBox in A8 [Re: DJBMASTER] #378380
07/23/11 07:58
07/23/11 07:58
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
thanks man.
please show me , option1,2 in code?
"You'd be far better off with the C# wrapper though".its true. but i have a problem.when i save a level in C#wrapper , i can not load the level in A8.Because ENTITYs and FUNCTIONs and Everything is Definition in C#wrapper , not definition in "A8 C" code. so i have create a compiler for convert wrapper code to "A8 C" code for run my game in A8.
please help me.

Last edited by Giti; 07/24/11 23:40.
Re: Windows Forms and ToolBox in A8 [Re: Giti] #378637
07/25/11 10:29
07/25/11 10:29
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
help me please.

Re: Windows Forms and ToolBox in A8 [Re: Giti] #378641
07/25/11 11:16
07/25/11 11:16
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
1) is easy. Just put the line
hWndTarget = hwnd1;
right before the message loop in the codes I've shown you. Then the engine will render in the second window we create in that code. Note that it won't adjust the resolution though. So you have to set the resolution to the window size or vice versa.

Re: Windows Forms and ToolBox in A8 [Re: Lukas] #378645
07/25/11 11:47
07/25/11 11:47
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Also you'll need to re-direct the wndProc to the new window and destroy the original window using DestroyWindow.

Re: Windows Forms and ToolBox in A8 [Re: DJBMASTER] #378701
07/25/11 20:28
07/25/11 20:28
Joined: Jul 2011
Posts: 39
G
Giti Offline OP
Newbie
Giti  Offline OP
Newbie
G

Joined: Jul 2011
Posts: 39
thanks guys.
its work!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1