static long /*int*/ windowProc(
     long /*int*/ hwnd, long /*int*/ msg, long /*int*/ wParam, long /*int*/ lParam) {
   switch ((int) /*64*/ msg) {
     case OS.WM_UPDATEUISTATE:
       /*
        * In XULRunner 17, calling the default windowProc for WM_UPDATEUISTATE message
        * terminates the program. Workaround is to prevent the call to default windowProc.
        */
       return 0;
     case OS.WM_ERASEBKGND:
       RECT rect = new RECT();
       OS.GetClientRect(hwnd, rect);
       OS.FillRect(wParam, rect, OS.GetSysColorBrush(OS.COLOR_WINDOW));
       break;
   }
   return OS.CallWindowProc(MozillaProc, hwnd, (int) /*64*/ msg, wParam, lParam);
 }