How to run message pump in .NET?

J

Jianxin

Hi, all,

Can I run message pump in C# to yield cotrol to other
window messages while my main thread is waiting for
lengthy procesing to finish?

In C++, PeekMessage(), TranslateMessage(), and
DispatchMessage() will do the job. For some reason, this
seems not working in managed C++.

Any suggestions?

Thanks in advance.

Jianxin
 
W

Willy Denoyette [MVP]

Simple, spawn a new thread to run your "lengthy processing", a UI thread shouldn't do anything else than handle the UI.

Willy.

Jianxin wrote:
|| Hi, all,
||
|| Can I run message pump in C# to yield cotrol to other
|| window messages while my main thread is waiting for
|| lengthy procesing to finish?
||
|| In C++, PeekMessage(), TranslateMessage(), and
|| DispatchMessage() will do the job. For some reason, this
|| seems not working in managed C++.
||
|| Any suggestions?
||
|| Thanks in advance.
||
|| Jianxin
 

Ask a Question

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.

Ask a Question

Top