Bringing a window to the foreground from Win32 DLL
Posted on 1999-07-04
I have installed a keyboard hook thru Win32 DLL.
My application that uses the hook is based on SDI FormView.
I am sending a WM_SETTEXT message from the Hook Filter function to one of the edit controls in the formview.
I pass the Edit control's window handle as well as the the mainframe window handle to the dll when I install the hook for the first time.
Now the problem is, if my application's frame window has the focus, the message from the dll is processed.
If some other application has the focus this message is not
processed. I used the SetForeGroundWindow and ShowWindow
APIs before sending the message but failed.
It seems that that once the application looses the input focus, the Handles I pass as parameters becomes NULL.
How to bring an application to the foreground and also how to popup a hidden window from a Win32 DLL?