// IDC_EDIT2에 값 출력
void DisplayText(char* first, ...)
{
HWND hWnd, h_Edit2;
va_list arg;
va_start( arg, first );
// 메인 윈도우로 부터 hwnd 핸들을 얻어온다.
CWnd *pWnd = AfxGetMainWnd();
hWnd = pWnd->m_hWnd;
char cbuf[256];
vsprintf( cbuf, first, arg );
h_Edit2 = GetDlgItem( hWnd, IDC_EDIT2 );
int nLength = GetWindowTextLength(h_Edit2);
SendMessage( h_Edit2, EM_SETSEL, nLength, nLength );
SendMessage( h_Edit2, EM_REPLACESEL, FALSE, (LPARAM)cbuf );
va_end( arg );
}
void DisplayText(char* first, ...)
{
HWND hWnd, h_Edit2;
va_list arg;
va_start( arg, first );
// 메인 윈도우로 부터 hwnd 핸들을 얻어온다.
CWnd *pWnd = AfxGetMainWnd();
hWnd = pWnd->m_hWnd;
char cbuf[256];
vsprintf( cbuf, first, arg );
h_Edit2 = GetDlgItem( hWnd, IDC_EDIT2 );
int nLength = GetWindowTextLength(h_Edit2);
SendMessage( h_Edit2, EM_SETSEL, nLength, nLength );
SendMessage( h_Edit2, EM_REPLACESEL, FALSE, (LPARAM)cbuf );
va_end( arg );
}
덧글을 달아 주세요