-
Notifications
You must be signed in to change notification settings - Fork 156
Description
While working with the Month Calendar control in FreeBasic, I discovered that the MCN_GETDAYSTATE notification does not fire on modern Windows systems—even when the control is created with the MCS_DAYSTATE style.
After extensive debugging, I traced the issue to a mismatch in the value of MCN_GETDAYSTATE defined in FreeBasic’s headers.
The Problem:
FreeBasic currently defines:
const MCN_GETDAYSTATE = culng(MCN_FIRST + 3) ' Resolves to -743
However, on Windows Vista and later, the correct value is:
MCN_GETDAYSTATE = culng(MCN_FIRST - 1) ' Resolves to -747
This silent shift causes WM_NOTIFY handlers to miss the message entirely, even though the control is sending it.
To resolve this, I have needed to override the constant manually:
#undef MCN_GETDAYSTATE
#define MCN_GETDAYSTATE culng(-747)
Placing this after including commctrl.bi, the notification fires as expected and day state logic works properly.
I hope this bug is fixed so other users don't have any headaches.
Thanks in advance.