Benutzerformular transparent darstellen
Es gibt auch unter VBA Anwendungsfälle, in denen das Fensterhandle (hWnd
) eines Benutzerformulars (UserForm
) benötigt wird. So lässt sich z.B. auch in VBA eine UserForm transparent darstellen.
Zur Ermittlung des Fensterhandles kann die API-Funktion FindWindow
verwendet werden.
#If Win64 Then Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long #Else Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long #End If
Listing 2.14 Deklaration der API-Funktion FindWindow
Tabelle 2.8 Parameter der API-Funktion FindWindow
Parameter | Bedeutung | Ein-/Ausgabe ... |
---|
Get Microsoft Word Programmierung - Das Handbuch (Buch + E-Book). Für Word 2007 - 2013 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.