Have not heard back from support yet obviously, but I figured out a solution without ScanMessage.
Try this example (should run fine):
Code:
#include <acknex.h>
#include <default.c>
#include <windows.h>
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
function main()
{
wait(1);
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");
SetWindowLong(hWnd,GWL_WNDPROC, WndProc);
//Change Window style to activate Maximize button
SetWindowLong(hWnd,GWL_STYLE, WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX+WS_SIZEBOX);
SetMenu(hWnd,menu);
ShowWindow(hWnd,SW_SHOW);
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
switch(message){
case WM_LBUTTONDOWN:
MessageBox(NULL, "L mouse down","info", MB_OK);
break;
case WM_RBUTTONDOWN:
MessageBox(NULL, "R mouse down","info", MB_OK);
break;
case WM_COMMAND:
switch(wParam){
case 1: beep(); break;
case 2: sys_exit(NULL);
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return(0);
}
I will make a nice example with some common dialogs and post in Lite-C contributions