1

Topic: SendMessage - how to learn about success/error?

Whether it is possible somehow the nobility, whether function SendMessage successfully, or with an error was fulfilled? While that invented the best - SendMessageTimeout in a cycle. In a cycle because INFINITE she does not understand (and  in the conditional week I do not want to put, and suddenly we in  led this week) SendNotifyMessage/SendMessageCallback do not approach, for it is necessary to replace available SendMessage, well that is to continue to wait handling.

2

Re: SendMessage - how to learn about success/error?

Hello, Alexander G, you wrote: whether AG> It is possible somehow the nobility, whether function SendMessage successfully, or with an error was fulfilled? AG> while that invented the best - SendMessageTimeout in a cycle. AG> in a cycle because INFINITE she does not understand (and  in the conditional week I do not want to put, and suddenly we in  led this week) AG> SendNotifyMessage/SendMessageCallback do not approach, for it is necessary to replace available SendMessage, well that is to continue to wait handling. As it is written in MSDN "The return value specifies the result of the message processing; it depends on the message sent", look here: https://msdn.microsoft.com/ru-ru/librar … p/ms644950 (v=vs.85).aspx, i.e. value of returned value defines result of handling of the message, it depends on the sent message. Whether that means "function SendMessage successfully, or with an error was fulfilled"? What did the message reach a window-addressee? Or something else?

3

Re: SendMessage - how to learn about success/error?

Hello, Nikita123, you wrote: N> As it is written in MSDN "The return value specifies the result of the message processing; it depends on the message sent", N> look here: https://msdn.microsoft.com/ru-ru/librar … p/ms644950 (v=vs.85).aspx, i.e. value of returned value N> defines result of handling of the message, it depends on the sent message. Whether N> that means "function SendMessage successfully, or with an error was fulfilled"? What did the message reach a window-addressee? Or something else? Yes, a question in, whether the message reached window procedure, or not. Not reach too can: windows are not present, DestroyWindow came earlier, out-of-memory the scenario, there are rights to send to this window (because of UAC elevation no target process), whether yes it is not enough still of that. Value specific to the message for many messages zero, therefore it looks indistinguishably from a situation when the message is not reached.

4

Re: SendMessage - how to learn about success/error?

Hello, Alexander G, you wrote: AG> Yes, a question in, whether the message reached window procedure, or not. AG> not reach too can: windows are not present, DestroyWindow came earlier, out-of-memory the scenario, there are rights to send to this window (because of UAC elevation no target process), whether yes it is not enough still of that. AG> value Specific to the message for many messages zero, therefore it looks indistinguishably from a situation when the message is not reached. And SendMessageTimeout unless rescues from all aforesaid? Bad, but 100 % decision: to implement huk/make changeover of the output agent for a window and inside to track that the message reached.

5

Re: SendMessage - how to learn about success/error?

Hello, CEMb, you wrote: CEM> And SendMessageTimeout unless rescues from all aforesaid? Well, I so hope, though did not check all cases. It returns result specific to the message through parameter lpdwResult, and its own result - If the function succeeds, the return value is nonzero.

6

Re: SendMessage - how to learn about success/error?

Hello, Alexander G, you wrote: whether AG> It is possible somehow the nobility, whether function SendMessage successfully, or with an error was fulfilled? In caused code InSendMessage () does not approach?

7

Re: SendMessage - how to learn about success/error?

Hello, Dead Down, you wrote: > In caused code InSendMessage () does not approach? To changing speech the output agent. If to change, to supervise obtaining not too difficult. And InSendMessage, similar not for this purpose. Determines whether the current window procedure is processing a message that was sent from another thread that is, those SendMessage which are degenerated in a window procedure call, here, probably, do not get.

8

Re: SendMessage - how to learn about success/error?

Hello, Alexander G, you wrote: CEM>> And SendMessageTimeout unless rescues from all aforesaid? AG> well, I so hope, though did not check all cases. It returns result specific to the message through parameter lpdwResult, and its own result - AG> AG> If the function succeeds, the return value is nonzero. Better, likely, in source codes to look, as the moment when the message left in the window handler there is marked. But generally it is in queue, the success considers GetMessage/PeekMessage, it is necessary to look in their code. Still I here thought, returned result from SendMessage will was mandatory a hit sign in the handler as it depends that the output agent solved. I.e. in the description of many messages it is written, if you processed, return And if is not present, return B.

9

Re: SendMessage - how to learn about success/error?

Hello, CEMb, you wrote: CEM> Still I here thought, returned result from SendMessage will was mandatory a hit sign in the handler as it depends that the output agent solved. I.e. in the description of many messages it is written, if you processed, return And if is not present, return B.Est such moment, yes. But me the fact the fact of a call of window procedure with this message interests. (We admit, I am assured that by a window procedure call the interesting output agent will inevitably be fulfilled). All right, not so it is necessary to climb in source codes, and to rely on the behavior studied thus. I will stretch an obtaining sign in message parameter.