| |  | Online-Kurs: Grundlagen des 3D-Druck-Designs für Industrieingenieure , ein Kurs
|
Autor
|
Thema: mehrere Applikationen? (1342 mal gelesen)
|
san Mitglied Maschinentechniker

 Beiträge: 66 Registriert: 22.11.2002
|
erstellt am: 18. Mai. 2004 13:27 <-- editieren / zitieren --> Unities abgeben:         
|
startrek Mitglied Architekt
   
 Beiträge: 1361 Registriert: 13.02.2003 .
|
erstellt am: 21. Mai. 2004 13:25 <-- editieren / zitieren --> Unities abgeben:          Nur für san
Hi san, hatte zwar ein andres Prob, hab' aber dadurch zufällig & netterweise s.u. Code bekommen, vielleicht hilfts ja zu was. Die auskommentierte Zeile war nur Geteste von mir  lg Nancy --
Code:
Option Explicit Private Declare Function GetWindow Lib "user32" (ByVal Hwnd As Long, ByVal wCmd As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal Hwnd As Long, ByVal wIndx As Long) As Long Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal Hwnd As Long) As Long Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal Hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Const GW_HWNDFIRST = 0 Const GW_HWNDNEXT = 2 Const GWL_STYLE = -16 Const WS_VISIBLE = &H10000000 Const WS_BORDER = &H800000Public Sub GetWindowList() Dim Hwnd As Long, sTitle As String, lStyle As Long, lngZeile As Long Hwnd = GetWindow(FindWindow(vbNullString, vbNullString), GW_HWNDFIRST) Do lStyle = GetWindowLong(Hwnd, GWL_STYLE) And (WS_VISIBLE Or WS_BORDER) sTitle = GetWindowTitle(Hwnd) If (lStyle = (WS_VISIBLE Or WS_BORDER)) = True And Trim(sTitle) <> "" Then 'If Trim(sTitle) <> "" Then 'so sinds halt paar mehr ;;-)) Debug.Print sTitle End If Hwnd = GetWindow(Hwnd, GW_HWNDNEXT) Loop Until Hwnd = 0 End Sub Private Function GetWindowTitle(ByVal Hwnd As Long) As String Dim lResult As Long, sTemp As String lResult = GetWindowTextLength(Hwnd) + 1 sTemp = Space(lResult) lResult = GetWindowText(Hwnd, sTemp, lResult) GetWindowTitle = Left(sTemp, Len(sTemp) - 1) End Function
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
| Anzeige.:
Anzeige: (Infos zum Werbeplatz >>)
 |