static inline int isxdigit2(int ch) { if (isdigit2(ch)) return true; if (ch >= 'a' && ch <= 'f') return true; return (ch >= 'A') && (ch <= 'F'); }
BOOL CWndConfirmBank::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) { if( nID == WIDC_OK || message == EN_RETURN ) { CWndEdit *m_pPass = (CWndEdit*)GetDlgItem( WIDC_EDIT1 ); if( m_pPass ) { // 여기서 공백이 있는지 혹은 숫자이외의 것이 오는지 확인 char szPass[10] ={0,}; strncpy( szPass, m_pPass->GetString(), 10 ); if( strlen( szPass ) == 4 ) { BOOL bDigit = TRUE; for( int i = 0 ; i < 4 ; i++ ) { if( isdigit2( szPass[i] ) == FALSE ) { bDigit = FALSE; break; } } if( bDigit ) { g_DPlay.SendConfirmBank( szPass, m_dwId, m_dwItemId ); } else { m_pPass->SetString( "" ); g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0025) ) ); // g_WndMng.OpenMessageBox( "숫자 4자리로만 넣어야 합니다. 다시 입력해주세요" ); } } else { m_pPass->SetString( "" ); g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0025) ) ); // g_WndMng.OpenMessageBox( "숫자 4자리로만 넣어야 합니다. 다시 입력해주세요" ); } } } else if( nID == WIDC_CHANGE_PASS ) { g_WndMng.m_pWndBankPassword = new CWndBankPassword; g_WndMng.m_pWndBankPassword->SetBankPassword( 1 ); g_WndMng.m_pWndBankPassword->Initialize( NULL, APP_BANK_PASSWORD ); Destroy(); } else if( nID == WIDC_CANCEL ) { Destroy(); } return CWndNeuz::OnChildNotify( message, nID, pLResult ); }
BOOL IsNative( LPCTSTR lpszStr ) { ASSERT( g_codePage != 0 ); LPCWSTR pwSrc = (LPCWSTR) lpszStr; if( g_codePage == 874 ) // 타이 { return (BYTE)*lpszStr >= 0xa1 && (BYTE)*lpszStr <= 0xfb; } else if( g_codePage == 949 ) // 한글 { return IsHangul( *pwSrc ); } else if( g_codePage == 932 ) // 일본 { return IsDBCSLeadByte( (BYTE)( *pwSrc ) ); } else if( g_codePage == 936 ) // 한자 : 중국 { return IsDBCSLeadByte( (BYTE)( *pwSrc ) ); } else if( g_codePage == 950 ) // 한자 : 대만 { // return IsDBCSLeadByte( *pwSrc ); if( ((BYTE)*lpszStr >= 0xCA && (BYTE)*lpszStr <= 0xFD) && ( (BYTE)*lpszStr+1 >= 0xA1 ) && ( (BYTE)*lpszStr+1 <= 0xFE) ) { return TRUE; } else if ( ( ( (BYTE)*lpszStr >= 0x41 ) && ( (BYTE)*lpszStr <= 0x5A ) ) || ( ( (BYTE)*lpszStr >= 0x61 ) && ( (BYTE)*lpszStr <= 0x7A) ) ) { return TRUE; } else if( isdigit2( (BYTE)*lpszStr ) ) return TRUE; } return FALSE; }
BOOL CWndBankPassword::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) { if( nID == WIDC_OK || message == EN_RETURN ) { CWndEdit *m_pLastPass = (CWndEdit*)GetDlgItem( WIDC_EDIT1 ); CWndEdit *m_pNewPass = (CWndEdit*)GetDlgItem( WIDC_EDIT2 ); CWndEdit *m_pConfirmPass = (CWndEdit*)GetDlgItem( WIDC_EDIT3 ); if( m_pLastPass && m_pNewPass && m_pConfirmPass ) { // 여기서 공백이 있는지 혹은 숫자이외의 것이 오는지 확인 char szLastPass[10] ={0,}; char szNewPass[10] ={0,}; char szConfirmPass[10] ={0,}; // strncpy( szLastPass, m_pLastPass->GetString(), 10 ); // strncpy( szNewPass, m_pNewPass->GetString(), 10 ); // strncpy( szConfirmPass, m_pConfirmPass->GetString(), 10 ); strcpy( szLastPass, m_pLastPass->GetString() ); strcpy( szNewPass, m_pNewPass->GetString() ); strcpy( szConfirmPass, m_pConfirmPass->GetString() ); if( strlen( szLastPass ) == 4 && strlen( szNewPass ) == 4 && strlen( szConfirmPass ) == 4) { if( 0 == strcmp( szNewPass, szConfirmPass ) ) { BOOL bDigit = TRUE; for( int i = 0 ; i < 4 ; i++ ) { if( (isdigit2( szLastPass[i] ) == FALSE) || (isdigit2( szNewPass[i] ) == FALSE) || (isdigit2( szConfirmPass[i] ) == FALSE) ) { bDigit = FALSE; break; } } if( bDigit ) { g_DPlay.SendChangeBankPass( szLastPass, szNewPass, m_dwId, m_dwItemId ); } else { if( m_nFlags == 0 ) { m_pLastPass->SetString( "0000" ); } else { m_pLastPass->SetString( "" ); } m_pNewPass->SetString( "" ); m_pConfirmPass->SetString( "" ); g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0025) ) ); // g_WndMng.OpenMessageBox( "숫자 4자리로만 넣어야 합니다. 다시 입력해주세요" ); } } else { m_pNewPass->SetString( "" ); m_pConfirmPass->SetString( "" ); g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0022) ) ); // g_WndMng.OpenMessageBox( "새암호와 암호확인이 다름니다. 다시 입력해주세요" ); } } else { if( m_nFlags == 0 ) { m_pLastPass->SetString( "0000" ); } else { m_pLastPass->SetString( "" ); } m_pNewPass->SetString( "" ); m_pConfirmPass->SetString( "" ); g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0025) ) ); // g_WndMng.OpenMessageBox( "숫자 4자리로만 넣어야 합니다. 다시 입력해주세요" ); } } } else if( nID == WIDC_CANCEL ) { Destroy(); } else if( m_nFlags == 0 && message == 0 && nID == WIDC_EDIT1 ) { CWndEdit *m_pNewPass = (CWndEdit*)GetDlgItem( WIDC_EDIT2 ); m_pNewPass->SetFocus(); } return CWndNeuz::OnChildNotify( message, nID, pLResult ); }