title: Accessing Variable in Parent Form from OnTimer Event - Getting Exception
body: <p>I'm getting an exception in an OnTimer event handler (TTimer) that when executed increments an integer variable in the parent form.  The timers need to be able to access an incremented integer used as an id.</p>
  
  <p>My first question is: How can I tell in Delphi 2007 which code is running in which thread?  Is there a way in debug mode to inspect this so I can determine for sure?</p>
  
  <p>Secondly, if I need to access and modify variables in a parent form from another thread, what is the best way to do that?  It seems like sometimes Delphi allows me to access these variables "incorrectly" without giving an exception and other times it does give an exception.</p>