In Windows 7 I can't get a window to be shown in foreground (Win32 API)
-
Hello ::- ). I've recently upgraded to Windows 7 and, naturally, some of my apps have run into a black, merciless wall of changed behaviors. One of the things which stopped working are my applications to bring stuff out of SysTray. Some applications don't have good methods to bring them out of SysTray via hotkey. Total Commander for example sometimes fails and you have to press Enter. So I made an application which worked fine on XP. But now, instead of bringing it back from SysTray and popping it in my face, it just blinks it on the Taskbar. Before you say "ForegroundLockTimeout", know that I already set this to 0 across the registry. What I'm trying to do is to make Total Commander come out from SysTray via a hotkey. The hotkey actually launches my C# application. In my C# application I do this:
int hwndTC = Win32API.FindWindow("TTOTAL_CMD", null); //Try to find the Total Commander window.
Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.Show);
Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.ShowMaximized);
Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.Maximize);
Win32API.SetForegroundWindow(hwndTC);But the result is that instead of TC showing itself in my face, I see it blinking on the TaskBar. One very strange thing is that when Visual Studio is running (and thus, the .vshost.exe is running), everything works fine. As soon as I shut down VS, the blinking stuff happens again.
I thank you for helping me... by contributing! Axonn @ SourceForge ^
-
Hello ::- ). I've recently upgraded to Windows 7 and, naturally, some of my apps have run into a black, merciless wall of changed behaviors. One of the things which stopped working are my applications to bring stuff out of SysTray. Some applications don't have good methods to bring them out of SysTray via hotkey. Total Commander for example sometimes fails and you have to press Enter. So I made an application which worked fine on XP. But now, instead of bringing it back from SysTray and popping it in my face, it just blinks it on the Taskbar. Before you say "ForegroundLockTimeout", know that I already set this to 0 across the registry. What I'm trying to do is to make Total Commander come out from SysTray via a hotkey. The hotkey actually launches my C# application. In my C# application I do this:
int hwndTC = Win32API.FindWindow("TTOTAL_CMD", null); //Try to find the Total Commander window.
Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.Show);
Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.ShowMaximized);
Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.Maximize);
Win32API.SetForegroundWindow(hwndTC);But the result is that instead of TC showing itself in my face, I see it blinking on the TaskBar. One very strange thing is that when Visual Studio is running (and thus, the .vshost.exe is running), everything works fine. As soon as I shut down VS, the blinking stuff happens again.
I thank you for helping me... by contributing! Axonn @ SourceForge ^
Anybody? ::- (
I thank you for helping me... by contributing! Axonn @ SourceForge ^