开发者

Opening WPF form from VB6 app always loses focus

I have a WPF DLL containing a few forms I'm trying to call from a VB6 app. I've got most of the interop figured out. I can open the forms fine and for the most part they work fine. They operate on their own and don't need to communicate with the VB6 app. The problem I'm running into is that when the WPF forms open the first time I hit tab, focus immediately jumos back to my VB6 app. It seems that the VB6 app still thinks it has focus and tries to do something with the tab key. I've been hackin开发者_开发百科g around for hours and nothing seems to work. Has anyone run into this and how can I get around it? Opening my WPF DLL from a WinForms app works fine.


Get the hWnd of the WPF form and set focus to it.

Use GetHandleFromPartialCaption and SetForegroundWindow

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜