Application.Run() problem



2 Questions:

(1)
The documentation says application.run() creates a standard
message loop on the current thread and "optionally" shows a
form. This is really confusing because I was of the understanding
that application.run() creates a message loop for the form and
passes all messages to it.
If showing the form is optional, and I want to to display 2 forms,
which form will application.run() pass the windows messages to?

(2)
I believe there is an internal WndProc() function internally maintained
and exposed through events in C#?
When I inherit from a base class (say System.Control) and my derived
class being Form, the paint event is "inherited from Control" right, so
my Form should have its own paint event right.
But then I've read a book that said OnPaint() of Control is responsible
for calling the registered event handlers, but how can it call event
handlers that derived classes have registered? Isn't that the job of
the OnPaint() method of the derived class (in this case form).



Thanks a lot,
Warm Regards,

Joel.

.



Relevant Pages

  • Re: Message Loops and Application.Run()
    ... >> what kind of messages would you like to send to the message loop without ... >> window? ... thread, instantiate the control. ... and vice-versa be wrapped in Invoke or BeginInvoke statements. ...
    (microsoft.public.dotnet.framework)
  • Re: threading questions
    ... Could the new thread just then update a control on the frmMain, as the thread was created from frmMain or is the invoke stuff still required? ... correctly without the message loop. ... and call a function in my startup form. ... I would avoid creating the frmComms form on the worker thread. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Modal dialog box question
    ... >Isn't there a way to take control of the message loop of the dialog, ... > filter the events that I want to the main application? ... How is the user to know which menu commands can ...
    (microsoft.public.vc.mfc)
  • Re: Keep UI working without COM object being started
    ... >>> UI or the IStream and is controlled via a semaphore ... >>> a MsgWaitForMultipleObjects that will start a message pump (that ... >>> the normal message loop so everything works fine (if UI has control ...
    (microsoft.public.win32.programmer.ole)
  • Re: Control.BeginInvoke is NOT fire-and-forget
    ... Creating a dummy Control instance simply for the purpose of ... marshalling execution back to some thread seems very odd to me. ... Control has. ... async calls with the UI message loop? ...
    (microsoft.public.dotnet.languages.csharp)