Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubClassing a DateTime Picker

Status
Not open for further replies.

TimByrne

Programmer
Jan 23, 2002
3
US
Hi all.. I'm trying to set the date on a datetime picker on a non-Automation App.. I'm able to get the hwnd but i'm not able change the date.. here is the function i'm using

Public Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Public Function ChangeDate(ByVal lWinHandle As Long)
Dim lRtn As Long
Dim SysTime As SYSTEMTIME
Dim dtmDate As Date

dtmDate = Now()

With SysTime
.wYear = Year(dtmDate)
.wMonth = Month(dtmDate)
.wDay = Day(dtmDate)
End With

lRtn = SendMessage(lWinHandle, DTM_SETSYSTEMTIME, 0, SysTime)

ChangeDate = lRtn
End Function

With spy++ I can see where I send the DTM_SETSYSTEMTIME but nothing happens I always get a return value of 0. Does anyone have any ideas

Thanks
Tim
 
Alright Now I'm able to Set the color,font,format but i'm still not able to set the date or get the date.. does anybody have any ideas?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top