Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1236to1240
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

@NoNet - Lotus Notes Fenster aktivieren

@NoNet - Lotus Notes Fenster aktivieren
Bertram
Hallo NoNet,
habe eben erst deinen Beitrag gesehen (besser spät als nie :-))
https://www.herber.de/forum/archiv/1236to1240/t1237258.htm#1237515
Hab grad kein LN da, aber das sollte funktionieren:
ACHTUNG: Das Fenster von Lotus Notes muss mit dem vollständigen und identischen Namen aufgerufen werden!!!
Option Explicit
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long
Private Declare Function GetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
Private Declare Function SetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
Const SW_SHOWMAXIMIZED = 3
Const SW_SHOWMINIMIZED = 2
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type WINDOWPLACEMENT
Length As Long
flags As Long
showCmd As Long
ptMinPosition As POINTAPI
ptMaxPosition As POINTAPI
rcNormalPosition As RECT
End Type
Sub LotusAktivieren()
Dim xhWnd&
xhWnd = FindWindow(vbNullString, "Hier der Name deines Fensters") 'Fenster finden mit GENAU dem Titel
ActivateWindow (xhWnd)
End Sub
Private Function ActivateWindow(xhWnd&) As Boolean
Dim Result&, WndPlcmt As WINDOWPLACEMENT
With WndPlcmt
.Length = Len(WndPlcmt)
Result = GetWindowPlacement(xhWnd, WndPlcmt)
If Result Then
If .showCmd = SW_SHOWMINIMIZED Then
.flags = 0
.showCmd = SW_SHOWMAXIMIZED
Result = SetWindowPlacement(xhWnd, WndPlcmt)
Else
Call SetForegroundWindow(xhWnd)
Result = BringWindowToTop(xhWnd)
End If
If Result Then ActivateWindow = True
End If
End With
End Function

Gruß
Bertram

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Benutzer
Anzeige
Danke, werde es morgen mal ausprobieren :-) _oT
22.11.2011 19:46:01
NoNet
_oT = "ohne Text"
Sag bitte bescheid ob's klappt oT
22.11.2011 19:47:01
Bertram
Ausprobiert (Codes vereint) : Klappt PRIMA
23.11.2011 14:37:21
NoNet
Danke Bertram,
habe die Codes vereint und es klappt PRIMA !
Die Codezeile Private Declare Function FindWindowEx ... benötigt man dazu m.E. übrigens nicht - ich habe sie mir erspart ;-))
Salut, NoNet
Anzeige

132 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige