Hi all of you. From some time I struggle to start an MDI app in hidden mode (with an icon in system tray), but seem to appear an flicker in taskbar on application startup ...
By reading that, one can gain more knowledge about the while topic, thus having easiness in solving the probelem, an internet search about this topic even provides some helping code snippets,
By reading that, one can gain more knowledge about the while topic, thus having easiness in solving the probelem, an internet search about this topic even provides some helping code snippets,
That article references .net, whilst the question concerned c++.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
Has anyone did solved this task ? Can you help me ?
As you might understand to the moment, the trouble part is MFC standard behavior. In fact, you tried to bend what initially designed to be straight, and by no means this is a sort of common practice obliged to have a standard solution.
So, in case you need to get a real help with this, you have to provide here a simplistic project (or projects, as solution essence may depend on particular MFC version) that clearly demonstrates the issue.
Dealing with explicit code is going to be much more productive by not making us guess about what 'this task' really is and what you already tried to do with that.
Yes, I have made an test app (in VS2008), MDI, that reveal the behavior from the first post.
What I have tried by now ?
Code:
BOOL CTestApp::InitInstance()
{
.....
EnableLoadWindowPlacement(FALSE);
.....
m_nCmdShow = SW_HIDE;
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (! ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
started this test app, you will notice an flicker in taskbar (tested in Win10 64bit). The test app will automatically close after 3 seconds, in order to make easy to test it.
That is why, you can start multiple instances (in this way, you will spot the taskbar flicker very easy), and they will clean up their self.
So far I can see that Test.exe built as is with VS2012 runs with no flicker in Win 7 SP1. Will give it a try with VS2010, when I find a VM with the one. Sorry, have no Win10 at hand, and have no time to install that.
Last edited by Igor Vartanov; January 16th, 2018 at 04:04 AM.
So far I can see that Test.exe built as is with VS2012 runs with no flicker in Win 7 SP1. Will give it a try with VS2010, when I find a VM with the one.
Thank you Igor. I guess the flicker is present on Win10 as OS, rather than project VS. And this flicker are noticeable when you run the Test.exe on an not so fast PC, or, starting multiple instances from Windows Explorer (and they will automatically stop, one by one), by simply keeping Enter key on Test.exe ... in this way you easily see the taskbar flicker.
Okay, there is an update. 32-bit Test.exe built with VS2010 runs with no flicker in Win7 x64 SP1 (Aero Theme).
The same exe time to time (but rare) produces some flicker in a virtual machine running with extremely low resources (2 CPU cores, 2GB RAM) for Win7 x64 SP1 (Windows Classic scheme).
So it's hardly about OS version or VS version, but just hardware resources or window manager maybe.
Last edited by Igor Vartanov; January 16th, 2018 at 10:02 AM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.