Public Function FlashTitleBarColor() Dim i As Integer Dim lret As Long Dim SaveColor As Long Dim lIndices(0 To 0) As Long Dim lNewColors(0 To 0) As Long ' Get and save current color SaveColor = GetSysColor(COLOR_ACTIVECAPTION) Debug.Print "Current color:" & Hex(SaveColor) For i = 1 To 5 ' Change to red lIndices(0) = COLOR_ACTIVECAPTION lNewColors(0) = &HFF lret = SetSysColors(1&, lIndices(0), lNewColors(0)) If lret = 0 Then RaiseApiError Err.LastDllError End If Delay 0.5 ' Restore original color lIndices(0) = COLOR_ACTIVECAPTION lNewColors(0) = SaveColor lret = SetSysColors(1&, lIndices(0), lNewColors(0)) If lret = 0 Then RaiseApiError Err.LastDllError End If Delay 0.5 Next End Function |