?
Solved

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

Posted on 2007-11-26
6
Medium Priority
?
719 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

718 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