Windows Message Loop in .NET and C#

Is it possible to communicate with a .NET application by getting its windows handle and passing a value to it using PostMessage or SendMessage?

Does anyone have an example of the C# code that would handle a PostMessage call?
purplesoupAsked:
Who is Participating?
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontrolclasswndproctopic.asp
   
    protected override void WndProc(ref Message m)
    {
        if (m.Msg==WM_XXX) { // trap your msg
            //do something in here...
        }
        base.WndProc(ref m);
    }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.