Deklaration: Declare Function GetWindowExtEx Lib "gdi32" ( _ ByVal hdc As Long, _ lpSize As POINTAPI) As Long Beschreibung: Parameter:
Rückgabewert: Beispiel: Private Declare Function SetMapMode Lib "gdi32" ( _ ByVal hdc As Long, _ ByVal nMapMode As Long) As Long Private Declare Function GetMapMode Lib "gdi32" (ByVal hdc As Long) As Long Private Declare Function GetWindowExtEx Lib "gdi32" ( _ ByVal hdc As Long, _ lpSize As POINTAPI) As Long Private Declare Function SetWindowExtEx Lib "gdi32" ( _ ByVal hdc As Long, _ ByVal nX As Long, _ ByVal nY As Long, _ lpSize As Any) As Long Private Declare Function GetViewportExtEx Lib "gdi32" ( _ ByVal hdc As Long, _ lpSize As POINTAPI) As Long Private Declare Function SetViewportExtEx Lib "gdi32" ( _ ByVal hdc As Long, _ ByVal nX As Long, _ ByVal nY As Long, _ lpSize As Any) As Long Private Declare Function Polyline Lib "gdi32" ( _ ByVal hdc As Long, _ lpPoint As POINTAPI, _ ByVal nCount As Long) As Long Private Declare Function GetClientRect Lib "user32" ( _ ByVal hwnd As Long, _ lpRect As RECT) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Type POINTAPI x As Long y As Long End Type ' Get- / SetMapMode Rückgabe- / nMapMode-Konstanten Private Const MM_ANISOTROPIC = 8 ' Benutzerdefiniert, X- und Y-Achse haben verschiedene Skalierungen. ' Benutzen Sie die Get-/SetViewPortExtEx-Funktion und die ' Get-/SetWindowExtEx-Funktion, um die Maßeinheiten zu definieren Private Const MM_HIENGLISH = 5 ' Jeder logische Schritt ist 0,001 Inch Private Const MM_HIMETRIC = 3 ' Jeder logische Schritt ist 0,01 Millimeter Private Const MM_ISOTROPIC = 7 ' Benutzerdefiniert, X- und Y-Achse haben die selben Skalierungen. ' Benutzen Sie die Get-/SetViewPortExtEx-Funktion und die ' Get-/SetWindowExtEx-Funktion, um die Maßeinheit zu definieren Private Const MM_LOENGLISH = 4 ' Jeder logische Schritt ist 0,01 Inch Private Const MM_LOMETRIC = 2 ' Jeder logische Schritt ist 0,1 Millimeter Private Const MM_TEXT = 1 ' Jeder logische Schritt ist ein Pixel Private Const MM_TWIPS = 6 ' Jeder logische Schritt ist ein Twip Dim OldMapMode As Long, OldWindowExt As POINTAPI, OldViewport As POINTAPI Dim TmpPT(5) As POINTAPI, ClientR As RECT ' Skalierung der Form ermitteln Private Sub Form_Load() Dim RetVal As Long ' Aktuelle Skalierung ermitteln OldMapMode = GetMapMode(Me.hdc) Call GetViewportExtEx(Me.hdc, OldViewport) Call GetWindowExtEx(Me.hdc, OldWindowExt) ' Figur festlegen (Sechseck) TmpPT(0).x = 50 TmpPT(0).y = 2 TmpPT(1).x = 98 TmpPT(1).y = 35 TmpPT(2).x = 79 TmpPT(2).y = 90 TmpPT(3).x = 21 TmpPT(3).y = 90 TmpPT(4).x = 2 TmpPT(4).y = 35 TmpPT(5).x = 50 TmpPT(5).y = 2 End Sub ' Figur zeichnen (2 logische Schritte Abstand zu jedem Rand) Private Sub Form_Paint() Me.Cls ' Fensterbereich ermitteln Call GetClientRect(Me.hwnd, ClientR) ' Neue Skalierung der Form setzen (100/92 Schritte = Fensterbreite / Höhe) Call SetMapMode(Me.hdc, MM_ANISOTROPIC) ' Benutzerdefinierten Typen wählen Call SetWindowExtEx(Me.hdc, 100, 92, ByVal 0&) ' Das Fenster soll ' 100/92 logische Schritte hoch und breit sein Call SetViewportExtEx(Me.hdc, ClientR.Right, ClientR.Bottom, ByVal 0&) _ ' Die 100/92 Schritte ergeben sich aus der Fensterhöhe und Breite Call Polyline(Me.hdc, TmpPT(0), 6) ' Figur Zeichnen Me.CurrentX = 10 Me.CurrentY = 10 Me.Print "Hallo" End Sub Private Sub Form_Resize() Me.Refresh End Sub ' Alte Skalierung wieder herstellen Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Call SetMapMode(Me.hdc, OldMapMode) Call SetViewportExtEx(Me.hdc, OldViewport.x, OldViewport.y, ByVal 0&) Call SetWindowExtEx(Me.hdc, OldWindowExt.x, OldWindowExt.y, ByVal 0&) End Sub Diese Seite wurde bereits 7.582 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 April 2024 Skyfloy Chart von Microsoft und dazu noch gratis Tutorial für Microsoft Chart Controls für Microsoft .NET Framework 3.5 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. |