New GUI Userlib

Blitz3D Forums/Blitz3D Userlibs/New GUI Userlib

I'm trying to make a new GUI userlib for my games. Does anybody know c++? I need to get the window handle and the window instance to work. It also needs to return the mem address but that is required to create the button. Do you know how to do that?
GUI.cpp:
// This is the main DLL file.

#include "stdafx.h"

#include "GUI.h"

int CreateButton(char* tempText, int x, int y, int width, int height, HWND hwnd)
{
	HWND hButtonTemp;
	int identifier = 10014124;
	hButtonTemp = CreateWindowEx(0, "BUTTON", tempText, WS_CHILD | WS_VISIBLE, x, y, width, height, hwnd, 
		(HMENU)identifier, hInstance, NULL);
	return identifer;
}

GUI.h
// GUI.h

#pragma once

#include <windows.h>

using namespace System;

namespace GUI
{
	public __gc class Class1
	{
		HWND CreateButton(char* tempText, int x, int y, int width, int height, HWND hwnd);
	};
}

AssemblyInfo.cpp:
#include "stdafx.h"

using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;

//
// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("Adren Software")];
[assembly:AssemblyProductAttribute("GUI UserLib - Button")];
[assembly:AssemblyCopyrightAttribute("")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];		

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the value or you can default the Revision and Build Numbers 
// by using the '*' as shown below:

[assembly:AssemblyVersionAttribute("1.0.0")];

//
// In order to sign your assembly you must specify a key to use. Refer to the 
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing. 
//
// Notes: 
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the 
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key 
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//        When specifying the KeyFile, the location of the KeyFile should be
//        relative to the project directory.
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly:AssemblyDelaySignAttribute(false)];
[assembly:AssemblyKeyFileAttribute("")];
[assembly:AssemblyKeyNameAttribute("")];

Stadfx.cpp:
// stdafx.cpp : source file that includes just the standard includes
// GUI.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

#define WIN32_LEAN_AND_MEAN

Stadfx.h:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

Thanks

Isn't there a Api Call to get the HWND, GetHWND or something? Must be in user32.dll or so...

To be honest, I wouldn't make a GUI Lib in C++ for Game that is written in Blitz3D. I'd rather enjoy the freedom of style in Blitz3D and create may own GUI from scratch, or use an existing GUI that is not using the Win Api. Also with portability in mind.

But it's your business.

I think BlitzSys and the Win32 constants list allow for you to create a fine Windows gui using almost all Blitz-end code. I could easily be totally wrong though...

Anyways:
Global hWnd = SystemProperty("AppHWND")

http://www.mentalis.org/agnet/apiguide.shtml
There are many window finding functions in User32.dll, which are listed with examples in the Window Handle group of that guide.

Yea, you use WinApi to code the Gui dont do it in c++

If you really need a window Lib... look in the toolbox...