Article # 197, added by Geoworks, historical record
| first | previous | index | next | last |

How do I get the thread handle of the UI thread?




Q. How do I get the handle of my application's ui thread? In other words,
   the thread that runs the application object and GenPrimary (as opposed
   to the system ui thread).

A. Use MemGetInfo on your ui block using MGIT_EXEC_THREAD. For instance,
   you could do something like the following:

     ThreadHandle uiThread;
     uiThread = MemGetInfo( OptrToHandle( @MyApplication ),
                            MGIT_EXEC_THREAD );

   This is assuming you've properly defined the resource containing the
   application object in your .gp file (i.e. have its resource set to
   ui-object).