Solved

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

Posted on 2007-11-26
6
711 Views
Last Modified: 2008-02-01
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 :-)
0
Comment
Question by:panJames
6 Comments
 
LVL 6

Assisted Solution

by:bokist
bokist earned 50 total points
ID: 20349237
try this solution

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

Open in new window

0
 

Author Comment

by:panJames
ID: 20349360
Application.OnMessage := AppMessage;

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

so we do not have Sender here...

panJames
0
 
LVL 28

Accepted Solution

by:
2266180 earned 400 total points
ID: 20349503
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Assisted Solution

by:dinilud
dinilud earned 50 total points
ID: 20350253
My suggestion is use bookist's code in OnTimer Event of the timer.
 
0
 
LVL 28

Expert Comment

by:2266180
ID: 20402328
and the B grade is because?
0
 
LVL 28

Expert Comment

by:2266180
ID: 20409615
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question