TTimer sends WM_TIMER message, how can I find out which TTimer sent it?

My application crashes.

I used:
Application.OnMessage := AppMessage;

and found out that the last message is  WM_TIMER.
Now I try to figure out which TTimer sent it.
Any ideas how to get it?

Thank u very much

panJames :-)
panJamesAsked:
Who is Participating?
 
2266180Connect With a Mentor Commented:
http://msdn2.microsoft.com/en-US/library/ms644902.aspx

wParam
[in] Specifies the timer identifier.

keep a list of timer identifiers (like a hash list) which will tell you which timer object is the sender.

without seeing any of your code to see what and how you are using, I cannot tell you exactly what to do. but the above suggestion is the way to go.
0
 
bokistConnect With a Mentor Commented:
try this solution

   if (Sender is TTimer) then
       Showmessage((Sender as TTimer).Name);

Open in new window

0
 
panJamesAuthor Commented:
Application.OnMessage := AppMessage;

AppMessage(var Msg: TMsg; var Handled: Boolean);

so we do not have Sender here...

panJames
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
diniludConnect With a Mentor Commented:
My suggestion is use bookist's code in OnTimer Event of the timer.
 
0
 
2266180Commented:
and the B grade is because?
0
 
2266180Commented:
ok. have it your way. you are the 10th person to make on my blacklist. which means that I will ignore your every question from now on and forever.

do the same with other experts that follow my policy and you will soon find yourself with little to no experts to answer your questions.

no need to reply as I unsubscribed from this questions.

enjoy.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.