func (mi *monitorInternal) getDefaultMonitor() { mi.handle = C.MonitorFromRect(nil, C.MONITOR_DEFAULTTOPRIMARY) info := (*C.MONITORINFO)(unsafe.Pointer(&mi.info)) info.cbSize = C.MONITORINFOEXW_size C.__GetMonitorInfoW(mi.handle, &mi.info) }
func (mi *monitorInternal) isValid() bool { if mi.handle == nil { return false } info := (*C.MONITORINFO)(unsafe.Pointer(&mi.info)) info.cbSize = C.MONITORINFOEXW_size return C.__GetMonitorInfoW(mi.handle, &mi.info) != 0 }