vc edit box printf

int my_wprintf(const TCHAR * fmt, ...)
{
    int ret;
    TCHAR MyPrintfBuf[4096];
    va_list args;

    va_start(args, fmt);
    ret = vswprintf(MyPrintfBuf, sizeof(MyPrintfBuf), fmt, args);
    va_end(args);
    if(ret > 0)
    {
        SendMessage(hShow, EM_SETSEL, -2, -1);  
        SendMessage(hShow, EM_REPLACESEL, 0, (LPARAM)MyPrintfBuf);
    }
    return ret;
}

你可能感兴趣的:(vc edit box printf)