G
G
German2019-01-16 23:50:06
C++ / C#
German, 2019-01-16 23:50:06

How to update the text displayed by TextOut on WinAPI?

I am writing an application on WinAPI, I need to display text depending on the variable, initially it is empty and the text "Waiting" is displayed, the button is pressed and the image is selected, filePath becomes non-empty and now I need to display the text "Waiting for image", but how?

..
switch (message)
  {
  case WM_PAINT:
    hdc = BeginPaint(hWnd, &ps);
    if(!filePath)
      TextOut(hdc, 160, 20, L"Ожидание изображения", 21);
    else
      TextOut(hdc, 170, 20, L"Обработка", 10);
    break;
...
//тут WM_COMMAND в зависимости от которого меняется filePath

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-01-17
@jcmvbkbc

Now we need to display the text 'Waiting for image', but how?

You need to erase the rectangle in which the text is located and say that it needs to be redrawn. See
InvalidateRect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question