MCPcopy Create free account
hub / github.com/lxn/walk / setSystemTime

Method setSystemTime

dateedit.go:120–137  ·  view source on GitHub ↗
(st *win.SYSTEMTIME)

Source from the content-addressed store, hash-verified

118}
119
120func (de *DateEdit) setSystemTime(st *win.SYSTEMTIME) error {
121 var wParam uintptr
122
123 if st != nil {
124 wParam = win.GDT_VALID
125 } else {
126 // Ensure today's date is displayed.
127 de.setSystemTime(de.timeToSystemTime(time.Now()))
128
129 wParam = win.GDT_NONE
130 }
131
132 if 0 == de.SendMessage(win.DTM_SETSYSTEMTIME, wParam, uintptr(unsafe.Pointer(st))) {
133 return newError("SendMessage(DTM_SETSYSTEMTIME)")
134 }
135
136 return nil
137}
138
139func (de *DateEdit) timeOfDayDisplayed() bool {
140 return strings.ContainsAny(de.format, "Hhms")

Callers 2

SetDateMethod · 0.95
newDateEditFunction · 0.80

Calls 3

timeToSystemTimeMethod · 0.95
newErrorFunction · 0.85
SendMessageMethod · 0.65

Tested by

no test coverage detected