Greets.
> Hi, did anyone even get this message? or did nobody know the solution :(
> i sent it a little while ago:
> ---------------------------------------
I don't remember getting it.
> Hi, I have a problem concerning timers in windows.
> I am using only win32 API, and i use the fuction:
>
> SetTimer(hwnd,id,len*100,NULL);
> //hwnd is the HWND of the window, id is a UINT, len is a UINT
>
> to set a timer that will later send a WM_TIMER message to my WindowProc.
In
> my WindowProc i have code like this:
>
> case WM_TIMER:
> {
> myclass->blah();
> return 0;
> }
> //myclass is a pointer to an object with a function called blah
>
> and the function blah sets bool thebool to the value false.
>
> in the function that calls SetTimer, i later have the code:
>
> thebool = true;
> while(thebool)
> {
> MessageBox(hwnd,"WAITING","ERROR",MB_OK); //this gets deleted
> }
>
> when i run the program, the messagebox comes up a number of times until
> len*100 milliseconds has passed, then it resumes normal operation.
> The problem is, i do not want to have to put up this messagebox. So i
delete
> the code for it. Once i do this, it seems the WM_TIMER message is never
sent
> for some reason. even if a put a messagebox in the case WM_TIMER: section,
> it is never shown, unless i keep the messagbox in the while loop.
> what is the meaning of this?
> how am i using the timer wrongly?
> thanks in advance
> ramana
> ps i also tried putting WaitMessage(); in the while loop instead, but it
has
> no effect.
I recall having this problem... I don't rememeber exactly how I resolved it.
Try setting up your window and showing it using ShowWindow() or something.
Maybe messages are sent only once the window is created and shown. This
would explain the MessageBox() thingy making it start working.
_________________________________________________________
Abhijit Shylanath
E-mail: mu...@gm... || ibr...@bi...
Web-site: http://mudeth.tripod.com/
|