·  Start ·  Programme ·  Codes ·  Tipps ·  ActiveX ·  Tutorials · 



Für dieses Beispiel brauchen Sie ein Formular und eine Textbox sowie einen Timer.

Private Type POINTAPI
  X As Long
  Y As Long
End Type
 
Private Declare Function GetClassName _
Lib "user32" Alias "GetClassNameA" _
(ByVal hwnd As Long, ByVal lpClassName As String, _
ByVal nMaxCount As Long) As Long
 
Private Declare Function GetCursorPos _
Lib "user32" (lpPoint As POINTAPI) As Long
 
Private Declare Function WindowFromPoint _
Lib "user32" (ByVal xPoint As Long, _
ByVal yPoint As Long) As Long

Private Function FindeFenster()
 
    Dim pApi As POINTAPI
    Dim hWn As Long
    Dim KlassenName As String * 255
 
    GetCursorPos pApi
    hWn = WindowFromPoint(pApi.X, pApi.Y)
 
    GetClassName hWn, KlassenName, 255
 
    FindeFenster = KlassenName
 
End Function

Private Sub Form_Load()
     ' Timerintervall einstellen
    Timer1.Interval = 100
 End Sub

Private Sub Timer1_Timer()
   Text1.Text = FindeFenster()
End Sub
Aktualisiert: 12.02.2008, 14:10 Uhr Copyright © 2001 - 2010 by ST-software Navigation zurück  |  Navigation vorwärts  |  Zum Seitenanfang     
Ihre IP: 38.107.191.84 ·  Seite erstellt in: 0.669 Sekunden ·  Dateigröße:  2892 Bytes