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. Managed C++/CLI
  4. Get Message

Get Message

Scheduled Pinned Locked Moved Managed C++/CLI
c++tutorial
6 Posts 4 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.
  • D Offline
    D Offline
    dSolariuM
    wrote on last edited by
    #1

    hi how to get message from other window such as OnMessage in Mfc

    Every new thing you learn,Gives you a new personality.

    M D K 3 Replies Last reply
    0
    • D dSolariuM

      hi how to get message from other window such as OnMessage in Mfc

      Every new thing you learn,Gives you a new personality.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      In a form?  If so, maybe override WndProc(). Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      1 Reply Last reply
      0
      • D dSolariuM

        hi how to get message from other window such as OnMessage in Mfc

        Every new thing you learn,Gives you a new personality.

        D Offline
        D Offline
        dSolariuM
        wrote on last edited by
        #3

        in Mfc #define WM_MESSAGE WM_USER+1000 ON_MESSAGE(WM_MESSAGE,Function) but i don't know how to create in vc.net

        Every new thing you learn,Gives you a new personality.

        L M 2 Replies Last reply
        0
        • D dSolariuM

          in Mfc #define WM_MESSAGE WM_USER+1000 ON_MESSAGE(WM_MESSAGE,Function) but i don't know how to create in vc.net

          Every new thing you learn,Gives you a new personality.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          As Mark said, override WndProc() to react on specific messages. Here is a C# example:

          protected override void WndProc(ref Message m) {
          if (m.Msg==LPWIN_Constants.WM_HOTKEY) {
          int lParam=(int)m.LParam;
          if (lParam==0x00580003) Activate(); // CTRL+ALT+X
          if (lParam==0x00410008) ArchiveWindow(); // WIN+A
          }

          :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


          1 Reply Last reply
          0
          • D dSolariuM

            in Mfc #define WM_MESSAGE WM_USER+1000 ON_MESSAGE(WM_MESSAGE,Function) but i don't know how to create in vc.net

            Every new thing you learn,Gives you a new personality.

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            There's also sample code in four languages in the Control.WndProc() documentation[^] Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            1 Reply Last reply
            0
            • D dSolariuM

              hi how to get message from other window such as OnMessage in Mfc

              Every new thing you learn,Gives you a new personality.

              K Offline
              K Offline
              Kuldeep Bhatnagar
              wrote on last edited by
              #6

              Using Events is also another option for notifying another window.

              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