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:
GUI.h
AssemblyInfo.cpp:
Stadfx.cpp:
Stadfx.h:
Thanks
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