question about setting Stephan Lebans monthcalendar first day of week to monday

  • Thread starter Thread starter kelly d via AccessMonster.com
  • Start date Start date
K

kelly d via AccessMonster.com

I was doing a little reading on the subject which led me to an MSDN KB page
about MCM_SETFIRSTDAYOFWEEK, which led me to doing a little experimenting,
which led me to beleive (that is to say blindly hope) that this would work:

Call apiSendMessage(m_hWndDTP, MCM_SETFIRSTDAYOFWEEK, 0, 0)

I tried it in a couple of different places in the clsMonthCal module. it
didnt work (no big surprise). I'm just glad my monitor didnt explode and my
computer didnt sprout legs and run screaming from my house.
I have since undone everything I've done and clsMonthCal is in it's original
state. If anybody knows and could offer an opinion, how do I change the
MonthCalendar to have the first day of the week be Monday instead of Sunday.

Thanks
Kelly D.
 
Your best bet is probably to put it into the CreateDTPControl sub.

The actual call you want is

Call apiSendMessage(m_hWndDTP, MCM_SETFIRSTDAYOFWEEK, ByVal 0&, ByVal 0&)
 
sweet mary, it worked!
thank you very much.
it worked putting it where you said, it also worked putting it where I was
trying as well so the only difference was my values.
If I may impose one more small question in an attempt to make this greek look
a little more like english to me, whats the difference between my 0,0 and
your ByVal 0&, ByVal 0& ?

Thanks
 
APIs are very sensitive about variable types.

0& guarantees that you're passing a Long Integer, rather than an Integer or
Byte value.

ByVal passes the value, as opposed to an address where the value is stored.
This ensures that the routine doesn't try to change the value. (The opposite
is ByRef, which is the default way parameters are passed)
 
Back
Top