how to find the source of a Windows message
-
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.
-
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.
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
-
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.
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!"
-
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.
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
-
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