473,503 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to run message pump in .NET?

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
Nov 13 '05 #1
1 11503
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
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6888
by: Cantankerous Old Git | last post by:
I am trying to write a program that I hope to get working as a command-line app to start with, and then eventually use a windows service wrapper to call it as a service. Its purpose is to attach...
2
1397
by: Ken Williams | last post by:
Hi I have a DLL written in C/C++ that is passed Hwnd when it is called. When the DLL has data for the calling program it uses Hwnd to post a windows message back to the calling program saying it...
3
2830
by: Andrew Baker | last post by:
OK this has me perplexed, puzzled and bamboozled! I have a remoting service which I displayed a message box in. I then wondered what would happen if a client made a call to the service while the...
8
16317
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware...
6
20036
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
0
2424
by: | last post by:
Hi there movers & shakers, The example below demonstrates a behaviour that is anoying the tits off of me! It doesn't happen whilst debugging from the IDE only when you run the compiled exe from...
17
23660
by: nicolas.hilaire | last post by:
Hi all, i'm doing a quite long treatment in a function, and i'm showing the progress of the treatment with a progressbar. The code is something like this : for each(entry in entries) // about...
8
5240
by: Dave | last post by:
I am trying to write an event-driven application with no main window that runs "forever". It waits on a named event and then displays a window depending on data pased in a memory-mapped file. I...
2
1269
by: sean.j.forbes | last post by:
Is there an easy way to access the numer of messages queued (pending invocation) on the message pump? This doesn't have to be from code, maybe some application like Spy++ provides this...
0
989
by: cold80 | last post by:
I would like to understand more about how message pumps work in Windows applications, especially in .NET applications. Can you give me some good references? Above all I would like to know more...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.