News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Having trouble with invalidate rect

Started by xandaz, October 03, 2009, 04:37:09 PM

Previous topic - Next topic

xandaz

    Hi again guys. I'm having trouble with invalidateRect function . It does't erase the rectangle. Both TRUE and FALSE values of the last parameter give about the same result: nothing happens. Can you give me a hand? 

the programming is something of the sort:

invoke GetClientRect,hStatic,addr rect
invoke InvalidateRect,hStatic,addr rect, TRUE / FALSE
invoke SendMessage,hStatic,WM_SETTEXT,NULL, addr MyText

Thanks for the help DednDave probabilly <---- the most helpful guy to have around

BlackVortex

InvalidateRect doesn't erase a rect, it just "invalidates" it, so windows is forced to repaint it.

Well, I hope I helped.    :toothy

MichaelW

If the goal is simply to change the text in the static control, you can do that by calling the SetWindowText function or by sending the control a WM_SETTEXT message, and in either case the control will take care of the necessary details.
eschew obfuscation

xandaz

   Hey guys.... its xandaz. I'd like to thank for the help, but i seem ti have gotten it. Apparentelly either the hStatic handle value returned by CreateWindowEx doesn't work or the InvalidateRect function must reffer NULL value for the Window handle. I did it like this and it works

invoke GetWindow,hStatic,GW_CHILD
mov  hWndNew,eax
invoke  GetClientRect,hStatic,addr rect
invoke  InvalidateRect,hWndNew,addr rect,TRUE

Thanks pplz :)

xandaz

   yeah Michael the goal was simply to change the text, but i know i need to send WM_SETTEXT message. What happens is that if the text i put there is shorter than the text that there was before i'll keep seeing parts of the old text. But it seems to be working now. thanks

:)