ok.. i wrote this code now:
Code:
//-------------------------------------------------------------------------------------------------
// • Einbinden der Scripts
//-------------------------------------------------------------------------------------------------
#include <acknex.h>
#include <default.c>
#include <windows.h>

//-------------------------------------------------------------------------------------------------
// • Einbinden der Pfade
//-------------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------------
// • Funktionen
//-------------------------------------------------------------------------------------------------
long ScanMessage(UINT message, WPARAM wParam, LPARAM lParam);

function menucreate()
{
	long menuheader;
	long submenu1;
	long submenu12;
	
	HWND hwnd=hWnd;
	
	//	CreateMenu(); ist der Befehl dazu, der gibt ein Handle auf das neue Menü zurück
	menuheader = CreateMenu();
	submenu1 = CreateMenu();
	submenu12 = CreateMenu();
	
	//	InsertMenu(); ist der Befehl der Menüpunkte erstellt
	// InsertMenu(longpointer, Position, Flags, sublongpointer / id, "Anzeigestring");
	InsertMenu(submenu1, 1, MF_BYPOSITION|MF_STRING|MF_POPUP, submenu12, "Neu");
	InsertMenu(submenu1, 2, MF_BYPOSITION|MF_STRING, 2, "Öffnen");
	InsertMenu(submenu1, 3, MF_BYPOSITION|MF_STRING, 3, "Beenden");
	
	InsertMenu(submenu12, 4, MF_BYPOSITION|MF_STRING, 4, "Karte");
	InsertMenu(submenu12, 5, MF_BYPOSITION|MF_STRING, 5, "Map");
	InsertMenu(submenu12, 6, MF_BYPOSITION|MF_STRING, 6, "Quest");
	
	InsertMenu(menuheader, 0, MF_BYPOSITION|MF_STRING|MF_POPUP, submenu1, "Datei");
	
	
	SetMenu(hwnd,menuheader);
}

//-------------------------------------------------------------------------------------------------
// • Mainscripts
//-------------------------------------------------------------------------------------------------
function main()
{
	fps_max= 60;
	video_mode = 8;
	video_aspect = 1.777;
	level_load(NULL);
	wait(3);
	
	menucreate();
	on_scanmessage = ScanMessage;
}

//-------------------------------------------------------------------------------------------------
// • Longs
//-------------------------------------------------------------------------------------------------
long ScanMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (WM_COMMAND) {
		case message:
		switch (wParam) {
			case 2:
			printf("Es wurde auf 'Öffnen' geklickt");
			return(1);
			
			case 3:
			printf("Es wurde auf 'Beenden' geklickt");
			return(1);
			
			case 4:
			printf("Es wurde auf 'Neue Karte' geklickt");
			return(1);
			
			case 5:
			printf("Es wurde auf 'Neue Map' geklickt");
			return(1);
			
			case 6:
			printf("Es wurde auf 'Neue Quest' geklickt");
			return(1);

			
			default:
			break;
		}
		
		break;
		default:
		break;
	}
}



But now nothing reacts when the project is started.. i need to end the process via the task manager. What´s wrong?

Last edited by Espér; 12/05/09 12:37.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<