Re: Something like "ping" for windows messages.






"Peter Smithson" <Peter_Smithson@xxxxxxxxxxx> wrote in message
news:1165575066.102790.117730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I'm pretty new to Windows messaging.

I want to measure how responsive my application is to messages. I
thought about doing a SetTimer(1000) and measuring how near to a 1
second interval the WM_TIMER message is processed. Then average it out
over 10 messages and log it.

Then I thought there might already be a tool that runs as an external
process and sends some standard message and measures how quick a
response is recieved. The equivalent of "ping" in network terms.

Is there such a thing?

Otherwise, I'll write a little app to send a message to my application.
Better that it's something external than built in to the application
(as I can re-use it and don't have to complicate the apps
configuration).


What do you want to achieve by it. It all depends upon if you window
procedure is busy at the time when you send the message. If its waiting in a
loop then it will receive the message immediately. Alternatively, if its
busy doing some task (some long computation), it will receive the message
until the task is complete. If you send the message using SendMessage and
the window is busy, your app(the one sending the message) would appear hung.
You can use PostMessage as well which will queue the message. You should
also look at using SendMessageTimeout.

I am not aware of a tool which does this as I dont know what exactly you
achieve by doing this.


--
Ajay Kalra [MVP - VC++]
ajaykalra@xxxxxxxxx


.



Relevant Pages

  • Re: Problems with CreateControlEx()
    ... the window is being created has 10 calls in it and none of them ... are in response to a window message. ... > a message handler for a message delivered via SendMessage. ...
    (microsoft.public.vc.atl)
  • Re: Floating Box for Prices
    ... The code to which you appear to be referring (judging by the fact that you included it at the head of your response) is the code I posted to show you how you should *not* perform the task of moving your window, which I posted in response to your question asking why you could not simply use the MouseMove event to control the added Form window. ... Your remarks were made by you in respect of the same block of code that your first remark referred to. ...
    (microsoft.public.vb.general.discussion)
  • Re: Yet another threading/invoking question...
    ... The WndProc is only called directly when the SendMessage thread is the same as the HWND owned thread (the one that created the window), otherwise the system switches to the owning thread and puts thye message into it's message queue where it will be picked-up by the right thread's WndProc. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: XP increased processor utilization
    ... ::SendMessage is a lot less efficient in XP SP2 than in Vista (and ... static HWND hWnd; ... on a single window, which is comparable to what the "excessive-mouse" guy ... XP SP2: 3.5% ...
    (microsoft.public.vc.mfc)
  • Re: Yet another threading/invoking question...
    ... Please correct me if I'm wrong, but AFAIK, SendMessage doesn't do any marshalling to the owner's thread, it sort of directly calls the window's WndProc. ... objects" associated with a Window Handle from another thread than the thread that owns the Handle. ... Well, almost, what Invoke/BeginInvoke does is using SendMessage or PostMessage to pass a "private user message" to the windows message queue and it puts a delegate in a private queue that will get fetched by the WndProc when it processes the "private user message". ...
    (microsoft.public.dotnet.languages.csharp)

Loading