Since 98/2k, SetForegroundWindow doesn't necessarily make
your window the foreground window, if your process is not the
foreground process. This is of course done so programs don't mess
around with the user.

Now, I was thinking about removing my hhlookup program from the
task list (ie, no alt+tab), but make it activate with a hotkey instead,
as I feel that would be more usable. But how can I guarantee that
the hotkey always sets my app foreground?

PlatformSDK says

Windows 98/Me, Windows 2000/XP: The system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:
(bla bla)
The process received the last input event.
(bla bla)

Is a hotkey event considerent an input event? I guess this would
answer my question...
Posted on 2001-12-02 00:31:24 by f0dder
Yep, seems like a hotkey is treated as an input event (quite logical
really), so SetForegroundWindow works like a charm. And adding
WS_EX_TOOLWINDOW to my window style hid the app from the
taskbar. Now this toy is finally starting to become useful :).
Posted on 2001-12-02 00:42:01 by f0dder
Is it just me... Or is f0dder mumbling to himself? :grin:

Posted on 2001-12-02 00:56:38 by NaN
I am, NaN. They forgot to give me my medication :grin:
Posted on 2001-12-02 11:06:57 by f0dder