Pelles C forum

C language => Windows questions => Topic started by: socia on April 29, 2010, 04:19:19 AM

Title: WINAPI32 - How renew, refresh text in Edit (controls) after initialization? (+)
Post by: socia on April 29, 2010, 04:19:19 AM
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
Title: Re: WINAPI32 - How renew, refresh text in Edit (controls) after initialization? (+)
Post by: DMac on April 29, 2010, 06:01:17 PM
Try this handy macro.
#define Refresh(hwnd) RedrawWindow((hwnd), NULL, NULL, \
    RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW)


Use it as follows:

Edit_SetText(hwndCtl,"Refresh Me");
Refresh(hwndCtl);

Title: Re: WINAPI32 - How renew, refresh text in Edit (controls) after initialization? (+)
Post by: socia on April 29, 2010, 07:00:21 PM
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.
Title: Re: WINAPI32 - How renew, refresh text in Edit (controls) after initialization? (+)
Post by: TimoVJL on April 29, 2010, 07:03:08 PM
You must use that 1.st macro what DMac gives.

This might help too:
InvalidateRect(hwndCtl, NULL, TRUE);
Title: Re: WINAPI32 - How renew, refresh text in Edit (controls) after initialization? (+)
Post by: socia on May 06, 2010, 12:13:14 AM
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.