예제 #1
0
LRESULT CALLBACK WREResInfoProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    WREResInfo  *info;
    LRESULT     ret;
    WORD        wp;
    UINT        cmd;

    ret = FALSE;

    switch( message ) {
    case WM_INITDIALOG:
        info = (WREResInfo *)lParam;
        info->info_win = hDlg;
        SET_DLGDATA( hDlg, (LONG_PTR)info );
        if( !WREInitResourceWindow( info, 0 ) ) {
            DestroyWindow( hDlg );
        } else {
            ret = TRUE;
        }
        break;

    case WM_SYSCOLORCHANGE:
#if defined( __NT__ )
        SET_HBRBACKGROUND( hDlg, (HBRUSH)(COLOR_BTNFACE + 1) );
#endif
        WRECtl3dColorChange();
        break;

    case WM_COMMAND:
        wp = LOWORD( wParam );
        switch( wp ) {
        case IDM_RNRES:
            cmd = GET_WM_COMMAND_CMD( wParam, lParam );
            if( cmd == LBN_DBLCLK ) {
                WREHandleResEdit();
            }
            break;

        case IDM_RNTYPE:
            info = (WREResInfo *)GET_DLGDATA( hDlg );
            cmd = GET_WM_COMMAND_CMD( wParam, lParam );
            if( cmd == LBN_SELCHANGE ) {
                WREAddResNames( info );
            }
            break;
        }
        break;
    }

    return( ret );
}
예제 #2
0
BOOL CALLBACK WREResDeleteProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    char    *name;
    BOOL    ret;

    ret = FALSE;

    switch( message ) {
    case WM_INITDIALOG:
        name = (char *)lParam;
        WRESetWinInfo( hDlg, name );
        ret = TRUE;
        break;

    case WM_SYSCOLORCHANGE:
        WRECtl3dColorChange();
        break;

    case WM_COMMAND:
        switch( LOWORD( wParam ) ) {
        case IDM_HELP:
            WREHelpRoutine();
            break;

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

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

    return( ret );
}
예제 #3
0
BOOL CALLBACK WREResPasteProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    WREPasteData        *pdata;
    BOOL                ret;

    ret = FALSE;

    switch( message ) {
    case WM_INITDIALOG:
        pdata = (WREPasteData *)lParam;
        SET_DLGDATA( hDlg, pdata );
        WRESetPasteInfo( hDlg, pdata );
        ret = TRUE;
        break;

    case WM_SYSCOLORCHANGE:
        WRECtl3dColorChange();
        break;

    case WM_COMMAND:
        switch( LOWORD( wParam ) ) {
        case IDM_PASTE_RENAME:
        case IDM_PASTE_REPLACE:
            pdata = (WREPasteData *)GET_DLGDATA( hDlg );
            EndDialog( hDlg, LOWORD( wParam ) );
            ret = TRUE;
            break;

        case IDCANCEL:
            EndDialog( hDlg, IDCANCEL );
            ret = TRUE;
            break;
        }
    }

    return( ret );
}
예제 #4
0
Bool WINEXPORT WRESplash( HWND hDlg, WORD 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:
        WRECtl3dColorChange();
        break;

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

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

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

        //color = RGB( 128, 128, 128 );
        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)GetWindowLong( hDlg, DWL_USER );
        if( timer != 0 ) {
            KillTimer( hDlg, timer );
        }
        EndDialog( hDlg, TRUE );
        return( TRUE );
    }

    return( FALSE );
}