Exemple #1
0
static void DebugThread( void *Param )
{
    int CurrModuleHandle;
    int WaitHandle;
    int thread;
    struct TDebug *obj = (struct TDebug *)Param;

    obj->FInstalled = TRUE;

    CurrModuleHandle = RdosGetModuleHandle();
    SelfKey = RdosGetModuleFocusKey( CurrModuleHandle );    
    if ( SelfKey != RdosGetFocus() )
        SelfKey = 0;
        
    RdosWaitMilli( 250 );

    obj->FHandle = RdosSpawnDebug( obj->FProgram, obj->FParam, obj->FStartDir, 0, 0, &thread);
        
    RdosWaitMilli( 250 );

    if( obj->FHandle ) {
        WaitHandle = RdosCreateWait();
        RdosAddWaitForDebugEvent( WaitHandle, obj->FHandle, obj );
        
        while( obj->FInstalled )
            if( RdosWaitForever( WaitHandle ) )
                SignalDebugData( obj );

        RdosCloseWait( WaitHandle );
    } else
        obj->FInstalled = FALSE;
}
bool DebugScreen( void )
{
    int handle;
    
    if( my_key == 0) {
        handle = RdosGetModuleHandle();
        my_key = RdosGetModuleFocusKey( handle );
    }
    
    if( my_key )
        RdosSetFocus( my_key );
        
    return( FALSE );
}