dpaul007
asked on
Form loses focus when focus is inside embedded window
I have a form in which I have opened a Word document via the picturebox control using the SetParent API
m_hwnd = SetParent(m_hwnd2, Picture1.hWnd)
I have the document formatted how I like it. However, when I click on the document, the form loses focus. I have trying the SendMessage Function
SendMessage m_hwnd2, WS_CHILD, 0, 0
But it does not work. I have also tried replacing the m_hwnd2 with m_hwnd and the form still loses focus.
Am I missing something here?
m_hwnd = SetParent(m_hwnd2, Picture1.hWnd)
I have the document formatted how I like it. However, when I click on the document, the form loses focus. I have trying the SendMessage Function
SendMessage m_hwnd2, WS_CHILD, 0, 0
But it does not work. I have also tried replacing the m_hwnd2 with m_hwnd and the form still loses focus.
Am I missing something here?
ASKER
That worked except for the fact that it disabled the Word document so I couldn't use it. I tried to use the Activate command but to no avail.
Hi dpaul007,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:
Refund points and save as a 0-pt PAQ.
dpaul007, Please DO NOT accept THIS comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit. Explain why.
==========
DanRollins -- EE database cleanup volunteer
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:
Refund points and save as a 0-pt PAQ.
dpaul007, Please DO NOT accept THIS comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit. Explain why.
==========
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://support.microsoft.com/default.aspx?scid=KB;en-us;289498&
Best regards,
Valentina