Notify user after completion - FlashWindowEx (1 Viewer)

exangel7

New member
Local time
Today, 08:38
Joined
Apr 29, 2020
Messages
2
Hi,

I am searching for working solution to notify user after Access do some VBA, SQL runs in background. I tried using API FlashWindowEx with no action. Then tried more simply AppActivate without success.
Best way I think would be simple notify user by blinking Access icon. Not sure what to change to make this happens. If any other solutions works somewhere there gladly to try :)


Code:
Private Const FLASHW_STOP = 0 'Stop flashing. The system restores the window to its original state.
Private Const FLASHW_CAPTION = &H1 'Flash the window caption.
Private Const FLASHW_TRAY = &H2 'Flash the taskbar button.
Private Const FLASHW_ALL = (FLASHW_CAPTION Or FLASHW_TRAY) 'Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION Or FLASHW_TRAY flags.
Private Const FLASHW_TIMER = &H4 'Flash continuously, until the FLASHW_STOP flag is set.
Private Const FLASHW_TIMERNOFG = &HC 'Flash continuously until the window comes to the foreground.
 
Private Type FLASHWINFO
    cbSize As Long
    hWnd As Long
    dwFlags As Long
    uCount As Long
    dwTimeout As Long
End Type
 
Private Declare Function FlashWindowEx Lib "user32" (pfwi As FLASHWINFO) As Boolean



Public Sub NotificationFlashing()
Dim FlashInfo As FLASHWINFO

  With FlashInfo
      .cbSize = Len(FlashInfo)
      .dwFlags = FLASHW_ALL Or FLASHW_TIMER
      .dwTimeout = 0
      .hWnd = Screen.ActiveForm.hWnd
      .uCount = 0
  End With
  FlashWindowEx FlashInfo

End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:38
Joined
Oct 29, 2018
Messages
21,455
Hi. Welcome to AWF! Sorry I can't help you with APIs because I don't know them much. But if you don't mind interrupting the process in Access, maybe the "simplest" approach is to use a MsgBox. Just a thought...
 

isladogs

MVP / VIP
Local time
Today, 07:38
Joined
Jan 14, 2017
Messages
18,209
Hi @exangel7
There is no FlashWindow example as I've never heard of it till now. What exactly is it meant to do?
Can you give me a link to a working example?
If you need any help with the various methods used in the Attention Seek example app, feel free to ask questions
 

Users who are viewing this thread

Top Bottom