#include <acknex.h>
#include <default.c>
#include <windows.h>
void set_api_main()
{
HMENU menu=CreateMenu();
HMENU hSubMenu=CreateMenu();
InsertMenu(hSubMenu,0,MF_BYPOSITION|MF_STRING,1,"BEEP");
InsertMenu(hSubMenu,1,MF_BYPOSITION|MF_STRING,2,"QUIT");
InsertMenu(menu,0,MF_BYPOSITION|MF_STRING|MF_POPUP,hSubMenu,"File");
//Change Window style to activate Maximize button
SetWindowLong(hWnd,GWL_STYLE, WS_CAPTION+WS_SYSMENU+WS_MAXIMIZEBOX+WS_SIZEBOX);
SetMenu(hWnd,menu);//here it crash
ShowWindow(hWnd,SW_SHOW);
}
function MyMessageFunction(UINT message, WPARAM wParam, LPARAM lParam);
function main()
{
set_api_main();
on_scanmessage = MyMessageFunction;
}
function MyMessageFunction(UINT message, WPARAM wParam, LPARAM lParam){
if(message == WM_COMMAND){ wait(1);}
}