views:

128

answers:

0

I have a WPF application that has some functionality that is very closely related to Launchy - i.e., someone presses Ctrl+Space and they receive a search bar.

This functionality should be available throughout the system, and I have used the ManagedAPI.Hotkey code to make this work - and it does.

The problem is that when the search window appears, I can't always give it focus. And by always, I mean, the bar always shows up, but only sometimes does it have the focus.

On the times it doesn't have the focus, if I click into it, remove it, and try it again, I get the focus on subsequent events if the focus remains in that window.

So, for example, let's I'm browsing with Chrome and hit Ctrl+Space. My Launchy like banner shows up and I won't have focus. I'll then click on it, close it off, do some more browsing, hit Ctrl+Space again and it will work.

I'm at a loss as to what could be causing this random behavior.

Any suggestions would be greatly appreciated.