// window procedure of a hidden window which is created just to receive
// the notification message when a process exits
LRESULT APIENTRY
wxExecuteWindowCbk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    if ( message == wxWM_PROC_TERMINATED )
    {
        DestroyWindow(hWnd);    // we don't need it any more

        wxExecuteData * const data = (wxExecuteData *)lParam;
        if ( data->handler )
        {
            data->handler->OnTerminate((int)data->dwProcessId,
                                       (int)data->dwExitCode);
        }

        if ( data->state )
        {
            // we're executing synchronously, tell the waiting thread
            // that the process finished
            data->state = false;
        }
        else
        {
            // asynchronous execution - we should do the clean up
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
            for ( wxVector<HANDLE>::iterator it = gs_asyncThreads.begin();
                  it != gs_asyncThreads.end();
                  ++it )
            {
                if ( *it == data->hThread )
                {
                    gs_asyncThreads.erase(it);
                    if ( !::CloseHandle(data->hThread) )
                    {
                        wxLogLastError(wxT("CloseHandle(hThread)"));
                    }
                    break;
                }
            }

            delete data;
        }

        return 0;
    }
    else
    {
        return ::DefWindowProc(hWnd, message, wParam, lParam);
    }
}
Beispiel #2
0
void MyClient::StartNextTestIfNecessary()
{
    while ( !m_tests.empty() )
    {
        MyClientTestFunc testfunc = m_tests.front();
        m_tests.erase(m_tests.begin());
        (this->*testfunc)();
    }
}
Beispiel #3
0
 virtual ~MyClass()
 {
     for ( size_t i=0; i<gs_myClassInstances.size(); i++ )
     {
         if ( gs_myClassInstances[i] == this )
         {
             gs_myClassInstances.erase(gs_myClassInstances.begin()+i);
         }
     }
 }
Beispiel #4
0
// Notification when a sound has stopped
void wxSound::SoundStopped(const wxSoundData* data)
{
    for ( wxVector<wxSoundData*>::iterator s = s_soundsPlaying.begin();
         s != s_soundsPlaying.end(); ++s )
    {
        if ( (*s) == data )
        {
            s_soundsPlaying.erase(s);
            break;
        }
    }
}
Beispiel #5
0
void wxNotificationMessageWindow::RemoveVisibleNotification(wxNotificationMessageWindow* notif)
{
    for ( wxVector<wxNotificationMessageWindow*>::iterator it = ms_visibleNotifications.begin();
        it != ms_visibleNotifications.end(); ++it )
    {
        if ( *it == notif )
        {
            ms_visibleNotifications.erase(it);
            break;
        }
    }
    ResizeAndFitVisibleNotifications();
}
Beispiel #6
0
    virtual ~MyClass()
    {
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
        for ( size_t i=0; i<gs_myClassInstances.size(); i++ )
        {
            if ( gs_myClassInstances[i] == this )
            {
                gs_myClassInstances.erase(gs_myClassInstances.begin()+i);
            }
        }
    }