I've been facing the following problem :
When SendIpcMessage gets called from a window procedure, I get a stack overflow if I specify bHandleMessages = TRUE on Windows 8.
SendIpcMessage calls GetMetroPath which itself calls PeekMessage / TranslateMessage / DispatchMessage. The window procedure then gets called again with the same message, SendIpcMessage gets called again, etc...
Setting bHandleMessages = FALSE fixes the problem, but it's not always great to do so... is there any way to detect whether we are inside a window procedure already ?
SendIpcMessage and windows messages
Re: SendIpcMessage and windows messages
What does "When SendIpcMessage gets called from a window procedure" mean exactly? Does it mean that you send every single message that arrives at a certain window procedure via IPC?
One solution would be to use a TLS (thread local storage) variable to store whether you're alright "inside" of SendIpcMessage. If you are, don't call it again.
One solution would be to use a TLS (thread local storage) variable to store whether you're alright "inside" of SendIpcMessage. If you are, don't call it again.
Re: SendIpcMessage and windows messages
Hooked application's window message handler calls some API I have hooked. In my hook callback I call SendIpcMessage.
Re: SendIpcMessage and windows messages
Hmmmm... In any case, TLS should help.