#include "thief.h"

BOOL CALLBACK AboutBoxWndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
    {
    static HWND hAbout ;
    char cTmp  [255] ;

    switch (iMsg)
        {
        case WM_INITDIALOG :
            if (! STATE_EnterDialogBox ())
                {
                EndDialog (hwnd, FALSE) ;
                return FALSE ;
                }

            hAbout = GetDlgItem (hwnd, IDD_ABOUT_VERSION) ;

            sprintf (cTmp, "%s %s", THIEF_VER, THIEF_NICK) ;
            SetWindowText (hAbout, cTmp) ;

            TOOLBOX_CenterWindow (hwnd, GetWindow (hwnd, GW_OWNER)) ;
            return TRUE ;

        case WM_COMMAND:
            switch (LOWORD (wParam))
                {
                case IDOK :
                case IDCANCEL :
                    EndDialog (hwnd, TRUE) ;
                    STATE_LeaveDialogBox () ;
                    return TRUE ;
                }
            break ;
        }
    return FALSE ;
    }
