Solved

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

Posted on 2007-11-26
6
708 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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