jjacksn
asked on
Hidding the window for a tray app (overriding so alt-tab doesn't work properly)
I have a tray app that has a window and I do not want it to be alt-tabbable.
It doesn't show up in the alt-tab window right now unless the user is using a full screen program
1. why does it show up doing a full screen program?
2. What is the best thing to override to not allow alt-tab to work properly (just capture WM_MAXIMIZE in WndProc?) and leave the window minimized.
It doesn't show up in the alt-tab window right now unless the user is using a full screen program
1. why does it show up doing a full screen program?
2. What is the best thing to override to not allow alt-tab to work properly (just capture WM_MAXIMIZE in WndProc?) and leave the window minimized.
This window should be visible? you can simply hide it(ShowWindow with SW_HIDE command).
ASKER
This window is never visible. Another window shows as a popup, but not the main window. I use the SW_HIDE command, and that works fine when a window is not if full screen mode. By fine I mean it isn't in the alt-tab window.
However, when a window is full screen, you can alt-tab to it.
However, when a window is full screen, you can alt-tab to it.
>This window is never visible.
...
>However, when a window is full screen, you can alt-tab to it
You mean above the window of another application is full screen? When you say "Full screen" you mean maximized or like screensavers(no taskbar, toolbars and may be grafic mode changed).
...
>However, when a window is full screen, you can alt-tab to it
You mean above the window of another application is full screen? When you say "Full screen" you mean maximized or like screensavers(no taskbar, toolbars and may be grafic mode changed).
I think you can use this.Hide() on Deactivate event of main form. This possibly will help
ASKER
I mean like when you are playing a dvd or something like that, so it goes into complete full screen mode. then you can see my app in the alt-tab window. others, it works fine.
So your main window is hidden and it's popup is in fullscreen mode, did I understand you right?
How do you create full-screen popup window? can you provide here simple sample. I'd like to see such behavior you describe.
How do you create full-screen popup window? can you provide here simple sample. I'd like to see such behavior you describe.
ASKER
Roman, create an app that has no taskbar and call this.Hide(). You will not be able to see in alt-tab. Then play a DVD in full screen mode. when you alt-tab, you can see it.
This happened because the window active(focused) now. When you hiding it you also should move focus to another window(May be to desktop or next window in alt-tab list). Also you may try WS_TRANSPARENT|WS_TOPMOST style, then your window will not grab focus and also will be visible over all other windows.
ASKER
Roman, it is never active to begin with though... so I don't quite understand what you are saying?
It becomes active when you press alt-tab because it next window to your DVD player.
ASKER
It doesn't become active, it simply is shown in the alt-tab window and one COULD select it. However, if a window is not in full-screen mode, then you can't see my application icon in the alt-tab window.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
??
This code doesn't hide the main app, I can get through it via alt-tab, and I can't see an icon get loaded into the tray. Is this the right code?
This code doesn't hide the main app, I can get through it via alt-tab, and I can't see an icon get loaded into the tray. Is this the right code?
yes. It was compiled with VS.net 2003 and works fine.
When you minimize window it hides and shows icon in tray, click on show menu item in task bar you'll get it back.
When you minimize window it hides and shows icon in tray, click on show menu item in task bar you'll get it back.
ASKER
I can still alt tab to it.
Did you find the problem? now the code I posted before works? You found better solution?
ASKER
Roamin, as I said, I can still alt-tab to the screen in your code (which I don't want to be able to do)