Results 1 to 4 of 4

Thread: Alerts

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    37
    I need my application to alert people when value a is greater than value b but i am unable to use sound. Is htere any way of getting the application to flash etc

    Thanks

  2. #2
    Guest
    To flash a window, use the FlashWindow api function:

    Code:
    Declare Function FlashWindow& Lib "user32" (ByVal hwnd As Long, _
    ByVal bInvert As Long)
    
    Declare Function FindWindow& Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String)
    
    Private Declare Sub Sleep Lib "kernel32" _
    (ByVal dwMilliseconds As Long)
    
    
    Private Sub Timer1_Timer()
         
         hWin = FindWindow(vbNullString, "Calculator")
         If hWin <> 0 Then
              hFlash = FlashWindow(hWin, 1)
              DoEvents
              Sleep (100)
         End If
    
    End Sub

  3. #3
    Guest
    Easiest way to have a sound is adding command Beep

    Other way is to use API but I'm not at home at the moment so I can't help with that now.

  4. #4
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    If you want your application to alert people, the best option is a MsgBox.
    Code:
    Call MsgBox("A > B", vbInformation, "Whee")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width