PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

ActiveX control - how to get Window handle?

I'm integrating a GapiDraw application into an ActiveX control for the PocketPC. I have a worker thread that's supposed to update the control periodically. However, only the user interface thread is allowed to access the screen. I'm now trying to send a message from the worker thread using PostMessage. How can I get the HWND of the control???
ray wrote:I'm integrating a GapiDraw application into an ActiveX control for the PocketPC. I have a worker thread that's supposed to update the control periodically. However, only the user interface thread is allowed to access the screen. I'm now trying to send a message from the worker thread using PostMessage. How can I get the HWND of the control???


Dont know if this will work for sure -

getfocus api returns a hwnd to the window/child window with focus.

Give your control focus - then use getfocus api to get the hwnd of the control.
Thanks, I was able to solve the problem already - its simple, since there is actually a GetWindowDC method :oops: