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 / C++ / MFC
  4. how to find the source of a Windows message

how to find the source of a Windows message

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabasehelptutoriallounge
5 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.
  • E Offline
    E Offline
    Elsie
    wrote on last edited by
    #1

    Hi .I am getting a WM_PAINT message for a window. How can I find out where is the source of the WM_PAINT? But from my regular code flow it is not being called. The window is not being invalidated manually / in code. Debugging didnt help. Is getmessageextrainfo() the solution? In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.

    H R L 3 Replies Last reply
    0
    • E Elsie

      Hi .I am getting a WM_PAINT message for a window. How can I find out where is the source of the WM_PAINT? But from my regular code flow it is not being called. The window is not being invalidated manually / in code. Debugging didnt help. Is getmessageextrainfo() the solution? In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.

      H Offline
      H Offline
      Hans Dietrich
      wrote on last edited by
      #2

      Elsie wrote:

      How can I find out where is the source of the WM_PAINT?

      From MSDN: "The WM_PAINT message is generated by the system ..."

      Elsie wrote:

      is there a mechanism to find the function/trigger which is the source

      No.

      Best wishes, Hans


      [Hans Dietrich Software]

      L 1 Reply Last reply
      0
      • E Elsie

        Hi .I am getting a WM_PAINT message for a window. How can I find out where is the source of the WM_PAINT? But from my regular code flow it is not being called. The window is not being invalidated manually / in code. Debugging didnt help. Is getmessageextrainfo() the solution? In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.

        R Offline
        R Offline
        rp_suman
        wrote on last edited by
        #3

        Not sure its possible but, Spy++ gives you a graphical view of the system’s processes, threads, windows, and window messages. Using Call Stack[^] you can view the function or procedure calls that are currently on the stack but not the source of windows messages.

        -- "Programming is an art that fights back!"

        1 Reply Last reply
        0
        • E Elsie

          Hi .I am getting a WM_PAINT message for a window. How can I find out where is the source of the WM_PAINT? But from my regular code flow it is not being called. The window is not being invalidated manually / in code. Debugging didnt help. Is getmessageextrainfo() the solution? In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Elsie wrote:

          In general for any WIndows messages is there a mechanism to find the function/ trigger which is the source of the messages.

          There are no documented methods to determine the source of a window message. However the InSendMessageEx Function[^] can be used to determine if your window is currently processing a message from SendMessage. Anyway... your application needs to handle WM_PAINT as the system generates it. If you have Vista Aero/Glass enabled then your application may recieve a greater number of WM_PAINT messages and your window update region is not completely under your control. Best Wishes, -David Delaune

          1 Reply Last reply
          0
          • H Hans Dietrich

            Elsie wrote:

            How can I find out where is the source of the WM_PAINT?

            From MSDN: "The WM_PAINT message is generated by the system ..."

            Elsie wrote:

            is there a mechanism to find the function/trigger which is the source

            No.

            Best wishes, Hans


            [Hans Dietrich Software]

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Wrong. Of course you can get the source..

            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