PDA

View Full Version : Raise program from tray when clipboard intercept.



jmj
15th August 2010, 11:54
I start my program in background and it intercept clipboard, and when it do it main window should apear. So, I use hide() and show(). But my program only apears on task bar (with orange colour under XP). And I can't find way to show window. My program window is show favlesly when I use right mouse menu on tray icon (with the same function show()). In perfect scenario main window of my program should apear with out focus (which should remain in previous application). I have many programs which shows various smal windows when some events ocurs (so I think it is feasible).
So: How to raise program from tray with out direct user action?

The Storm
15th August 2010, 12:18
Basically you can't. Windows have a protection for such random focus taking. The best thing you can do is to use some custom window flags like Qt::ToolTip and some styles to show the window like a active tooltip(similar like chat messengers display custom tooltips above the task bar). You can keep it visible as long as you wish. Anyway you still will not have the focus but in this way you will make it easier for the user to click on that window. :)

pfid
27th December 2010, 14:38
Basically you can't. Windows have a protection for such random focus taking. The best thing you can do is to use some custom window flags like Qt::ToolTip and some styles to show the window like a active tooltip(similar like chat messengers display custom tooltips above the task bar). You can keep it visible as long as you wish. Anyway you still will not have the focus but in this way you will make it easier for the user to click on that window. :)

At least some messengers can open new windows (=chats) when you receive a message. Also, jdownloader opens dialogs with full input focus when the program is minimized. So there must be at least a way to open a new window (be it mainwindow- or dialog-derived) when the program itself is not visible.

i'm wondering what one had to do achieve this?