When I click the application shortcut, if the program is already open, I will show the program and enable FlashWindow. (FlashWindow(true);)
After blinking once, the taskbar is highlighted.
Theoretically, clicking on the application window would unhighlight the taskbar.
But it doesn't.
There is no problem when the window is minimized.
But it doesn't work when the window is already displayed.
I tried to get all the window handles of the application based on the process id and activated them one by one, but that didn't work either.
For this step I printed the log and used GetForegroundWindow to confirm that the change did happen.
How to solve this problem?
Is there any other way to make the taskbar blink only once without keeping it highlighted?
Related
I have a window in my mac app, and when I click on any control in it, the window moves. This only happens when the window is not activated (focused?). If the window is already the main window, it works fine.
What would cause this? I'm thinking I'm not returning some kind of 'handled' value so that the mouse event is getting passed back to the window's move routine, even though I am not over the move bar.
Thanks for any suggestions!
I need to activate a window that is possibly behind other windows, but the window should remain behind - it shouldn't be brought to front.
Is there a way to do that? I've tried SetWindowPos with various parameters, but no success so far.
Basically, I need to close a non-active window (by posting WM_SYSCOMMAND with SC_CLOSE), but that window may show a confirmation dialog before closing. If the dialog is shown, it needs to be brought to front, otherwise the window should stay behind.
I have other application's fullscreen direct-x window, which I need to hide. I found the way to hide it by hooking direct-x create device and changing window parameters so it is not fullscreen. This works ok on XP but on Win-7 I can't use any other application because it looks like application is switching it to be foreground window so all clicks and keyboard input goes to that window. However if I click fast I can make some action. This make me think that this app is using some function to direct input to itself, or to focus, dunno what.
The other thing is that if I resize the window and don't hide it, all works ok.
I tried to hook SetCapture, SetForegroundWindow, SetActiveWindow and SetWindowPos and none of this helped.
Do you have some idea how can I hide window in other way, or what can cause this focusing to invisible window?
I've uploaded a VS2010 project at the below location. This test app should be run once you have a full screen application running. As soon as its running, you have 2 seconds to click back on your fullscreen application. It creates 2 modeless dialog boxes using the full screen application (which should be the last window to have focus) as the owner of the dialog boxes. One dialog is displayed, hidden, the second dialog is displayed, hidden and then the first dialog is displayed again in a cycle. What I find is that when the first dialog box is displayed for the second time, the taskbar pops up. I've spent 4 painful days trying to understand whats going on here and I am desperate for some help.
I received some help which suggested that when I call DestroyWindow to hide the dialogs, Windows would put focus "somewhere" - and in my case the taskbar. Previously when I asked this question I wasn't using the full screen application as the Owner of my windows. I would have thought that the focus should go back to the owner window? I have also tried calling SetFocus() and SetForegroundWindow() on the full screen application prior to calling DestroyWindow on my dialog - but the seems to cause the taskbar to appear everytime and I don't want that at all.
Please help!
Sample VS2010 Project
My Cocoa app displays a transparent window on the screen, but when the user tries to take a screenshot using Mac OS X's built-in screen capture key with the option of selecting full windows (Command-Shift-4, then Space Bar), my window gets highlighted as part of the possible windows to capture.
How can I tell my Window or App not to allow this? My Window already refuses to be the Main Window or Key Window through -canBecomeKeyWindow and -canBecomeMainWindow both returning NO, but this still happens.
The Window is also at the NSModalPanelWindowLevel and NSScreenSaverWindowLevel does the same thing.
Notice that every window is eligible for screenshots, even the desktop, dock and menu bar, which are special windows. You can even take a screenshot of the Exposé overlay window itself. This leads me to believe that there is no way to do this.
I suppose you could hook the Command+Shift+4 key event and hide the window, but that key combo is user-definable, so it is subject to change.