Zum Inhalt springen

Empfohlene Beiträge

Geschrieben

Hi!

Ich möchte ein Formular subclassen, in etwa so:

Option Explicit


Private Declare Function SetWindowLong Lib "user32" _

        Alias "SetWindowLongA" (ByVal hWnd As Long, _

        ByVal nIndex As Long, ByVal dwNewLong As Long) _

        As Long


Private Declare Function CallWindowProc Lib "user32" _

        Alias "CallWindowProcA" (ByVal lpPrevWndFunc _

        As Long, ByVal hWnd As Long, ByVal Msg As _

        Long, ByVal wParam As Long, ByVal lParam As _

        Long) As Long


Private Const WM_NCLBUTTONDBLCLK = &HA3

Private Const WM_NCLBUTTONDOWN = &HA1

Private Const WM_NCLBUTTONUP = &HA2


Const GWL_WNDPROC = (-4&)

Dim PrevWndProc&




Public Sub Init(hWnd As Long)

  PrevWndProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf SubWndProc)

End Sub


Public Sub Terminate(hWnd As Long)

  Call SetWindowLong(hWnd, GWL_WNDPROC, PrevWndProc)

End Sub


Private Function SubWndProc(ByVal hWnd As Long, _

                            ByVal Msg As Long, _

                            ByVal wParam As Long, _

                            ByVal lParam As Long) As Long


  If Msg = WM_NCLBUTTONDBLCLK Then

     MsgBox ("DoubleClick")

  End If

  SubWndProc = CallWindowProc(PrevWndProc, hWnd, Msg, wParam, lParam)

End Function

Nun habe ich folgendes Problem: Das Doppelklickereignis wird in den Non-Client-Bereichen mit der Message-Box quittiert, in den Client-Bereichen aber nicht! Hängt die Varieble Msg von dem Bereich ab, auf den ich klicke?

Ich hoffe, einer von Euch kann mir helfen.

cu, frankos

Erstelle ein Benutzerkonto oder melde Dich an, um zu kommentieren

Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde Dich hier an.

Jetzt anmelden

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...