Esempio n. 1
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        public static ReturnCode ProcessEvents(
            Interpreter interpreter, /* NOT USED */
            ref Result error
            )
        {
            try
            {
#if NATIVE && WINDOWS
                //
                // NOTE: If this thread has a message queue and there
                //       appears to be anything in it, process it now.
                //
                if (PlatformOps.IsWindowsOperatingSystem())
                {
                    if (HasMessageQueue(
                            GlobalState.GetCurrentNativeThreadId(),
                            ref error))
                    {
                        uint flags = UnsafeNativeMethods.QS_ALLINPUT;

                        if (UnsafeNativeMethods.GetQueueStatus(flags) != 0)
#endif
                DoEvents();
#if NATIVE && WINDOWS
            }
        }

        else
        {
            DoEvents();
        }
#endif

                return(ReturnCode.Ok);
            }
            catch (Exception e)
            {
                if (traceException)
                {
                    TraceOps.DebugTrace(
                        e, typeof(WindowOps).Name,
                        TracePriority.NativeError);
                }

                error = e;
            }

            return(ReturnCode.Error);
        }