AW: Fenster nach vorne
01.05.2006 15:09:37
Tassos
Servus Hugo,
Probier mal so: ( https://www.herber.de/bbs/user/33244.txt )
Public Declare
Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare
Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal _
cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare
Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Sub Foreground()
Dim Nr&, sPos, Vorher As Boolean
Nr = FindWindow("XLMAIN", vbNullString)
ShowIt = SetWindowPos(Nr, -1, 0, 0, 0, 0, 3)
ShowIt = ShowWindow(Nr, 3)
End Sub
Sub Background()
Dim Nr&, sPos, Vorher As Boolean
Nr = FindWindow("XLMAIN", vbNullString)
ShowIt = SetWindowPos(Nr, -2, 0, 0, 0, 0, 3)
ShowIt = ShowWindow(Nr, 3)
End Sub
Sub DeinButton()
Background 'Oder "Application.WindowState = xlMinimized"
End Sub
Mit "Foreground" hält sich das Excel-Fenster sichtbar im Vordergrund
und mit "Background" bekommt dieses wieder sein normales z-Order Verhältnis
Gruss
Tassos