Hi

I have a problem with 'clearing' this control:

.ELSEIF eax==5
invoke SetDlgItemText,hWnd,4,NULL ; clear control
...
...
.ENDIF

This works with edit conctrols, but not with static controls (i tried clear static, but ofcourse not work) . What is a solution?

Thank you

stanks
Posted on 2001-08-18 11:36:30 by stanks
If you do this it should work:

.data

szNull db 0

.code

invoke SetDlgItemText,hWnd,4,addr szNull ; clear control
Posted on 2001-08-18 15:04:41 by KetilO
Hi KetilO

I tried, but result is same.
Posted on 2001-08-18 16:42:13 by stanks
iirc, you can't.
static controls can't be altered after they are created.


but i might be wrong :grin:
Posted on 2001-08-18 17:54:46 by fresh
hm.. it works for me. are you sure your control id is correct?
Posted on 2001-08-18 17:58:45 by Sloat
try to see if the static ID is not equal to -1 that what is by default, when creatin' it with resource editor, because it can be altered,
so try to modify this value and give it a >0 value, to see.

hope it works, luck
Posted on 2001-08-18 19:49:41 by Black Horus

hm.. it works for me. are you sure your control id is correct?

Hi Sloat

My control ID is correct
Posted on 2001-08-19 01:47:47 by stanks

try to see if the static ID is not equal to -1 that what is by default, when creatin' it with resource editor, because it can be altered,
so try to modify this value and give it a >0 value, to see.

hope it works, luck

Hi Black Horus

I create this static control with CreateWindow API, not with resource editor, so the ID is 4, not -1, and the return value of SetDlgItemText is not 0.

greetings
Posted on 2001-08-19 01:49:22 by stanks
Can you resize the containing window?
If you can, minimize and restore the window. If you get the new string, that means you need to redraw the window (or just the control) to see the effects.
Posted on 2001-08-20 16:22:47 by tank
I'm not sure if I understood.
If this is all about how to change text on static text control
(and also how to set empty string) - here is a very simple example
Posted on 2001-08-21 04:54:57 by The Svin
kewl, I'll use that in the program I'm creating.
Posted on 2001-08-21 22:19:38 by eet_1024
Here is example
Posted on 2003-08-11 10:04:09 by The Svin
You may want to try to create your static control as a READ_ONLY edit control without the WS_BORDER. It will look as a static control but it's probably easier to modify its content.

Raymond
Posted on 2003-08-11 10:44:37 by Raymond
Well, I don't understand the problem,
in the demo it's seen that 0 string can be set without any problem and any special way outs.
Posted on 2003-08-11 12:52:28 by The Svin