message loop and threads

  • Thread starter Thread starter Sankar Nemani
  • Start date Start date
S

Sankar Nemani

Hi,
When I start a new message loop using
System.Windows.Forms.Application.Run, does it create a new
thread and execute the loop on that thread? If it does,
why does the main thread stops execution until the message
loop ends? Where can I get more information on how
messageloops work?
TIA
Sankar
 
Hello Sankar,

Thanks for your post. As I understand, you want to know whether
System.Windows.Forms.Application.Run will create a new thread. Please
correct me if there is any misunderstanding. I now share the following
infomration with you:

According to the MSDN documentation, System.Windows.Forms.Application.Run()
begins running a standard application message loop on the current thread.
That is, it does not create a new thread.

Application.Run Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformsapplicationclassruntopic.asp

For detailed information on Message Loops, I strongly recommend you the
following MSDN article:

Aboug Messages and Message Queues
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI
/WindowsUserInterface/Windowing/MessagesandMessageQueues/AboutMessagesandMes
sageQueues.asp

Please feel free to let me know if you have any problems or concerns.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top