Private
Declare
PtrSafe
Function
GetWindowTextA
Lib
"user32"
_
(
ByVal
hWnd
As
LongPtr,
ByVal
lpString
As
String
,
ByVal
nMaxCount
As
Long
)
As
Long
Private
Declare
PtrSafe
Function
GetActiveWindow
Lib
"user32"
()
As
LongPtr
Private
Declare
PtrSafe
Function
GetForegroundWindow
Lib
"user32"
()
As
LongPtr
Public
Function
Speicher_unter_warten()
As
String
Dim
strLCData
As
String
Dim
lngSize
As
Long
lngSize = 255
strLCData =
String
(lngSize, vbNullChar)
t = Timer
Do
GetWindowTextA GetForegroundWindow, strLCData, lngSize
apiWindowText = Replace(strLCData, vbNullChar,
""
)
If
InStr(apiWindowText,
"Speichern unter"
)
Then
Exit
Do
Loop
Until
(t + 120) < Timer
End
Function