Please enable JavaScript to view this site.

A-Shell Development History

The calendar control, when positioned on top of another control in the same window, allows the control underneath to "bleed" through (both visually and when processing mouse clicks). (This is just a Windows quirk of that control.) The normal way to avoid such problems with it is to not position on top of another control (seems reasonable), or, if you insist, then first enclose it in a separate dialog. However, if neither of those options is desirable, yet another possibility is to remove the child flag from the control, so that it acts like a top-level popup or overlapped window. To do so, add the WS_VISIBLE flag, and optionally, the WS_POPUP flags in the dwStyle parameter. (e.g. DWSTYLE = WS_CAPTION + WS_SYSMENU + WS_VISIBLE). This essentially turns the calendar control into its own dialog, which has its own downsides (affecting the positioning and also making it difficult to use in conjunction with another control to receive the date clicked on), but for cases where you just want to have a floating calendar handy, this may be an easier technique than manually creating your own modeless dialog to house the calendar control.

Note: the reason why adding WS_VISIBLE remotes the child flag (WS_CHILD) is that if neither WS_VISIBLE nor WS_CHILD are specified, both are turned on by default. Turning on the visible flag explicitly removes the default.