PostMessage Equivalent in .NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • romcab
    New Member
    • Sep 2007
    • 108

    PostMessage Equivalent in .NET

    Hello guys,

    I'm very new in .NET development and I was forced to learn it since my current project should used it. Anyway can you help me guys if you know the equivalent of PostMessage in .NET. Please give me an example code snippet.

    Thanks in advance.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Take a look at the "Message" class.
    It relates to the message pump you might be used to in c++ GUIs.
    (Although it's not that common to have to directly manipulate message pumps in .NET apps)

    Comment

    • romcab
      New Member
      • Sep 2007
      • 108

      #3
      Originally posted by Plater
      Take a look at the "Message" class.
      It relates to the message pump you might be used to in c++ GUIs.
      (Although it's not that common to have to directly manipulate message pumps in .NET apps)
      hi pal..

      Thanks for your help. I will take a look at that. Anyway, hope you can give a comment with this other Borland types.

      PostMessage
      GetMessage
      OpenEvent
      SetEvent
      CreateEvent
      WaitForSingleOb ject
      PostThreadMessa ge

      Thanks in advance.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        You don't have to micro-manage your GUI events through the messagepump anymore. There is an automated system (eventhandlers) to do them for you.

        If you want to see what I'm talking about, open up the designer and drag a button and a textbox onto your form.
        Double-click the button and it will automatically take you to a function it created to handle the button-click event. Anything you put in that function will be run when the button is clicked.
        Each control has a number of events you can assign too. The textbox will probably auto-create a "ontextchan ge" event for you.

        You can then choose to view the designer code from the project explorer, and see how it created it.
        (Something roughly like button1.Click += new ClickEvent(butt on1_click);)


        I think your last two where threading related?
        Find the "Thread" object and look at it's various properties

        Originally posted by romcab
        PostMessage
        GetMessage
        OpenEvent
        SetEvent
        CreateEvent
        WaitForSingleOb ject
        PostThreadMessa ge

        Comment

        Working...