Pages: 1 [2]
|
 |
|
Author
|
Topic: WM_PAINT & InvalidateRect (Read 17769 times)
|
Antariy
|
If use: invoke RedrawWindow,hStatic,addr rect,0,RDW_ERASE or RDW_INVALIDATE or RDW_UPDATENOW ; UPDATENOW instead
This should force repainting.
|
|
|
Logged
|
|
|
|
hotrod
Guest
|
It appears that you are using a static and trying to clear the text. If so, use an empty string: MyString equ "",0
invoke SendMessage,hStatic,WM_SETTEXT,NULL,addr MyString
|
|
|
Logged
|
|
|
|
xandaz
http://morethangeeks.orgfree.com
Member
    
Gender: 
Posts: 543
I'm me again.
|
It crossed my mind hotrod but clearing it seems more better. thanks antariy.
|
|
|
Logged
|
|
|
|
xandaz
http://morethangeeks.orgfree.com
Member
    
Gender: 
Posts: 543
I'm me again.
|
oh yeah btw. It clears the area if i use NULL for window handle when using invalidaterect, but, the whole screen gets updated or something. It's strange.
|
|
|
Logged
|
|
|
|
xandaz
http://morethangeeks.orgfree.com
Member
    
Gender: 
Posts: 543
I'm me again.
|
Not working antariy..Anyone else want to give it a try? Thanks for th helpingness.
|
|
|
Logged
|
|
|
|
Antariy
|
oh yeah btw. It clears the area if i use NULL for window handle when using invalidaterect, but, the whole screen gets updated or something. It's strange.
NULL (0) is a handle of desktop - i.e. entire screen. You are repainting all screen then. My suggestions is followed your code. But you can set new text to static without manual redrawing of it. If you do not use special styles like transparency - this will work fine. So, instead of: .code ... invoke GetClientRect,hStatic,addr rect invoke RedrawWindow,hStatic,addr rect,0,RDW_ERASE or RDW_INVALIDATE or RDW_ERASENOW ; <--- THIS invoke SendMessage,hStatic,WM_SETTEXT,NULL,addr MyString
Just: .code ... invoke SendMessage,hStatic,WM_SETTEXT,NULL,addr MyString
|
|
|
Logged
|
|
|
|
xandaz
http://morethangeeks.orgfree.com
Member
    
Gender: 
Posts: 543
I'm me again.
|
There's no transparency i think, and dont get me wrong cause i appreciate the help. The thing is that i'm going to display the current directory. if the previous string is longer than the current it will show parts of the previous. Thanks
|
|
|
Logged
|
|
|
|
hotrod
Guest
|
xandaz, you are trying to clear a control by using graphics and I don't think you are not going to be able to isolate the static from the rest of the window. The other possibility is to DrawText on the window and not use a static. You can then clear it with a rectangle.
|
|
|
Logged
|
|
|
|
xandaz
http://morethangeeks.orgfree.com
Member
    
Gender: 
Posts: 543
I'm me again.
|
Your answer seems satisfying enough. i quit. ill use a string.
|
|
|
Logged
|
|
|
|
|
Pages: 1 [2]
|
|
|
 |