If you are implementing a WinForms app, Control.BeginInvoke is the function
you want. It expects any delegate and an argument array. If you call it on a
control, and internally calls PostMessage with the control's HWND to ensure
that the control's thread will handle the event. The event handler on the
control's thread will the call the delegate with the arguments.
If you are not implementing a WinForms app, you may call PostMessage by just
including windows.h. The compiler will automatically generate a quite
interesting PInvoke function for you.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.