예제 #1
0
INT_PTR CALLBACK WdeOptionsDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    bool ret;

    /* touch unused vars to get rid of warning */
    _wde_touch( lParam );

    ret = false;

    switch( message ) {
    case WM_SYSCOLORCHANGE:
        WdeCtl3dColorChange();
        break;

    case WM_INITDIALOG:
        WdeOptWin = hDlg;
        WdeSetOptInfo( hDlg, &WdeCurrentState );
        ret = true;
        break;

    case WM_DESTROY:
        WdeOptWin = NULL;
        break;

    case WM_COMMAND:
        switch( LOWORD( wParam ) ) {
        case IDB_HELP:
            WdeHelpRoutine();
            break;

        case IDOK:
            WdeGetOptInfo( hDlg );
            EndDialog( hDlg, TRUE );
            ret = true;
            break;

        case IDCANCEL:
            EndDialog( hDlg, FALSE );
            ret = true;
            break;

#if 0
        case IDB_OPT_SETDEFS:
            WdeSetOptInfo( hDlg, &WdeDefaultState );
            break;
#endif

        }
    }

    return( ret );
}
예제 #2
0
WINEXPORT BOOL CALLBACK WdeSplash( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    UINT        msecs, timer, start;
    HDC         dc, tdc;
    HBITMAP     old;
    HWND        w666;
    RECT        rect, arect;
    PAINTSTRUCT ps;
#ifdef __NT__
    HINSTANCE   hInstUser;
    PFNLI       pfnLoadImage;
#endif

    static BITMAP    bm;
    static HBITMAP   logo;
    static HBRUSH    brush;
    static COLORREF  color;

    switch( message ) {
    case WM_SYSCOLORCHANGE:
        WdeCtl3dColorChange();
        break;

    case WM_DESTROY:
        if( logo ) {
            DeleteObject( logo );
        }
        if( brush ) {
            DeleteObject( brush );
        }
        break;

    case WM_INITDIALOG:
        msecs = *(UINT *)lParam;
        if( msecs ) {
            timer = SetTimer( hDlg, ABOUT_TIMER, msecs, NULL );
            if( timer ) {
                SET_DLGDATA( hDlg, (LONG)timer );
            }
        }

#ifdef __NT__
        hInstUser = GetModuleHandle( "USER32.DLL" );
        pfnLoadImage = (PFNLI)GetProcAddress( hInstUser, "LoadImageA" );
        if( pfnLoadImage != NULL ) {
            logo = pfnLoadImage( hInstWde, "AboutLogo", IMAGE_BITMAP, 0, 0,
                                 LR_LOADMAP3DCOLORS );
        } else {
#endif
            logo = LoadBitmap( hInstWde, "AboutLogo" );
#ifdef __NT__
        }
#endif

#if 0
        color = GetSysColor( COLOR_BTNFACE );
        color = RGB( 128, 128, 128 );
#endif
        color = GetSysColor( COLOR_BTNFACE );
        brush = CreateSolidBrush( color );

        GetObject( logo, sizeof( BITMAP ), &bm );
        return( TRUE );

#if 0
#ifdef __NT__
    case WM_CTLCOLORSTATIC:
        if( brush != NULL ) {
            dc = (HDC)wParam;
            SetBkColor( dc, color );
            return( (LRESULT)brush );
        }
        break;
#else
    case WM_CTLCOLOR:
        if( brush != NULL ) {
            dc = (HDC)wParam;
            if( HIWORD( lParam ) == CTLCOLOR_STATIC ) {
                SetBkColor( dc, color );
            }
            return( (LRESULT)brush );
        }
        break;
#endif

    case WM_ERASEBKGND:
        if( brush != NULL ) {
            GetClientRect( hDlg, &rect );
            UnrealizeObject( brush );
            FillRect( (HDC)wParam, &rect, brush );
            return( TRUE );
        }
        break;
#endif

    case WM_PAINT:
        dc = BeginPaint( hDlg, &ps );
        if( dc != NULL ) {
            w666 = GetDlgItem( hDlg, 666 );
            GetClientRect( w666, &rect );
            GetClientRect( hDlg, &arect );
            start = (arect.right - arect.left - bm.bmWidth) / 2;
            MapWindowPoints( w666, hDlg, (POINT *)&rect, 2 );
            tdc = CreateCompatibleDC( dc );
            old = SelectObject( tdc, logo );
            BitBlt( dc, start, rect.top + 20, bm.bmWidth, bm.bmHeight, tdc, 0, 0, SRCCOPY );
            SelectObject( tdc, old );
            DeleteDC( tdc );
            EndPaint( hDlg, &ps );
        }
        break;

    case WM_TIMER:
        timer = (UINT)GET_DLGDATA( hDlg );
        if( timer ) {
            KillTimer( hDlg, timer );
        }
        EndDialog( hDlg, TRUE );
        return( TRUE );
    }

    return( FALSE );
}
예제 #3
0
WINEXPORT BOOL CALLBACK WdeInfoWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
{
    WORD    w;
    RECT    r;
    HDC     dc;

    _wde_touch( lParam );

    switch( message ) {
#if defined( __NT__ )
    case WM_INITDIALOG:
        SetWindowLong( hWnd, GWL_STYLE, WS_CHILD );
        break;
#endif
    case WM_SYSCOLORCHANGE:
#if defined( __NT__ )
        WdeInfoColor = GetSysColor( COLOR_BTNFACE );
        DeleteObject( WdeInfoBrush );
        WdeInfoBrush = CreateSolidBrush( WdeInfoColor );
#endif
        WdeCtl3dColorChange ();
        break;

#ifdef __NT__
    case WM_CTLCOLORBTN:
    case WM_CTLCOLORSTATIC:
        dc = (HDC)wParam;
        SetBkColor( dc, WdeInfoColor );
        return( WdeInfoBrush != NULL );

    case WM_CTLCOLORMSGBOX:
    case WM_CTLCOLOREDIT:
        break;
#else
    case WM_CTLCOLOR:
        w = HIWORD( lParam );
        if( w != CTLCOLOR_MSGBOX && w != CTLCOLOR_EDIT ) {
            dc = (HDC)wParam;
            SetBkColor( dc, WdeInfoColor );
            return( WdeInfoBrush != NULL );
        }
        break;
#endif

    case WM_ERASEBKGND:
#if defined( __NT__ )
        if( WdeInfoColor != GetSysColor( COLOR_BTNFACE ) ) {
            /* Fake it, this proc does not get it ... */
            SendMessage( hWnd, WM_SYSCOLORCHANGE, (WPARAM)0, (LPARAM)0 );
        }
#endif
        GetClientRect( hWnd, &r );
        UnrealizeObject( WdeInfoBrush );
        FillRect( (HDC)wParam, &r, WdeInfoBrush );
        return( TRUE );

    case WM_COMMAND:
        w = GET_WM_COMMAND_CMD( wParam, lParam );
        switch( LOWORD( wParam ) ) {
        case IDB_INFO_IDSTR:
            if( w == CBN_EDITCHANGE || w == CBN_SELCHANGE ) {
                WdeInfoLookupComboEntry( hWnd, w );
            }
            break;

        case IDB_INFO_SET:
            WdeChangeInfo();
            SetFocus( WdeGetMainWindowHandle() );
            break;

        case IDB_INFO_RESET:
            WdeResetInfo();
            break;

        case IDCANCEL:
            WdeResetInfo();
            SetFocus( WdeGetMainWindowHandle() );
            break;
        }
        break;
    }
    return( FALSE );
}