Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. messages

messages

Scheduled Pinned Locked Moved C#
csharpc++tutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    W_B
    wrote on last edited by
    #1

    I have a DLL, this export some functions and one of them starts a new thread. from this thread my Program recieve some userdefined messages. in C++ everything ist OK, but I have to supply the functionality of this DLL for a C# App. And I don't know how to catch the messages from the thread.... If I look with Spy++ to the Form, it recive them, but I have no idea how to handle them....

    J 1 Reply Last reply
    0
    • W W_B

      I have a DLL, this export some functions and one of them starts a new thread. from this thread my Program recieve some userdefined messages. in C++ everything ist OK, but I have to supply the functionality of this DLL for a C# App. And I don't know how to catch the messages from the thread.... If I look with Spy++ to the Form, it recive them, but I have no idea how to handle them....

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      To get the messages you can override the WndProc method on your Control/UserControl/Form.

      protected override void WndProc( ref Message m ) {
      switch(m.Msg) {
      case MY_CUSTOM_MSG:
      // do stuff with the msg
      // LPARAM = m.LParam
      // WPARAM = m.WParam
      // Place any result value in m.Result
      break;
      default:
      base.WndProc(m);
      break;
      }
      }

      That should be the basic look of it. HTH, James Sonork ID: 100.11138 - Hasaki "Smile your little smile, take some tea with me awhile. And every day we'll turn another page. Behind our glass we'll sit and look at our ever-open book, One brown mouse sitting in a cage." "One Brown Mouse" from Heavy Horses, Jethro Tull 1978

      W 1 Reply Last reply
      0
      • J James T Johnson

        To get the messages you can override the WndProc method on your Control/UserControl/Form.

        protected override void WndProc( ref Message m ) {
        switch(m.Msg) {
        case MY_CUSTOM_MSG:
        // do stuff with the msg
        // LPARAM = m.LParam
        // WPARAM = m.WParam
        // Place any result value in m.Result
        break;
        default:
        base.WndProc(m);
        break;
        }
        }

        That should be the basic look of it. HTH, James Sonork ID: 100.11138 - Hasaki "Smile your little smile, take some tea with me awhile. And every day we'll turn another page. Behind our glass we'll sit and look at our ever-open book, One brown mouse sitting in a cage." "One Brown Mouse" from Heavy Horses, Jethro Tull 1978

        W Offline
        W Offline
        W_B
        wrote on last edited by
        #3

        :-D thank you!! now i get the messages.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups