Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2007-11-26
6
Medium Priority
?
720 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 150 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 1200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 10

Assisted Solution

by:dinilud
dinilud earned 150 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

916 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