This works for me:

Code:

LRESULT CALLBACK ScanMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{

case WM_CLOSE:
sys_exit(NULL);

case WM_QUIT:
sys_exit(NULL);

case WM_KILLFOCUS:
ED_WindowFocus = false;

case WM_SETFOCUS:
ED_WindowFocus = true;

case WM_COMMAND:
{
switch(wParam)
{
case 1:
{
break;
}
case 2:
{
break;
}
case 3:
{
sys_exit(NULL);
break;
}
}
}

default:
return DefWindowProc(hWnd, message, wParam, lParam);
}

return(0);
}



JCL, please add an example for this to the manual.