NO

Author Topic: WINAPI32 - How renew, refresh text in Edit (controls) after initialization? (+)  (Read 4452 times)

socia

  • Guest
WINAPI32 - How renew, refresh text in Edit (controls) after initialization?

I initializate Edit with text.

After i need alter this text on new. But when i use function
Edit_SetText it`s not redraw text in Edit window. After i add functions
SetWindowRedraw and ShowWindow, but that not help so too. What functions needed using for worked text definition(renew, refresh) in Edit(controls) window?

Thanks for answer.

Socia. socia@tut.by
« Last Edit: April 29, 2010, 04:34:44 AM by socia »

Offline DMac

  • Member
  • *
  • Posts: 272
Try this handy macro.
Code: [Select]
#define Refresh(hwnd) RedrawWindow((hwnd), NULL, NULL, \
    RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW)

Use it as follows:

Code: [Select]
Edit_SetText(hwndCtl,"Refresh Me");
Refresh(hwndCtl);
No one cares how much you know,
until they know how much you care.

socia

  • Guest
Thanks.

But i find in Pelles C includes and not "see" that method in headers defenition PellesC\Include *.h

If possible - How apply(include) this method (compiler error :
POLINK: error: Unresolved external symbol '_Refresh'.
POLINK: fatal error: 1 unresolved external(s).)

Thanks.

Socia.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
You must use that 1.st macro what DMac gives.

This might help too:
Code: [Select]
InvalidateRect(hwndCtl, NULL, TRUE);
« Last Edit: April 29, 2010, 07:06:33 PM by timovjl »
May the source be with you

socia

  • Guest
Thanks, all worked.

It`s a i not understand what was be need.

So too thanks for full quotes, i so true not alerty(attentionely) read - more speedly.

Thanks.

Socia.