Hi, The best way to do this would be to use queues to communicate between the boss thread ( the thread running the GUI) and the worker thread (the one doing the data fetch).
It might sound complicated, but it is very straight forward. I haven't got the link handy, but there is a thread util package on Rob's home page that will do most of the work for you - I think it also contains a few examples. Cheers, Jez. > Hi, > > Most of Win32-GUI is thread safe, and you should be Ok using UserData as long as the var is itself shared. > > You will have problems sharing controls and windows between threads, but you should be ok with basic types. I want to put a thread to download some data continuously and assign it to UserData for the main window after each download, then the main window should print that data using the main thread. Could this be done this way? > An alternative approach is to use thread safe queues to handle communication/data sharing. Where can I read more about thread safe queues? Thank you. Teddy