Re: Is EnableWindow(HWND, BOOL) thread safe ?

Tech-Archive recommends: Speed Up your PC by fixing your registry



"Mike J" <notvalid@xxxxxxxxx> wrote in message
news:%23CxDp0EEGHA.3200@xxxxxxxxxxxxxxxxxxxxxxx
> Does these API block the thread ?
> ChildWindowFromPoint(HWND, POINT)
> IsWindowEnabled(HWND)

I don't know. My guess would have been 'no' for both but in scanning the
documentation for ChildWindowFromPoint(), there is a discussion of how it
treats transparent portions of a window. It may be that Windows is sending
WM_NCHITTEST messages to windows surrounding the point. If that's so, you
could block on a send. You might want to run Spy++.

> Suppose they are blocked, and I use PostMessage, but I still need to wait
> to get the state of the Window. Or let the HWND's thread manages its own
> state, and PostMessage back to the calling thread.

Check the docs for SendMessageCallback() to see if it would help you.

Just by the way, you might want to start a new thread in a UI group, e.g.

microsoft.public.win32.programmer.ui

with a question on what you want to do and not how to do. That is often a
way to get the best advice.

Regards,
Will




.



Relevant Pages

  • Re: Is EnableWindow(HWND, BOOL) thread safe ?
    ... Does these API block the thread? ... Suppose they are blocked, and I use PostMessage, but I still need to wait to ... get the state of the Window. ... > program deadlocks. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Is EnableWindow(HWND, BOOL) thread safe ?
    ... Mike J ... >> Does these API block the thread? ... > treats transparent portions of a window. ... and PostMessage back to the calling thread. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: MFC and Worker Thread issue
    ... situations such as the thread has terminated before the window was created but has no way ... CWnd* which is the message sink and it is created before the thread (with its HWND value) ... which does never see PostMessage or HWND. ... Callbacks add their own problems; I try to avoid them if at all possible. ...
    (microsoft.public.vc.mfc)
  • Re: Informing UI thread of target for sending messages?
    ... variable that was an invisible CWnd that could be the target of PostMessage. ... the target window you could easily change this so tht ...
    (microsoft.public.vc.mfc)
  • Re: Informing UI thread of target for sending messages?
    ... CWnd* pointer known to it. ... counter in the main thread and PostMessage works ... the target window you could easily change this so tht you create the ...
    (microsoft.public.vc.mfc)