Public Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Public Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Public Declare Function SetLayeredWindowAttributes Lib "user32" _ (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, _ ByVal dwFlags As Long) As Long Public Const GWL_EXSTYLE = (-20) Public Const WS_EX_LAYERED = &H80000 Public Const WS_EX_TRANSPARENT = &H20& Public Const LWA_ALPHA = &H2& Public Sub FlashAccessWindow() '================================================================== 'FlashAccessWindow() Version 1.0. '------------------------------------------------------------------ ' Author: © Copyright 2006 Pacific Database Pty Limited ' Graham R Seach gseach@pacificdb.com.au '------------------------------------------------------------------ ' Description: This function flashes the Access application window, ' by toggling its opacity between 255 & 128. ' ' Dependencies: Tested on Microsoft Access 2002/2003 only. ' ' Inputs: None. ' ' Outputs: None. '================================================================== Dim hWnd_MDI As Long Dim lOriginalStyle As Long Dim lCtr As Long Dim lSaturation As Long hWnd_MDI = Access.hWndAccessApp lOriginalStyle = GetWindowLong(hWnd_MDI, GWL_EXSTYLE) SetWindowLong hWnd_MDI, GWL_EXSTYLE, lOriginalStyle Or WS_EX_LAYERED lSaturation = 128 For lCtr = 1 To 10 If lSaturation = 128 Then lSaturation = 255 Else lSaturation = 128 SetLayeredWindowAttributes hWnd_MDI, 0, CByte(lSaturation), LWA_ALPHA DoEvents Sleep 500 Next lCtr SetLayeredWindowAttributes hWnd_MDI, 0, CByte(255), LWA_ALPHA SetWindowLong hWnd_MDI, GWL_EXSTYLE, lOriginalStyle End Sub