Hi,
I tried but did not work. What I write when I take off the WinMain and LRES stuff?
I need create a new int function instead of WinMain like: int createMenu() and void WndProc(...) instead of LRESULT CALLBACK WndProc(...);
Please see my code above and tell me what I did wrong.


////////////////////////////////////////////////////////////////////
#include <litec.h>
#include <acknex.h>
#include <default.c>

////////////////////////////////////////////////////////////////////

void WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message){
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_COMMAND:
switch(wParam){
case 1:
{
OPENFILENAME of;
char buf[256];
FillMemory(&of,sizeof(of),0);
FillMemory(buf,256,0);
of.Flags=OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
of.lpstrFilter ="Supported Files Types (*.mp3;*.wav;*.mpg;*.mpeg)\0*.mp3;*.wav;*.mpg;*.mpeg\0";
of.lStructSize=sizeof(of);
of.hwndOwner=hWnd;
of.lpstrFile=buf;
of.nMaxFile=255;
of.lpstrTitle="Open";
if (GetOpenFileName(&of))
MessageBox(NULL,"abriu","My first program",0);
}
break;
case 2:
break;
case 3:
PostQuitMessage(0);
break;
}
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hWnd, &ps);
RECT rect;GetClientRect(hWnd,&rect);
EndPaint(hWnd, &ps);
}
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

int createMenu()
{
char *szClass="CScriptWindowClass";
HINSTANCE hInstance=GetModuleHandle(NULL);
UnregisterClass(szClass,hInstance);
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW|CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance,128);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = COLOR_WINDOW+1;
wcex.lpszMenuName = NULL;
wcex.lpszClassName = szClass;
wcex.hIconSm = LoadIcon(hInstance,128);
RegisterClassEx(&wcex);
long menu=CreateMenu();
long hSubMenu;
hSubMenu=CreateMenu();
InsertMenu(hSubMenu,0,MF_BYPOSITION|MF_STRING,1,"Open");
InsertMenu(hSubMenu,2,MF_BYPOSITION|MF_STRING,3,"QUIT");
InsertMenu(menu,0,MF_BYPOSITION|MF_STRING|MF_POPUP,hSubMenu,"File");
if (hWnd)
{
SetMenu(hWnd,menu);
ShowWindow(hWnd,SW_SHOW);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
}



void main()
{
video_mode = 7; // lite-C: start in 640x480 resolution
video_screen = 2; // lite-C: start settings for Fullscreen
level_load("VAH.wmb");
wait(2); // let level load
Mouse_init(); // function for the mouse
createMenu();
}