|
|
|
|
@ -1366,8 +1366,19 @@ static void on_action_result(const char* text, void* user_data) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (IsWindow(app->hActionResultEdit)) { |
|
|
|
|
size_t tlen = strlen(text); |
|
|
|
|
char* crlf = (char*)malloc(tlen * 2 + 1); |
|
|
|
|
if (crlf) { |
|
|
|
|
size_t out = 0; |
|
|
|
|
for (size_t i = 0; i < tlen; i++) { |
|
|
|
|
if (text[i] == '\n') crlf[out++] = '\r'; |
|
|
|
|
crlf[out++] = text[i]; |
|
|
|
|
} |
|
|
|
|
crlf[out] = '\0'; |
|
|
|
|
SendMessageA(app->hActionResultEdit, EM_SETSEL, -1, -1); |
|
|
|
|
SendMessageA(app->hActionResultEdit, EM_REPLACESEL, FALSE, (LPARAM)text); |
|
|
|
|
SendMessageA(app->hActionResultEdit, EM_REPLACESEL, FALSE, (LPARAM)crlf); |
|
|
|
|
free(crlf); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int lines = (int)SendMessage(app->hActionResultEdit, EM_GETLINECOUNT, 0, 0); |
|
|
|
|
SendMessage(app->hActionResultEdit, EM_LINESCROLL, 0, lines); |
|
|
|
|
|