Re: [Mingw-users] WM_CREATE and taskbar entry
-----BEGIN PGP SIGNED MESSAGE-----
On 01/06/16 10:33, Max Cairns wrote:
> Hi; apologies if this isn't the gcc forum.
Well, it isn't a forum; it's a mailing list, but its focus is on the
use of the MinGW.org distribution of GCC, for applications development
> task bar entry for a program compiled using gcc under Windows 10.
> The standard Win 32 GUI skeleton on both CodeBlocks and DevC
> generates code which creates an entry in the taskbar while the
> program is running.
Don't be distracted by CodeBlocks, or DevC; they are irrelevant. This
is a fundamental feature of the Windows API itself.
> However, if I add something like this:
> case WM_CREATE: MessageBox(hwnd,"Hello","Test",MB_OK); break;
> to the WindowProcedure, then that entry into the task bar doesn't
> appear until after I press OK in the message box.
First a disclaimer: my expertise lies more in console application
development, or in core API development, than in GUI applications.
That said, I think this behaviour id kind of what I would expect.
See, you are interrupting the normal (main) window creation and
display process, by a modal procedure, which requires the user to
dismiss it, before the task bar button is created, (by the
ShowWindow() call from within WinMain()).
> The same is true if I do this:
> case WM_CREATE: SendMessage(hwnd,WM_COMMAND,(WPARAM)1234,0);
> break; case WM_COMMAND:
> and also if I put the SendMessage in WM_SHOWWINDOW rather than
Same thing here; you're introducing a modal procedure too early in the
main window initial display process.
> I have found a work-around - if I start a 1-sec timer in
> WM_CREATE, then use the WM_TIMER hit to do the SendMessage, all is
> well (so long you don't forget to kill the timer!).
Seems kludgey, and very ugly.
> But I thought I'd ask if I'm doing something invalid.
Let WinMain() complete the main window creation, and first
ShowWindow() call, then send your message to start your dialogue, just
before you start the message loop.
Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
-----END PGP SIGNATURE-----
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
MinGW-users mailing list
This list observes the Etiquette found at
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
You may change your MinGW Account Options or unsubscribe at: