Web lists-archives.com

[Mingw-users] WM_CREATE and taskbar entry




Hi; apologies if this isn't the gcc forum. I've got a query about the 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. 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.
The same is true if I do this:

case WM_CREATE:
  SendMessage(hwnd,WM_COMMAND,(WPARAM)1234,0);
  break;
case WM_COMMAND:
  if(LOWORD(wParam)==1234)MessageBox(hwnd,"Hello","Test",MB_OK);
  break;

and also if I put the SendMessage in WM_SHOWWINDOW rather than WM_CREATE.

This wouldn't matter much if it was just a MessageBox that was being invoked at startup, but (for me) it's often a call to a dialog procedure; and without that task bar entry I can't (for instance) un-minimise the application or bring it to the front of the screen. FWIW, I have used use this technique with the Borland IDE without issue, so I suspect it's something in gcc?
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!). But I thought I'd ask if I'm doing something invalid.
Thanks
Max Cairns
maxcairns@xxxxxxxxxxxxxx
------------------------------------------------------------------------------
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
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
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:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe