Deklaration: Declare Function CreateEllipticRgnIndirect Lib "gdi32.dll" (lpRect As RECT) As Long Beschreibung: Parameter:
Rückgabewert: Beispiel: Private Declare Function CreateRoundRectRgn Lib "gdi32.dll" ( _ ByVal X1 As Long, _ ByVal Y1 As Long, _ ByVal X2 As Long, _ ByVal Y2 As Long, _ ByVal X3 As Long, _ ByVal Y3 As Long) As Long Private Declare Function CreateEllipticRgnIndirect Lib "gdi32.dll" ( _ lpRect As RECT) As Long Private Declare Function GetWindowRgn Lib "user32.dll" ( _ ByVal hwnd As Long, _ ByVal hRgn As Long) As Long Private Declare Function SetWindowRgn Lib "user32.dll" ( _ ByVal hwnd As Long, _ ByVal hRgn As Long, _ ByVal bRedraw As Boolean) As Long Private Declare Function DeleteObject Lib "gdi32" ( _ ByVal hObject As Long) As Long Private Declare Function CreatePolygonRgn Lib "gdi32.dll" ( _ lpPoint As POINTAPI, _ ByVal nCount As Long, _ ByVal nPolyFillMode As Long) As Long Private Declare Function GetWindowRect Lib "user32" ( _ ByVal hwnd As Long, _ lpRect As RECT) As Long Private Declare Function CreateRectRgnIndirect Lib "gdi32.dll" ( _ lpRect As RECT) As Long Private Declare Function InflateRect Lib "user32.dll" ( _ lpRect As RECT, _ ByVal x As Long, _ ByVal y As Long) As Long Private Declare Function CopyRect Lib "user32.dll" ( _ lpDestRect As RECT, _ lpSourceRect As RECT) As Long Private Declare Function EqualRgn Lib "gdi32.dll" ( _ ByVal hSrcRgn1 As Long, _ ByVal hSrcRgn2 As Long) As Long Private Declare Function SetRect Lib "user32.dll" ( _ lpRect As RECT, _ ByVal X1 As Long, _ ByVal Y1 As Long, _ ByVal X2 As Long, _ ByVal Y2 As Long) As Long Private Type POINTAPI x As Long y As Long End Type Private Type RECT left As Long top As Long right As Long bottom As Long End Type ' CreatePolygonRgn nPolyFillMode-Konstanten Private Const ALTERNATE = 1 ' Alternative zwischen gefüllt und ungefüllt Private Const WINDING = 2 ' Das Dreieck normal gefüllt Dim RectRgn As Long, EllipticRgn As Long Dim PolygonRgn As Long, RoundRectRgn As Long Dim BufferRgn As Long ' erstellt vier Regionen Private Function CreateRgns() Dim Retval As Long, WndRect As RECT Dim Polygon(2) As POINTAPI, TmpRect As RECT ' Fensterkoordinaten ermitteln und Breite und Höhe ausrechnen Retval = GetWindowRect(Me.hwnd, WndRect) Retval = SetRect(WndRect, 0, 0, WndRect.right - WndRect.left, _ WndRect.bottom - WndRect.top) ' eine Region zum Empfangen von Regiondaten erstellen BufferRgn = CreateRectRgnIndirect(TmpRect) ' Kopie der Fensterkoordinaten anlegen und verkleinern Retval = CopyRect(TmpRect, WndRect) Retval = InflateRect(TmpRect, -50, -50) ' rechteckige Region erstellen RectRgn = CreateRectRgnIndirect(TmpRect) ' elliptische Region erstellen EllipticRgn = CreateEllipticRgnIndirect(WndRect) ' Region mit abgerundeten Ecken erstellen With WndRect RoundRectRgn = CreateRoundRectRgn(.left, .top, .right, .bottom, _ 50, 50) End With ' dreieckige Region erstellen With Polygon(0) .x = 0 .y = 0 End With With Polygon(1) .x = WndRect.right .y = 0 End With With Polygon(2) .x = WndRect.right / 2 .y = WndRect.bottom End With PolygonRgn = CreatePolygonRgn(Polygon(0), 3, WINDING) End Function ' Regionen erstellen und Info ausgeben Private Sub Form_Load() ' Regionen erstellen Call CreateRgns ' Text auf die Form zeichnen für die Anweisungen Me.AutoRedraw = True Me.Print "Klicken sie mehrmals auf die Form" End Sub Private Sub Form_Click() Static NextOp As Long Dim Retval As Long ' aktuell gesetzte Region ermitteln und alte entfernen Retval = GetWindowRgn(Me.hwnd, BufferRgn) NextOp = NextOp + 1 If NextOp < 5 Then NextOp = 1 ' neue Region setzen Select Case NextOp Case 1 Retval = SetWindowRgn(Me.hwnd, EllipticRgn, True) Case 2 Retval = SetWindowRgn(Me.hwnd, PolygonRgn, True) Case 3 Retval = SetWindowRgn(Me.hwnd, RoundRectRgn, True) Case 4 Retval = SetWindowRgn(Me.hwnd, RectRgn, True) Case 5 Retval = SetWindowRgn(Me.hwnd, 0&, True) ' Der Form keine Region zuweisen Call CreateRgns ' Regionen erneut erstellen End Select End Sub ' erstellte Regionen wieder entfernen Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) DeleteObject EllipticRgn DeleteObject PolygonRgn DeleteObject RoundRectRgn DeleteObject StdRgn DeleteObject BufferRgn End Sub Diese Seite wurde bereits 6.749 mal aufgerufen. |
sevISDN 1.0 Überwachung aller eingehender Anrufe! Die DLL erkennt alle über die CAPI-Schnittstelle eingehenden Anrufe und teilt Ihnen sogar mit, aus welchem Ortsbereich der Anruf stammt. Weitere Highlights: Online-Rufident, Erkennung der Anrufbehandlung u.v.m. Buchempfehlung Tipp des Monats Mai 2024 Hermann Röttger Wochentage eines Datumsbereichs ermitteln Wochentage eines Datumsbereichs ermitteln, optional mit Feiertagsberechnung Neu! sevDTA 3.0 Pro SEPA mit Kontonummernprüfung Erstellen von SEPA-Dateien mit integriertem BIC-Verzeichnis und Konto- nummern-Prüfverfahren, so dass ungültige Bankdaten bereits im Vorfeld ermittelt werden können. |
||||||||||||
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein. |