Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender

Forumthread: @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
Anzeige

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
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige