The MASM Forum Archive 2004 to 2012
Welcome, Guest. Please login or register.
September 16, 2019, 03:19:14 PM

Login with username, password and session length
Search:     Advanced search
128553 Posts in 15254 Topics by 684 Members
Latest Member: mottt
* Home Help Search Login Register
+  The MASM Forum Archive 2004 to 2012
|-+  General Forums
| |-+  The Workshop
| | |-+  WM_PAINT & InvalidateRect
« previous next »
Pages: 1 [2] Print
Author Topic: WM_PAINT & InvalidateRect  (Read 11166 times)
Antariy
Member
*****
Gender: Male
Posts: 1041


Re: WM_PAINT & InvalidateRect
« Reply #15 on: November 20, 2010, 12:21:09 AM »

If use:
Code:
invoke RedrawWindow,hStatic,addr rect,0,RDW_ERASE or RDW_INVALIDATE or RDW_UPDATENOW ; UPDATENOW instead

This should force repainting.
Logged
hotrod
Guest


Email
Re: WM_PAINT & InvalidateRect
« Reply #16 on: November 20, 2010, 12:31:46 AM »

It appears that you are using a static and trying to clear the text. If so, use an empty string:
Quote
MyString equ "",0

invoke SendMessage,hStatic,WM_SETTEXT,NULL,addr MyString
Logged
xandaz
http://morethangeeks.orgfree.com
Member
*****
Gender: Male
Posts: 543


I'm me again.


Re: WM_PAINT & InvalidateRect
« Reply #17 on: November 20, 2010, 12:35:11 AM »

   It crossed my mind hotrod but clearing it seems more better. thanks antariy.
Logged

xandaz
http://morethangeeks.orgfree.com
Member
*****
Gender: Male
Posts: 543


I'm me again.


Re: WM_PAINT & InvalidateRect
« Reply #18 on: November 20, 2010, 12:36:36 AM »

   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: Male
Posts: 543


I'm me again.


Re: WM_PAINT & InvalidateRect
« Reply #19 on: November 20, 2010, 12:38:16 AM »

   Not working antariy..Anyone else want to give it a try?
   Thanks for th helpingness.
Logged

Antariy
Member
*****
Gender: Male
Posts: 1041


Re: WM_PAINT & InvalidateRect
« Reply #20 on: November 20, 2010, 12:40:48 AM »

   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:
.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:
.code
...
invoke SendMessage,hStatic,WM_SETTEXT,NULL,addr MyString
Logged
xandaz
http://morethangeeks.orgfree.com
Member
*****
Gender: Male
Posts: 543


I'm me again.


Re: WM_PAINT & InvalidateRect
« Reply #21 on: November 20, 2010, 12:49:34 AM »

  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


Email
Re: WM_PAINT & InvalidateRect
« Reply #22 on: November 20, 2010, 12:50:51 AM »

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: Male
Posts: 543


I'm me again.


Re: WM_PAINT & InvalidateRect
« Reply #23 on: November 20, 2010, 01:31:33 AM »

   Your answer seems satisfying enough. i quit. ill use a string.

Logged

Pages: 1 [2] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum Archive 2004 to 2012 | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!