AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Welcher Cursor ist gerade aktiv

Ein Thema von EWeiss · begonnen am 18. Jun 2007 · letzter Beitrag vom 22. Jun 2007
 
EWeiss
(Gast)

n/a Beiträge
 
#3

Re: Welcher Cursor ist gerade aktiv

  Alt 18. Jun 2007, 18:22
Zitat von marabu:
Hallo Emil,

den aktuell verwendeten Cursor solltest du jederzeit in Screen.Cursor finden - wenn ich mich nicht täusche.

Freundliche Grüße
Werde es mal testen.
Um was es mir geht bei dieser frage.

Ich möchte ein resize verhalten ala Winamp verwirklichen ohne extrem viele coordinaten abzufragen.
Meine Idee ist das über die abfrage des aktuell initialisierten cursor zu erreichen.

Dann benötige ich keine zusätzlichen coordinaten wo sich die Maus zur zeit befindet.
Ein Beispiel in VB habe ich schon geschrieben und es funktioniert mit ein paar zeilen.

Nur meine umsetzung von Vb nach Delphi macht wieder probleme.

Delphi-Quellcode:
Option Explicit

Private Sub ControlMouseMove(aCtrl As Object, Button As Integer, Shift As Integer, X As Single, Y As Single)

Dim iTwipX, iTwipY
Dim iScale As Integer

    On Error Resume Next
        
        iScale = aCtrl.ScaleMode
        iTwipX = Screen.TwipsPerPixelX
        iTwipY = Screen.TwipsPerPixelY
        aCtrl.ScaleMode = 3

        If Button = vbLeftButton Then
            If MP = 0 Then GoTo Fix_Scale
            If MP = 7 Then GoTo NS_Resize

            If X / iTwipX > aCtrl.ScaleWidth + iTwipX Then
                aCtrl.Width = aCtrl.Width + iTwipX ^ 2 * 2
            ElseIf X / iTwipX < aCtrl.ScaleWidth - iTwipX Then
                aCtrl.Width = aCtrl.Width - iTwipX ^ 2 * 2
            End If
            Form1.Width = aCtrl.Left + aCtrl.Width
            aCtrl.Left = Form1.Width - 255
            If MP = 9 Then GoTo Fix_Scale
NS_Resize:

            If Y / iTwipY > aCtrl.ScaleHeight + iTwipY Then
                aCtrl.Height = aCtrl.Height + iTwipY ^ 2 * 2
            ElseIf Y / iTwipY < aCtrl.ScaleHeight - iTwipY Then
                aCtrl.Height = aCtrl.Height - iTwipY ^ 2 * 2
            End If
            Form1.Height = aCtrl.Top + aCtrl.Height
            aCtrl.Top = Form1.Height - 255
        Else
            If X / iTwipX > aCtrl.ScaleWidth - 12 _
               And Y / iTwipY > aCtrl.ScaleHeight - 10 Then
                MP = 8
            ElseIf X / iTwipX > aCtrl.ScaleWidth - 12 _
                   And Y / iTwipY < aCtrl.ScaleHeight - 10 Then
                MP = 9
            ElseIf X / iTwipX < aCtrl.ScaleWidth - 12 _
                   And Y / iTwipY > aCtrl.ScaleHeight - 10 Then
                MP = 7
            Else
                MP = 0
            End If
        End If
        Label1.Caption = CStr(MP)
Fix_Scale:
        aCtrl.ScaleMode = iScale%

End Sub

Private Sub Form_DblClick()

    Unload Me
    
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    MP = 0
    
End Sub

Private Property Let MP(aMPVal As Integer)

    Me.MousePointer = aMPVal

End Property

Private Property Get MP() As Integer

    MP = Me.MousePointer

End Property

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Call ControlMouseMove(Picture1, Button, Shift, X, Y)

End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    MP = 0

End Sub
gruss Emil
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:14 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz