1. Is it possible to make Static Texts just like a button
or is it only possible in the WM_PAINT structure?

1.2 If it is only possible in the WM_PAint sturcture, is there a way to renew the text without renewing the whole window?

2. How can you store the time in a string so that i can put the current time in a listbox?

3.How can you Take the first word of a sentence from a Single line edit box ?

4.How can you combine to strings ?

I hope someone can help

case you are wandering why i ask so many at the same time well it is because i have no internet at home only at school so i have alot of questions at the same time
Posted on 2003-02-03 06:37:30 by Bolle
Question 1:

You can draw text and any other graphics at any time the window is displayed.

The reason for doing most of it when handling the WM_PAINT message, is that a window must be repainted when it is resized (for example, made larger) or when portions of it are "uncovered". It is your application, not Windows, that knows the whole image of the client area. Windows will ask your app to draw new areas by sending the WM_PAINT message.
Posted on 2003-02-03 12:14:46 by tenkey
2. you can print some numbers in a buffer like this one:


.data
buffer db 32 dup(?)
string db "this is a numer: %d. and another: %d",0
n1 dd 256
n2 dd 2

.code
invoke wsprintf,addr buffer, addr string, n1, n2
; result: "this is a number: 256. and another: 2"


3.
get the text in a buffer and search for the first space, replacing it by a NULL


//yeah, there are better ways, but i don't know exactly which string function to use...
//created on the fly, never tested

lea esi, buf
scan_space:
lodsb
cmp al, 20h
je @f
test al,al
je break
jmp scan_space
@@:
mov byte ptr [esi-1],0
break:


4.
the masm32 package has the function strcat, which adds to a string another. there's also an api-function called lstrcat.



.data
s1 db "string1",0
db 32 dup(?)
s2 db "string2",0

.code
invoke lstrcat,addr s1,addr s2
; result in s1: "string1string2"
Posted on 2003-02-03 13:51:01 by hartyl