#include ja2xp::ProgressBar::ProgressBar(int size, int numElements) : iSIZE(size), num_elements(numElements), count(0) { empty_str.resize(iSIZE); for(int i=0; i(20,bar_end); for(int i=0; i < bar_end; ++i) { bar[i] = L'='; } std::vector infoZ(iSIZE+1); std::wstring str = message.c_wcs(); int start = std::min(iSIZE,(int)str.length()); wcsncpy(&infoZ[0],str.c_str(),start); memcpy(&infoZ[start],&empty_str[0],(iSIZE-start)*sizeof(wchar_t)); infoZ[iSIZE] = 0; wprintf(L"\r[%.20s] - %.54s", bar, &infoZ[0]); }