I had a little trouble with getting a timer to work but with some help from the community i got one working. However take a look at the code below and maybe someone could tell me if this is bad programing practice. Notice that hwnd and hWnd are different because SetTimer is invoked right after UpdateWindow and KillTimer is invoked in the decision loop. It works ok and i need the timer until the window is destroyed.


INVOKE UpdateWindow, hwnd
invoke SetTimer,hwnd,idtimer,50,NULL

invoke KillTimer,hWnd,idtimer
invoke PostQuitMessage,NULL:alright:
Posted on 2001-08-26 17:58:24 by titan
Is there a reason that SetTimer is not in WM_CREATE?
Posted on 2001-08-26 18:04:30 by bitRAKE
I did it just before i checked your reply.

However the documentation states thet if you process the WM_CREATE message you should return 0
Maybe they mean if you use a creation structure(newbie here)

Returning -1 should destroy the window

It didn't when i tried.

Any thoughts on that.

Posted on 2001-08-26 18:47:38 by titan
yes, you can do a SetTimer within WM_CREATE and before the next ".ELSEIF uMsg == WM_whatever" do a return 0 or the equivalent (mov eax, 0 ret). KillTimer can go in WM_CLOSE.

dr phil :)
Posted on 2001-08-26 19:33:49 by phil