First, thanks for the response Will. I'll continue posting here as your
response dosn't make that seem objectionable and I see no one else posting
"off-topic" messages. The first thing that I attempted to do was just what
you suggested - I was searching in the MSDN documentation and came across
EnableWindow() but that was not working for me. Since this application is
not written in C so I was reluctant to discuss it too much but I guess I
described too little.
In my application I am launching a thread procudure and am then attempting
to change the enabled state of some controls on my main window (not a
dialog). I know that on windows the state of controls is not supposed to be
altered by a separate thread. In C# I have seen code that overcomes this
restriction but I cannot access C# code from Eiffel very easily - however I
can access C Windows API functions easily.
This is why I was hoping to use PostThreadMessage() as EnableWindow() is
doing nothing when called from my thread function. In Eiffel I do have
access to the handles (HWND) of the controls I am using.
Do you have any ideas on how I might overcome this?
Thanks again and regards
Chris Saunders
OK.
>What I wish to do is use PostThreadMessage() to send a message to a
control so that it will become enabled/disabled. Reading the
documentation
on WM_ENABLE leads me to believe that this message will not accomplish
this. Can anyone assist?
What you do is to pass the handle to the control to EnableWindow(). If you
don't have a handle to the control but you now its ID and the handle to
its parent, you call GetDlgItem() first whether or not the parent is a
dialog. That will get a handle which you can enable.
The message you found is a noticication that actually comes of changing
the enabled state of the window.
Regards,
Will
www.ivrforbeginners.com