コード例 #1
0
static void fillThreadCtl( HWND hwnd, ProcStats *info, char *buf ) {

    HWND        lb;
    int         index;
    char        save[100];
    ThreadList  thdinfo;
    ThreadPlace place;
    BOOL        rc;

    lb = GetDlgItem( hwnd, THREAD_LIST );
    index = (int)SendMessage( lb, LB_GETCURSEL, 0, 0L );
    if( index == LB_ERR ) {
        strcpy( save, "bbbbbbbbbbbb" ); /* just some text that shouldn't
                                           match anything in the listbox */
    } else {
        SendMessage( lb, LB_GETTEXT, index, (LPARAM)(LPSTR)save );
    }
    SendMessage( lb, LB_RESETCONTENT, 0, 0L );
    rc = GetNextThread( &thdinfo, &place, info->pid, TRUE );
    while( rc ) {
        sprintf( buf, "tid = %08lX", thdinfo.tid );
        SendMessage( lb, LB_ADDSTRING, 0, (LPARAM)(LPCSTR)buf );
        rc = GetNextThread( &thdinfo, &place, info->pid, FALSE );
    }
    index = SendMessage( lb, LB_FINDSTRING, -1, (LPARAM)(LPCSTR)save );
    if( index == LB_ERR ) {
        enableChoices( hwnd, FALSE );
    } else {
        SendMessage( lb, LB_SETCURSEL, index, 0L );
    }
}
コード例 #2
0
ファイル: accrtrd.c プロジェクト: Azarien/open-watcom-v2
trap_retval ReqRunThread_get_next( void )
{
    run_thread_get_next_req *acc;
    run_thread_get_next_ret *ret;
    struct TDebug           *obj;

    acc = GetInPtr( 0 );
    ret = GetOutPtr( 0 );
    ret->thread = 0;

    obj = GetCurrentDebug();
        if (obj)
        ret->thread = GetNextThread( obj, acc->thread );

    return( sizeof( *ret ) );
}